1 class RebuildMerchandisesTable < ActiveRecord::Migration
3 # This whole thing is an awful way of doing a column rename
6 drop_table :merchandises
8 create_table :merchandises do |t|
9 t.column :title, :string, :null => false
10 t.column :quantity, :integer, :null => false, :default => 0
11 t.column :price, :decimal, :precision => 8, :scale =>2, :default => 0
16 drop_table :merchandises
18 create_table :merchandises do |t|
19 t.column :name, :string, :null => false
20 t.column :quantity, :integer, :null => false, :default => 0
21 t.column :price, :decimal, :precision => 8, :scale =>2, :default => 0