Class: CreateSequential

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/rails/generators/sequential/setup/templates/migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/rails/generators/sequential/setup/templates/migration.rb', line 2

def change
  create_table(:sequential) do |t|
    t.string  :model
    t.string  :column
    t.string  :scope
    t.string  :scope_value
    t.integer :value
    t.timestamps
  end

  add_index :sequential, [:model, :column, :scope, :scope_value], unique: true
end