rails
rails copied to clipboard
Support adding and removing `CHECK` constraints in bulk `change_table`
change_table :users, bulk: true do |t|
t.integer :age
t.check_constraint "age >= 0"
end
Before
(0.5ms) ALTER TABLE "users" ADD "age" integer
(0.4ms) ALTER TABLE "users" ADD CONSTRAINT chk_rails_124019740c CHECK (age >= 0)
After
(0.8ms) ALTER TABLE "users" ADD "age" integer, ADD CONSTRAINT chk_rails_124019740c CHECK (age >= 0)