Louis | Allows users to associate clients with agencies

This commit is contained in:
Loos
2014-09-22 19:44:03 -04:00
parent 7ed3fce648
commit 2a33493ff2
8 changed files with 23 additions and 10 deletions
@@ -0,0 +1,5 @@
class AddAgencyToClient < ActiveRecord::Migration
def change
add_reference :clients, :agency, index: true
end
end
@@ -0,0 +1,5 @@
class RemoveAgencyStringFromClient < ActiveRecord::Migration
def change
remove_column :clients, :agency
end
end
+3 -2
View File
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20140921225115) do
ActiveRecord::Schema.define(version: 20140922233036) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -60,15 +60,16 @@ ActiveRecord::Schema.define(version: 20140921225115) do
t.integer "weight"
t.boolean "helmet"
t.boolean "lock"
t.string "agency"
t.date "completion_date"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "bike_id"
t.string "bike_type_requested"
t.boolean "will_pay"
t.integer "agency_id"
end
add_index "clients", ["agency_id"], name: "index_clients_on_agency_id", using: :btree
add_index "clients", ["bike_id"], name: "index_clients_on_bike_id", using: :btree
create_table "users", force: true do |t|