From d363dc6298e8210fb3a5eddea8a6916a54005290 Mon Sep 17 00:00:00 2001 From: mo khan Date: Sat, 22 Feb 2014 13:03:45 -0700 Subject: switch from has_one to belongs_to relationship. --- db/migrate/20140222194718_add_location_id_to_licenses.rb | 6 ++++++ db/schema.rb | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20140222194718_add_location_id_to_licenses.rb (limited to 'db') diff --git a/db/migrate/20140222194718_add_location_id_to_licenses.rb b/db/migrate/20140222194718_add_location_id_to_licenses.rb new file mode 100644 index 0000000..067e7e4 --- /dev/null +++ b/db/migrate/20140222194718_add_location_id_to_licenses.rb @@ -0,0 +1,6 @@ +class AddLocationIdToLicenses < ActiveRecord::Migration + def change + add_column :licenses, :location_id, :uuid + remove_column :locations, :license_id + end +end diff --git a/db/schema.rb b/db/schema.rb index f102db8..b397f77 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: 20140222145409) do +ActiveRecord::Schema.define(version: 20140222194718) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -32,10 +32,10 @@ ActiveRecord::Schema.define(version: 20140222145409) do t.boolean "confidential", default: false t.integer "well_type_id" t.uuid "user_id" + t.uuid "location_id" end create_table "locations", id: :uuid, default: "uuid_generate_v4()", force: true do |t| - t.uuid "license_id" t.float "latitude" t.float "longitude" t.string "township" -- cgit v1.2.3