Sha256: f980890205473b292813bfc13ffbbdfaf6000423da66d32484cd1bd0d8cb8ab8

Contents?: true

Size: 824 Bytes

Versions: 32

Compression:

Stored size: 824 Bytes

Contents

class UserRelations < ActiveRecord::Migration
  
  # mostly for migrating old sites where users were talking
  # but also useful for admin moderation, probably
  # they already have created_at and updated_at
  
  def self.up
    add_column :posts, :created_by_id, :integer unless Post.column_names.include?("created_by_id")
    add_column :posts, :updated_by_id, :integer unless Post.column_names.include?("updated_by_id")
    add_column :topics, :created_by_id, :integer unless Topic.column_names.include?("created_by_id")
    add_column :topics, :updated_by_id, :integer unless Topic.column_names.include?("updated_by_id")
  end

  def self.down
    remove_column :posts, :created_by_id
    remove_column :posts, :updated_by_id
    remove_column :topics, :created_by_id
    remove_column :topics, :updated_by_id
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
radiant-forum-extension-3.0.7 db/migrate/006_user_relations.rb
radiant-forum-extension-3.0.6 db/migrate/006_user_relations.rb
radiant-forum-extension-3.0.5 db/migrate/006_user_relations.rb
radiant-forum-extension-3.0.4 db/migrate/006_user_relations.rb
radiant-forum-extension-3.0.3 db/migrate/006_user_relations.rb
radiant-forum-extension-3.0.2 db/migrate/006_user_relations.rb
radiant-forum-extension-3.0.1 db/migrate/006_user_relations.rb
radiant-forum-extension-3.0.0 db/migrate/006_user_relations.rb
radiant-forum-extension-3.0.0.rc6 db/migrate/006_user_relations.rb
radiant-forum-extension-3.0.0.rc4 db/migrate/006_user_relations.rb
radiant-forum-extension-3.0.0.rc3 db/migrate/006_user_relations.rb
radiant-forum-extension-2.1.6 db/migrate/006_user_relations.rb
radiant-forum-extension-2.1.4 db/migrate/006_user_relations.rb
radiant-forum-extension-2.1.3 db/migrate/006_user_relations.rb
radiant-forum-extension-2.1.2 db/migrate/006_user_relations.rb
radiant-forum-extension-2.1.1 db/migrate/006_user_relations.rb
radiant-forum-extension-2.0.9 db/migrate/006_user_relations.rb
radiant-forum-extension-2.0.8 db/migrate/006_user_relations.rb
radiant-forum-extension-2.0.7 db/migrate/006_user_relations.rb
radiant-forum-extension-2.0.6 db/migrate/006_user_relations.rb