From 198521fe113fe1a205b90e8baf8fa4f22d74484f Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Thu, 17 Jun 2010 11:57:09 -0700 Subject: [PATCH] [#4177] Added a migration for the contracts table. --- db/migrate/001_create_contracts.rb | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 db/migrate/001_create_contracts.rb diff --git a/db/migrate/001_create_contracts.rb b/db/migrate/001_create_contracts.rb new file mode 100644 index 0000000..3099b9e --- /dev/null +++ b/db/migrate/001_create_contracts.rb @@ -0,0 +1,31 @@ +class CreateContracts < ActiveRecord::Migration + def self.up + create_table :contracts do |t| + t.string :name + t.integer :account_executive_id # User + t.references :project + t.date :start_date + t.date :end_date + t.boolean :executed + t.decimal :billable_rate, :precision => 15, :scale => 2 + t.string :discount + t.string :discount_type # $ or % + t.text :discount_note + t.string :payment_terms + t.text :client_ap_contact_information + t.string :po_number + t.text :details + t.timestamps + end + + add_index :contracts, :name + add_index :contracts, :account_executive_id + add_index :contracts, :project_id + add_index :contracts, :start_date + add_index :contracts, :end_date + end + + def self.down + drop_table :contracts + end +end