Sha256: e5f720b9f4aca2a1b84b8ddbd76c2ef901c388c8834d4ad501c4be040ec96d4b
Contents?: true
Size: 846 Bytes
Versions: 14
Compression:
Stored size: 846 Bytes
Contents
class CreateChains < ActiveRecord::Migration def up create_chains end def down drop_chains end protected def create_chains create_table table_name do |t| t.string :participants, :default => [].to_yaml t.string :archived_for, :default => [].to_yaml t.references :having_chain, :polymorphic => true t.string :chain_type, :default => :simple.to_yaml t.integer :messages_count, :default => 0 t.timestamps end add_index table_name, [:archived_for, :participants], :name => :participants_and_archived_index add_index table_name, [:having_chain_id, :having_chain_type], :name => :having_index add_index table_name, :created_at end def drop_chains drop_table table_name end def table_name Carrier.config.models.table_for(:chain) end end
Version data entries
14 entries across 7 versions & 1 rubygems