Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow to specify a type for `references` in migrations #16231
This allows to specify a type for created foreign key column in
def change enable_extension 'uuid-ossp' create_table :cars, id: :uuid do |t| t.integer :seats # And other car-specific things end create_table :wheels do |t| t.references :car, type: :uuid, index: true t.integer :radius # And other wheel-specific things end end
Also I've changed PostgreSQL test to use this shiny functionality (looks better, eh?). And if anyone will ever remove this (not by reverting this PR), test will fail, showing that folks that use Postgres really need it ;-)
Bonus: documentation for
P.S> After I wrote this PR I've found PR #13959 (which does the same, but little bit lengthy). Also see it for previous discussion. Choose either you like, I'll be happy with any of these PRs merged.
Will close #13959 if merged.