Sha256: 4ed5c5b8ff726e60f41351b536938446ba2c11098015f9881e8c7e88291ddccb

Contents?: true

Size: 609 Bytes

Versions: 41

Compression:

Stored size: 609 Bytes

Contents

class CreateComments < ActiveRecord::Migration
  
  def self.up
    create_table :comments do |t|
      t.text :body
      t.integer :page_id
      t.integer :author_id
      t.string :locale
      t.string :status, :default => 'pending'
      t.timestamps
    end
    add_index :comments, :page_id
    add_index :comments, :author_id
    add_index :comments, :locale
    add_index :comments, :status
  end
  
  def self.down
    drop_table :comments
    remove_index :comments, :page_id
    remove_index :comments, :author_id
    remove_index :comments, :locale
    remove_index :comments, :status
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
tkh_content-0.9.12 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.9.11 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.9.10 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.9.9 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.9.8 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.9.7 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.9.6 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.9.5 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.9.4 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.9.3 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.9.2 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.4.7 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.9.1 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.9 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.4.6 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.4.5 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.4.4 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.4.3 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.4.2 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
tkh_content-0.3.1 lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb