Sha256: 4985f2b7eff35be374c07b1f39b5f8d40db4c9ff33aea1b712f860fbc149d162

Contents?: true

Size: 1.09 KB

Versions: 12

Compression:

Stored size: 1.09 KB

Contents

class CreateMailboxer < ActiveRecord::Migration
  def self.up    
    create_table :mailboxer_conversations do |t|
      t.column :subject, :string, :default => ""
      t.column :created_at, :datetime, :null => false
    end    
    create_table :mailboxer_mails do |t|
      t.references :receiver, :polymorphic => true
      t.column :mailboxer_message_id, :integer, :null => false
      t.column :read, :boolean, :default => false
      t.column :trashed, :boolean, :default => false
      t.column :mailbox_type, :string, :limit => 25
      t.column :created_at, :datetime, :null => false
    end    
    create_table :mailboxer_messages do |t|
      t.column :body, :text
      t.column :subject, :string, :default => ""
      t.column :headers, :text
      t.references :sender, :polymorphic => true
      t.column :mailboxer_conversation_id, :integer
      t.column :sent, :boolean, :default => false
      t.column :created_at, :datetime, :null => false
    end    
  end
  
  def self.down
    drop_table :mailboxer_mails
    drop_table :mailboxer_conversations
    drop_table :mailboxer_messages
  end
end

Version data entries

12 entries across 6 versions & 1 rubygems

Version Path
mailboxer-0.0.7 spec/dummy/db/migrate/20110303122122_create_mailboxer.rb
mailboxer-0.0.7 lib/generators/mailboxer/templates/migration.rb
mailboxer-0.0.6 lib/generators/mailboxer/templates/migration.rb
mailboxer-0.0.6 spec/dummy/db/migrate/20110303122122_create_mailboxer.rb
mailboxer-0.0.5 lib/generators/mailboxer/templates/migration.rb
mailboxer-0.0.5 spec/dummy/db/migrate/20110303122122_create_mailboxer.rb
mailboxer-0.0.4 lib/generators/mailboxer/templates/migration.rb
mailboxer-0.0.4 spec/dummy/db/migrate/20110303122122_create_mailboxer.rb
mailboxer-0.0.3 spec/dummy/db/migrate/20110303122122_create_mailboxer.rb
mailboxer-0.0.3 lib/generators/mailboxer/templates/migration.rb
mailboxer-0.0.2 lib/generators/mailboxer/templates/migration.rb
mailboxer-0.0.2 spec/dummy/db/migrate/20110303122122_create_mailboxer.rb