Sha256: f1149f3d21f5d3300bc13a7b4fb7dac7117af78a72ace8a8b852afd1e66adbd7

Contents?: true

Size: 1.33 KB

Versions: 11

Compression:

Stored size: 1.33 KB

Contents

class CreateMailboxer < ActiveRecord::Migration
  def self.up    
    create_table :conversations do |t|
      t.column :subject, :string, :default => ""
      t.column :created_at, :datetime, :null => false
      t.column :updated_at, :datetime, :null => false
    end    
    create_table :receipts do |t|
      t.references :receiver, :polymorphic => true
      t.column :message_id, :integer, :null => false
      t.column :read, :boolean, :default => false
      t.column :trashed, :boolean, :default => false
      t.column :deleted, :boolean, :default => false
      t.column :mailbox_type, :string, :limit => 25
      t.column :created_at, :datetime, :null => false
      t.column :updated_at, :datetime, :null => false
    end    
    create_table :messages do |t|
      t.column :body, :text
      t.column :subject, :string, :default => ""
      t.column :headers, :text
      t.references :sender, :polymorphic => true
      t.column :conversation_id, :integer
      t.column :sent, :boolean, :default => false
      t.column :draft, :boolean, :default => false
      t.column :system, :boolean, :default => false
      t.column :updated_at, :datetime, :null => false
      t.column :created_at, :datetime, :null => false
    end    
  end
  
  def self.down
    drop_table :receipts
    drop_table :conversations
    drop_table :messages
  end
end

Version data entries

11 entries across 6 versions & 1 rubygems

Version Path
mailboxer-0.0.14 spec/dummy/db/migrate/20110322000127_create_mailboxer.rb
mailboxer-0.0.13 lib/generators/mailboxer/templates/migration.rb
mailboxer-0.0.13 spec/dummy/db/migrate/20110322000127_create_mailboxer.rb
mailboxer-0.0.12 spec/dummy/db/migrate/20110322000127_create_mailboxer.rb
mailboxer-0.0.12 lib/generators/mailboxer/templates/migration.rb
mailboxer-0.0.11 spec/dummy/db/migrate/20110322000127_create_mailboxer.rb
mailboxer-0.0.11 lib/generators/mailboxer/templates/migration.rb
mailboxer-0.0.10 lib/generators/mailboxer/templates/migration.rb
mailboxer-0.0.10 spec/dummy/db/migrate/20110322000127_create_mailboxer.rb
mailboxer-0.0.9 lib/generators/mailboxer/templates/migration.rb
mailboxer-0.0.9 spec/dummy/db/migrate/20110322000127_create_mailboxer.rb