Sha256: aff299b3cf254c3d458e7b6a2f38794da2887f34e3b94f9fac8bbaf403e90067

Contents?: true

Size: 531 Bytes

Versions: 14

Compression:

Stored size: 531 Bytes

Contents

class CreateMessages < ActiveRecord::Migration
  def up
    create_table table_name do |t|
      t.integer :sender
      t.string :recipients, :default => [].to_yaml
      t.string :subject
      t.text :content
      
      t.boolean :last, :default => false, :null => :false

      t.integer :chain_id
 
      t.timestamps
    end
    add_index table_name, :created_at
    add_index table_name, :chain_id
  end

  def down
    drop_table table_name
  end

  def table_name
    Carrier.config.models.table_for(:message)
  end
end

Version data entries

14 entries across 7 versions & 1 rubygems

Version Path
carrier-0.1.5 spec/dummy/db/migrate/20110814164228_create_messages.rb
carrier-0.1.5 db/migrate/001_create_messages.rb
carrier-0.1.4 spec/dummy/db/migrate/20110814164228_create_messages.rb
carrier-0.1.4 db/migrate/001_create_messages.rb
carrier-0.1.3 db/migrate/001_create_messages.rb
carrier-0.1.3 spec/dummy/db/migrate/20110814164228_create_messages.rb
carrier-0.1.2 spec/dummy/db/migrate/20110814164228_create_messages.rb
carrier-0.1.2 db/migrate/001_create_messages.rb
carrier-0.1.1 spec/dummy/db/migrate/20110814164228_create_messages.rb
carrier-0.1.1 db/migrate/001_create_messages.rb
carrier-0.1.0 spec/dummy/db/migrate/20110814164228_create_messages.rb
carrier-0.1.0 db/migrate/001_create_messages.rb
carrier-0.0.6 db/migrate/001_create_messages.rb
carrier-0.0.6 spec/dummy/db/migrate/20110814164228_create_messages.rb