Sha256: 7e21e9d300016d1333729186d22d15e38711076df3dad37aecc085f94d905ed9
Contents?: true
Size: 384 Bytes
Versions: 23
Compression:
Stored size: 384 Bytes
Contents
class AddIdToTimeTablePeriod < ActiveRecord::Migration def change # active record can't add primary key after table creation # must do SQL direct command execute <<-SQL ALTER TABLE time_table_periods ADD COLUMN id bigserial SQL execute <<-SQL ALTER TABLE time_table_periods ADD CONSTRAINT time_table_periods_pkey PRIMARY KEY (id) SQL end end
Version data entries
23 entries across 23 versions & 1 rubygems