Class: CreateWeelerLocks

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/weeler/templates/migrations/create_weeler_locks.rb

Class Method Summary collapse

Class Method Details

.downObject



10
11
12
13
# File 'lib/generators/weeler/templates/migrations/create_weeler_locks.rb', line 10

def self.down
  remove_index :weeler_locks, :column => :name
  drop_table :weeler_locks
end

.upObject



2
3
4
5
6
7
8
# File 'lib/generators/weeler/templates/migrations/create_weeler_locks.rb', line 2

def self.up
  create_table :weeler_locks do |t|
    t.string :name, :limit => 40
    t.timestamps
  end
  add_index :weeler_locks, :name, :unique => true
end