Added basic rate model and it's database schema
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
class Rate < ActiveRecord::Base
|
||||
end
|
||||
@@ -0,0 +1,14 @@
|
||||
class CreateRates < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :rates do |t|
|
||||
t.column :amount, :decimal, :precision => 15, :scale => 2
|
||||
t.column :user_id, :integer
|
||||
t.column :project_id, :integer
|
||||
t.column :date_in_effect, :date
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :rates
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
class AddIndexesToRates < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_index :rates, :user_id
|
||||
add_index :rates, :project_id
|
||||
add_index :rates, :date_in_effect
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_index :rates, :user_id
|
||||
remove_index :rates, :project_id
|
||||
remove_index :rates, :date_in_effect
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
require File.dirname(__FILE__) + '/../spec_helper'
|
||||
|
||||
Reference in New Issue
Block a user