Sha256: f357c3a91edeb7702ae6548db318be519395405f2bc4f8c6af2dd7afb2413c34

Contents?: true

Size: 452 Bytes

Versions: 1

Compression:

Stored size: 452 Bytes

Contents

class DraftingMigration < Drafting::MIGRATION_BASE_CLASS
  def self.up
    create_table :drafts do |t|
      t.string :target_type, :null => false
      t.references :user
      t.references :parent, :polymorphic => true, :index => true
      t.binary :data, :limit => 16777215, :null => false
      t.datetime :updated_at, :null => false
    end

    add_index :drafts, [:user_id, :target_type]
  end

  def self.down
    drop_table :drafts
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
drafting-0.3.1 lib/generators/drafting/migration/templates/migration.rb