Sha256: 860a2f2099d232fb7007696724bc7110076cfc0d6820916272cdb2e27488fe53

Contents?: true

Size: 453 Bytes

Versions: 121

Compression:

Stored size: 453 Bytes

Contents

class RenameCreatedByUpdatedByColumns < ActiveRecord::Migration
  def self.up
    %w{pages snippets layouts users}.each do |table|
      rename_column table, :created_by, :created_by_id
      rename_column table, :updated_by, :updated_by_id
    end
  end

  def self.down
    %w{pages snippets layouts users}.each do |table|
      rename_column table, :created_by_id, :created_by
      rename_column table, :updated_by_id, :updated_by
    end
  end
end

Version data entries

121 entries across 121 versions & 6 rubygems

Version Path
trusty-cms-1.1.11 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-1.1.10 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-1.1.9 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-1.1.8 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-1.1.7 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-1.1.6 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-1.1.5 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-1.1.4 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-1.1.3 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-1.1.2 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-1.1.1 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-1.1.0 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-1.1.0.rc1 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-1.0.1 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-1.0.0 db/migrate/017_rename_created_by_updated_by_columns.rb
radiant-1.1.4 db/migrate/017_rename_created_by_updated_by_columns.rb
radiant-1.1.3 db/migrate/017_rename_created_by_updated_by_columns.rb
radiant-1.1.2 db/migrate/017_rename_created_by_updated_by_columns.rb
radiant-1.1.1 db/migrate/017_rename_created_by_updated_by_columns.rb
radiant-1.1.0 db/migrate/017_rename_created_by_updated_by_columns.rb