Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SchemaPlus
Search
Michał Łomnicki
November 21, 2012
Technology
49
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
280
Forget Ruby. Forget CoffeeScript. Do SOA
mlomnicki
1
130
Having fun with legacy apps
mlomnicki
1
77
CAP Theorem
mlomnicki
2
140
[PL] Transakcje w bazach danych
mlomnicki
1
290
Ruby Tricks 2
mlomnicki
3
79
Other Decks in Technology
See All in Technology
Making sense of Google’s agentic dev tools
glaforge
1
120
最適な自走を最小限の支援で — M&Aで拡大する組織で少人数SREが挑んだ1年 / SRE NEXT 2026
genda
0
720
“全部コピーしない”ファイルデータの活用 : — FSx for ONTAP × S3 Tables × Icebergで作るメタデータカタログ
yoshiki0705
0
640
CSに"SLO"は要らない、経営層に"99.9%"は伝わらない - SREを全社に"翻訳"する3原則
cscengineer
PRO
1
4.1k
生成AIの活用/high_school2026
okana2ki
0
120
FinOps X 2026 Recap from Engineer Side #JapanFinOps
chacco38
0
270
GuardrailからGovernanceへ~AIエージェント運用の次の課題~
sbspsy
1
240
SRE依存からの脱却 運用を開 発チームへ移す、 フルサイ クル開 発体制の実践
joooee0000
0
2.3k
AI時代における最適なQA組織の作り方
ymty
3
490
SRE Lounge Hiroshimaへの招待
grimoh
0
550
ローカルLLMとLINE Botの組み合わせ その3 / LINE DC Generative AI Meetup #8
you
PRO
0
130
CIで使うClaude
iwatatomoya
0
200
Featured
See All Featured
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
370
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Building Applications with DynamoDB
mza
96
7.1k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
260
The SEO Collaboration Effect
kristinabergwall1
1
500
Accessibility Awareness
sabderemane
1
150
Skip the Path - Find Your Career Trail
mkilby
1
160
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
310
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
330
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
870
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