From f6a51e8a33636c1605e76caf8a5bab39e08b1020 Mon Sep 17 00:00:00 2001 From: Louis Knapp Date: Sat, 30 Jul 2016 21:10:26 -0500 Subject: [PATCH] lk | removes unused client tables and makes date sold a datetime to be consistent --- .../20160731020409_remove_unused_columns_from_clients.rb | 7 +++++++ ...31020658_change_bike_date_sold_column_to_date_time.rb | 9 +++++++++ db/schema.rb | 7 ++----- notes.md | 4 ---- 4 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 db/migrate/20160731020409_remove_unused_columns_from_clients.rb create mode 100644 db/migrate/20160731020658_change_bike_date_sold_column_to_date_time.rb diff --git a/db/migrate/20160731020409_remove_unused_columns_from_clients.rb b/db/migrate/20160731020409_remove_unused_columns_from_clients.rb new file mode 100644 index 0000000..b6cc9f9 --- /dev/null +++ b/db/migrate/20160731020409_remove_unused_columns_from_clients.rb @@ -0,0 +1,7 @@ +class RemoveUnusedColumnsFromClients < ActiveRecord::Migration + def change + remove_column :clients, :number_of_calls + remove_column :clients, :application_date_bkp + remove_column :clients, :pickup_date_bkp + end +end diff --git a/db/migrate/20160731020658_change_bike_date_sold_column_to_date_time.rb b/db/migrate/20160731020658_change_bike_date_sold_column_to_date_time.rb new file mode 100644 index 0000000..889330a --- /dev/null +++ b/db/migrate/20160731020658_change_bike_date_sold_column_to_date_time.rb @@ -0,0 +1,9 @@ +class ChangeBikeDateSoldColumnToDateTime < ActiveRecord::Migration + def up + change_column :bikes, :date_sold, :datetime + end + + def down + change_column :bikes, :date_sold, :date + end +end diff --git a/db/schema.rb b/db/schema.rb index ba35ca1..f7dffc6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160731014517) do +ActiveRecord::Schema.define(version: 20160731020658) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -43,7 +43,7 @@ ActiveRecord::Schema.define(version: 20160731014517) do t.integer "log_number" t.text "purpose" t.text "mechanic" - t.date "date_sold" + t.datetime "date_sold" t.integer "bike_index_id" t.datetime "fixed_at" end @@ -51,7 +51,6 @@ ActiveRecord::Schema.define(version: 20160731014517) do create_table "clients", force: :cascade do |t| t.string "first_name" t.string "last_name" - t.date "application_date_bkp" t.string "gender" t.integer "age" t.boolean "helmet" @@ -64,9 +63,7 @@ ActiveRecord::Schema.define(version: 20160731014517) do t.integer "agency_id" t.text "notes" t.boolean "bike_fixed" - t.integer "number_of_calls" t.boolean "application_voided" - t.date "pickup_date_bkp" t.string "volunteer_at_pickup" t.float "weight" t.float "height" diff --git a/notes.md b/notes.md index 16f576e..cfcd6c6 100644 --- a/notes.md +++ b/notes.md @@ -13,10 +13,6 @@ - convert to bootstrap-less - integrate with autocomplete to get manufacturers & models - enable posting to bike index when a bike is created -- remove clients#number_of_calls -- remove clients#application_date_bkp -- remove clients#pickup_Date_bkp -- bike date_sold column should be datetime - add tests to ensure that pages render # Bugs