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-3.0.11 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-3.0.10 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-3.0.9 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-3.0.8 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-3.0.7 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-2.0.28 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-3.0.6 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-2.0.27 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-3.0.4 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-3.0.3 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-3.0.2 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-3.0.1 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-3.0.0 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-2.0.26 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-2.0.25 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-2.0.24 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-2.0.23 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-2.0.22 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-2.0.21 db/migrate/017_rename_created_by_updated_by_columns.rb
trusty-cms-2.0.21.alpha db/migrate/017_rename_created_by_updated_by_columns.rb