From fef64edc1ee95b3dea637982a6f981bc19e0d30e Mon Sep 17 00:00:00 2001 From: jimi Date: Wed, 11 Mar 2009 16:07:52 -0500 Subject: [PATCH] Add elements to the employee model --- .../20090311181424_add_address_to_employee.rb | 17 +++++++++++++++++ ...20090311181736_add_truck_info_to_employee.rb | 17 +++++++++++++++++ db/schema.rb | 12 +++++++++++- 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20090311181424_add_address_to_employee.rb create mode 100644 db/migrate/20090311181736_add_truck_info_to_employee.rb diff --git a/db/migrate/20090311181424_add_address_to_employee.rb b/db/migrate/20090311181424_add_address_to_employee.rb new file mode 100644 index 0000000..afa9f4b --- /dev/null +++ b/db/migrate/20090311181424_add_address_to_employee.rb @@ -0,0 +1,17 @@ +class AddAddressToEmployee < ActiveRecord::Migration + def self.up + add_column :people, :street, :string + add_column :people, :city, :string + add_column :people, :state, :string + add_column :people, :zip, :string + add_column :people, :phone, :string + end + + def self.down + remove_column :people, :phone + remove_column :people, :zip + remove_column :people, :state + remove_column :people, :city + remove_column :people, :street + end +end diff --git a/db/migrate/20090311181736_add_truck_info_to_employee.rb b/db/migrate/20090311181736_add_truck_info_to_employee.rb new file mode 100644 index 0000000..e09030e --- /dev/null +++ b/db/migrate/20090311181736_add_truck_info_to_employee.rb @@ -0,0 +1,17 @@ +class AddTruckInfoToEmployee < ActiveRecord::Migration + def self.up + add_column :people, :dl_number, :string + add_column :people, :dl_state, :string + add_column :people, :dl_expire, :date + add_column :people, :truck, :string + add_column :people, :trailer, :string + end + + def self.down + remove_column :people, :trailer + remove_column :people, :truck + remove_column :people, :dl_expire + remove_column :people, :dl_state + remove_column :people, :dl_number + end +end diff --git a/db/schema.rb b/db/schema.rb index 93062c2..11b4232 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20090311052854) do +ActiveRecord::Schema.define(:version => 20090311181736) do create_table "loads", :force => true do |t| t.string "number" @@ -34,6 +34,16 @@ ActiveRecord::Schema.define(:version => 20090311052854) do t.string "tax_status" t.integer "dependents", :default => 0 t.decimal "payrate", :precision => 4, :scale => 2, :default => 0.25 + t.string "street" + t.string "city" + t.string "state" + t.string "zip" + t.string "phone" + t.string "dl_number" + t.string "dl_state" + t.date "dl_expire" + t.string "truck" + t.string "trailer" end end