Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
SchemaPlus
Search
Michał Łomnicki
November 21, 2012
Technology
51
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SchemaPlus
Michał Łomnicki
November 21, 2012
More Decks by Michał Łomnicki
See All by Michał Łomnicki
DDD, Rails and persistence
mlomnicki
1
290
Forget Ruby. Forget CoffeeScript. Do SOA
mlomnicki
1
130
Having fun with legacy apps
mlomnicki
1
81
CAP Theorem
mlomnicki
2
150
[PL] Transakcje w bazach danych
mlomnicki
1
300
Ruby Tricks 2
mlomnicki
3
84
Other Decks in Technology
See All in Technology
2拠点SRE活動始めてみた | sogaoh's LT @ ホンマでっかSRE勉強会 #3
sogaoh
PRO
0
220
"AWSはちょっと苦手"でも大丈夫。AWS Blocks で手軽に作る Flutter のバックエンド #FlutterKaigi
tacck
PRO
0
120
仕様駆動開発の、その先へ。決める力と確かめる仕組み
inariku
1
150
Agent 活用環境の構築・運用のための AWS サービスのご紹介/agentcore-for-building-and-operating-agents
ren8k
1
310
Patterns in AI Driven Software Development
akosma
PRO
0
420
"計画的無茶振り"を通してAIネイティブ世代の新人を育てる
subroh0508
1
140
書き手が人でもAIでも正しくなる道、SREを埋め込んだDeveloper Platform / tech drivers day8
chmikata
4
870
200人の配信コメント、 全部Jevが仕分けます 〜 マサカリガードを作ってみた 〜
katayamatg
1
490
Systems Manager AgentがインストールされたPCを紛失した時の対策を考えてみた
amarelo_n24
1
110
AIエージェント統制はAPIから——押さえるべき5つの要素
nagix
0
110
AI AgentによるEmbedded SREの取り組み
tgidgd
1
310
AIコーディングはじめました
miso
0
120
Featured
See All Featured
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
BBQ
matthewcrist
90
10k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.2k
Google's AI Overviews - The New Search
badams
0
1.6k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
The Curse of the Amulet
leimatthew05
3
16k
Side Projects
sachag
456
43k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
The untapped power of vector embeddings
frankvandijk
2
2k
Transcript
SchemaPlus enhanced capabilities for schema definition and querying Ronen Barzel
& Michał Łomnicki
History Simon Harris / harukizaemon redhillonrails_core (2006, 2009) foreign_key_migrations =>
automatic_foreign_key schema_plus (2011)
Goals solid base well-tested well-documented better name :)
Plain ActiveRecord create_table :comments do |t| t.text :body t.integer :post_id
t.integer :author_id end execute "ALTER TABLE comments ADD FOREIGN KEY (post_id) \ REFERENCES (posts)" execute "ALTER TABLE comments ADD FOREIGN KEY (author_id) \ REFERENCES (users)" add_index :comments, :post_id
With schema_plus create_table :comments do |t| t.text :body t.integer :post_id,
:index => true t.integer :author_id, :references => :users end
auto-index foreign keys # without auto_index t.integer :post_id, :index =>
true # with auto_index t.integer :post_id
index t.string :area_code t.string :local_number, :index => { :unique =>
true, :with => :area_code }
Other features global, per table and per statement config expressional
indexes views
SchemaAssociations # without schema_associations class Post < ActiveRecord::Base belongs_to :author
has_many :comments end
SchemaAssociations # without schema_associations class Post < ActiveRecord::Base # associations
auto-created from foreign keys end
SchemaValidations create_table :posts do |t| t.integer :author_id, :null => false,
:references => :users t.integer :likes_count t.string :content, :limit => 5_000 end
SchemaValidations # without schema_validations class Post < ActiveRecord::Base validates :author,
:presence => true validates :likes_count, :numericality => true validates :content, :length => { :maximum => 5_000 } end
SchemaValidations # with schema_validations class Post < ActiveRecord::Base end
Schema Family Scary? ...but that's next step for active record
pattern
Questions http://github.com/lomba