Sha256: ca6b9d052447ad302cdfce08ae05cac11a86ab41aa44a3782f0bf1b92672173c

Contents?: true

Size: 516 Bytes

Versions: 11

Compression:

Stored size: 516 Bytes

Contents

class CreateMessageRecipients < ActiveRecord::Migration
  def self.up
    create_table :message_recipients do |t|
      t.references :message, :null => false
      t.references :receiver, :polymorphic => true, :null => false
      t.string :kind, :null => false
      t.integer :position
      t.string :state, :null => false
      t.datetime :hidden_at
    end
    add_index :message_recipients, [:message_id, :kind, :position], :unique => true
  end
  
  def self.down
    drop_table :message_recipients
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
pluginaweek-has_messages-0.4.0 db/migrate/002_create_message_recipients.rb
has_messages_huacnlee-0.4.1 lib/generators/has_messages/templates/002_create_message_recipients.rb
has_messages-0.4.1 generators/has_messages/templates/002_create_message_recipients.rb
has_messages-0.1.2 db/migrate/002_create_message_recipients.rb
has_messages-0.1.3 db/migrate/002_create_message_recipients.rb
has_messages-0.3.0 db/migrate/002_create_message_recipients.rb
has_messages-0.3.1 db/migrate/002_create_message_recipients.rb
has_messages-0.4.0 db/migrate/002_create_message_recipients.rb
has_messages-0.2.0 db/migrate/002_create_message_recipients.rb
has_messages-0.1.0 db/migrate/002_create_message_recipients.rb
has_messages-0.1.1 db/migrate/002_create_message_recipients.rb