Sha256: 4e4a2307ba5c7cc6193148d6054a92090181dcb9e3680979555068ff44fd2167

Contents?: true

Size: 719 Bytes

Versions: 12

Compression:

Stored size: 719 Bytes

Contents

class CreateMessagesTable < ActiveRecord::Migration
  def self.up
    create_table :<%= table_name %> do |t|
      t.string :topic
      t.text :body
      t.references :received_messageable, :polymorphic => true
      t.references :sent_messageable, :polymorphic => true
      t.boolean :opened, :default => false
      t.boolean :recipient_delete, :default => false
      t.boolean :sender_delete, :default => false
      t.timestamps

      # ancestry
      t.string :ancestry
    end

    add_index :<%= table_name %>, [:sent_messageable_id, :received_messageable_id], :name => "acts_as_messageable_ids"
    add_index :<%= table_name %>, :ancestry
  end

  def self.down
    drop_table :<%= table_name %>
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
acts-as-messageable-0.4.11 lib/generators/acts-as-messageable/migration/templates/migration.rb
acts-as-messageable-0.4.10 lib/generators/acts-as-messageable/migration/templates/migration.rb
acts-as-messageable-0.4.9 lib/generators/acts-as-messageable/migration/templates/migration.rb
acts-as-messageable-0.4.8 lib/generators/acts-as-messageable/migration/templates/migration.rb
acts-as-messageable-0.4.7 lib/generators/acts-as-messageable/migration/templates/migration.rb
acts-as-messageable-0.4.6 lib/generators/acts-as-messageable/migration/templates/migration.rb
acts-as-messageable-0.4.5 lib/generators/acts-as-messageable/migration/templates/migration.rb
acts-as-messageable-0.4.4 lib/generators/acts-as-messageable/migration/templates/migration.rb
acts-as-messageable-0.4.3 lib/generators/acts-as-messageable/migration/templates/migration.rb
acts-as-messageable-0.4.2 lib/generators/acts-as-messageable/migration/templates/migration.rb
acts-as-messageable-0.4.1 lib/generators/acts-as-messageable/migration/templates/migration.rb
acts-as-messageable-0.4.0 lib/generators/acts-as-messageable/migration/templates/migration.rb