Class: CreateStoreCredits

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/templates/db/migrate/20100928140217_create_store_credits.rb

Class Method Summary collapse

Class Method Details

.downObject



12
13
14
# File 'lib/generators/templates/db/migrate/20100928140217_create_store_credits.rb', line 12

def self.down
  drop_table :store_credits
end

.upObject



2
3
4
5
6
7
8
9
10
# File 'lib/generators/templates/db/migrate/20100928140217_create_store_credits.rb', line 2

def self.up
  create_table :store_credits do |t|
    t.references :user
    t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false
    t.decimal :remaining_amount, :precision => 8, :scale => 2, :default => 0.0, :null => false
    t.string :reason
    t.timestamps
  end
end