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

Version Path
ninoxe-1.2.3 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-1.2.2 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-1.2.1 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-1.2.0 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-1.1.5 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-1.1.4 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-1.1.3 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-1.1.2 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-1.1.1 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-1.1.0 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-1.0.3 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-1.0.2 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-1.0.1 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-1.0.0 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-0.1.6 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-0.1.5 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-0.1.4 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-0.1.3 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-0.1.2 db/migrate/20120926141415_add_id_to_time_table_period.rb
ninoxe-0.1.1 db/migrate/20120926141415_add_id_to_time_table_period.rb