aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2015-05-04 22:43:07 +0900
committerRyuta Kamizono <kamipo@gmail.com>2015-09-20 12:46:11 +0900
commitfdf371ab0697d43c7eec66418edda9017be9b75b (patch)
tree2e6bbd7ef3012b13fa55e74c474029f0ad5e61a9 /tools
parent26aa1b58b0e9451d15a0ee32da3c004d44e5a356 (diff)
downloadrails-fdf371ab0697d43c7eec66418edda9017be9b75b.tar.gz
rails-fdf371ab0697d43c7eec66418edda9017be9b75b.tar.bz2
rails-fdf371ab0697d43c7eec66418edda9017be9b75b.zip
Support for foreign keys in create table
If foreign keys specified in create table, generated SQL is slightly more efficient. Definition: ``` create_table :testings do |t| t.references :testing_parent, foreign_key: true end ``` Before: ``` CREATE TABLE "testings" ("id" serial primary key, "testing_parent_id" integer); ALTER TABLE "testings" ADD CONSTRAINT "fk_rails_a196c353b2" FOREIGN KEY ("testing_parent_id") REFERENCES "testing_parents" ("id"); ``` After: ``` CREATE TABLE "testings" ("id" serial primary key, "testing_parent_id" integer, CONSTRAINT "fk_rails_a196c353b2" FOREIGN KEY ("testing_parent_id") REFERENCES "testing_parents" ("id")); ```
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions