Sha256: 42d98b5b89dae4360c7fdbfbd456e52aa5ba73d0e1cb9f37f961f12e4e38828d
Contents?: true
Size: 589 Bytes
Versions: 21
Compression:
Stored size: 589 Bytes
Contents
class RemoveTimestampsFromHabtmTables < ActiveRecord::Migration TABLES = [ :areas_projects, :areas_users, :projects_users, :users_roles ] def up # Have to remove timestamps from cause of: # PG::Error: ERROR: null value in column "created_at" violates not-null constraint TABLES.each do |table| remove_column table, :created_at remove_column table, :updated_at end end def down TABLES.each do |table| add_column table, :created_at, :datetime, null: false add_column table, :updated_at, :datetime, null: false end end end
Version data entries
21 entries across 21 versions & 1 rubygems