Sha256: e781c0007c4d12f15b86e8f5532283d38f3627d8e0cc0191795ab951c59684e0

Contents?: true

Size: 434 Bytes

Versions: 5

Compression:

Stored size: 434 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

5 entries across 5 versions & 1 rubygems

Version Path
drafting-0.5.1 lib/generators/drafting/migration/templates/migration.rb
drafting-0.5.0 lib/generators/drafting/migration/templates/migration.rb
drafting-0.4.2 lib/generators/drafting/migration/templates/migration.rb
drafting-0.4.1 lib/generators/drafting/migration/templates/migration.rb
drafting-0.4.0 lib/generators/drafting/migration/templates/migration.rb