g5_updatable 0.10.3 → 0.20.3.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +33 -2
- data/app/concerns/g5_updatable/belongs_to_client.rb +3 -3
- data/app/controllers/g5_updatable/feed_controller.rb +1 -1
- data/app/controllers/g5_updatable/locations_controller.rb +2 -2
- data/app/controllers/g5_updatable/syncs_controller.rb +3 -3
- data/app/models/g5_updatable/client.rb +4 -4
- data/app/models/g5_updatable/hub_amenities_location.rb +6 -0
- data/app/models/g5_updatable/hub_amenity.rb +21 -0
- data/app/models/g5_updatable/location.rb +75 -2
- data/app/serializers/g5_updatable/location_serializer.rb +8 -0
- data/db/migrate/20151103043916_add_latitude_and_longitude_to_location.rb +6 -0
- data/db/migrate/20151103050229_copy_lat_long_props_to_lat_long_columns.rb +19 -0
- data/db/migrate/20151106070749_add_latitude_longitude_indexes_to_location.rb +6 -0
- data/db/migrate/20161122070749_add_amenities.rb +25 -0
- data/db/migrate/20161209070749_add_client_urn_to_locations.rb +6 -0
- data/lib/g5_updatable.rb +5 -3
- data/lib/g5_updatable/all_client_urns_fetcher.rb +17 -0
- data/lib/g5_updatable/client_feed_processor.rb +26 -14
- data/lib/g5_updatable/client_updater.rb +37 -12
- data/lib/g5_updatable/factories.rb +2 -2
- data/lib/g5_updatable/fetcher.rb +22 -0
- data/lib/g5_updatable/indifferentizer.rb +11 -0
- data/lib/g5_updatable/locations_updater.rb +68 -20
- data/lib/g5_updatable/rspec/factories.rb +53 -2
- data/lib/g5_updatable/version.rb +1 -1
- data/lib/tasks/g5_updatable_tasks.rake +11 -4
- data/spec/concerns/g5_updatable/belongs_to_client_spec.rb +1 -3
- data/spec/controllers/feed_controller_spec.rb +21 -0
- data/spec/controllers/syncs_controller_spec.rb +3 -3
- data/spec/dummy/config/database.yml +2 -2
- data/spec/dummy/db/schema.rb +28 -1
- data/spec/dummy/log/development.log +172 -146
- data/spec/dummy/log/test.log +101011 -13426
- data/spec/dummy/log/tests.log +0 -0
- data/spec/fixtures/client-g5-c-1soj8m6e-g5-multifamily-missing-locations.json +121 -0
- data/spec/fixtures/client-g5-c-1soj8m6e-g5-multifamily-no-locations.json +41 -0
- data/spec/fixtures/client-g5-c-1soj8m6e-g5-multifamily.json +471 -0
- data/spec/fixtures/hub-client.json +187 -0
- data/spec/fixtures/hub-clients.json +19972 -0
- data/spec/fixtures/hub-location.json +166 -0
- data/spec/fixtures/location-g5-cl-1soj9pe2-541-apartments.json +98 -0
- data/spec/fixtures/urns.json +10 -0
- data/spec/lib/g5_updatable/all_client_urns_fetcher_spec.rb +56 -0
- data/spec/lib/g5_updatable/client_feed_processor_spec.rb +86 -33
- data/spec/lib/g5_updatable/client_updater_spec.rb +55 -23
- data/spec/lib/g5_updatable/locations_updater_spec.rb +140 -54
- data/spec/models/g5_updatable/client_spec.rb +2 -0
- data/spec/models/g5_updatable/hub_amenities_location_spec.rb +6 -0
- data/spec/models/g5_updatable/hub_amenity_spec.rb +29 -0
- data/spec/models/g5_updatable/location_spec.rb +240 -10
- data/spec/serializers/g5_updatable/location_serializer_spec.rb +2 -1
- data/spec/spec_helper.rb +2 -1
- data/spec/support/fixture_helper.rb +5 -0
- data/spec/support/shared_examples/belongs_to_client.rb +4 -5
- metadata +84 -17
@@ -1,19 +1,44 @@
|
|
1
1
|
class G5Updatable::ClientUpdater
|
2
|
-
|
3
|
-
|
2
|
+
include ::G5Updatable::Indifferentizer
|
3
|
+
cattr_writer :on_create_callbacks
|
4
|
+
|
5
|
+
def initialize(client_hash)
|
6
|
+
@client_hash = indifferentize_hash(client_hash.dup)
|
7
|
+
@location_hashes = @client_hash.delete(:locations)
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.on_create(&block)
|
11
|
+
self.on_create_callbacks ||= []
|
12
|
+
self.on_create_callbacks += [block]
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.on_create_callbacks
|
16
|
+
@@on_create_callbacks || []
|
4
17
|
end
|
5
18
|
|
6
19
|
def update
|
7
|
-
|
8
|
-
|
20
|
+
is_new_client = client.new_record?
|
21
|
+
update_client
|
22
|
+
self.class.on_create_callbacks.each { |cb| cb.call(client) } if is_new_client
|
23
|
+
update_locations
|
24
|
+
end
|
25
|
+
|
26
|
+
def update_client
|
27
|
+
client.update_attributes!(
|
28
|
+
uid: @client_hash[:uid],
|
29
|
+
name: @client_hash[:name],
|
30
|
+
properties: @client_hash,
|
31
|
+
updated_at: Time.now
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
def client
|
36
|
+
@client ||= G5Updatable::Client.find_or_initialize_by(urn: @client_hash[:urn])
|
37
|
+
end
|
9
38
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
name: attributes[:name],
|
15
|
-
properties: attributes,
|
16
|
-
updated_at: DateTime.now
|
17
|
-
)
|
39
|
+
def update_locations
|
40
|
+
G5Updatable::LocationsUpdater.new(@location_hashes,
|
41
|
+
client_urn: @client_hash[:urn],
|
42
|
+
destroy_orphaned_locations: true).update
|
18
43
|
end
|
19
44
|
end
|
@@ -10,7 +10,7 @@ FactoryGirl.define do
|
|
10
10
|
sequence(:urn) { |n| "location_urn_#{n}" }
|
11
11
|
uid { "#{client.urn}/locations/#{urn}" }
|
12
12
|
|
13
|
-
sequence(:phone_number) {|n| "123-321-#{n}" }
|
13
|
+
sequence(:phone_number) { |n| "123-321-#{n}" }
|
14
14
|
corporate false
|
15
15
|
status "Pending"
|
16
16
|
street_address_1 "123 Test Way"
|
@@ -172,7 +172,7 @@ FactoryGirl.define do
|
|
172
172
|
G5Updatable::Location.column_names.include?(key.to_s)
|
173
173
|
attrs[key] = value
|
174
174
|
else
|
175
|
-
attrs[:properties]
|
175
|
+
attrs[:properties] ||= {}
|
176
176
|
attrs[:properties][key] = value
|
177
177
|
end
|
178
178
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module G5Updatable
|
2
|
+
class Fetcher
|
3
|
+
extend ::G5AuthenticationClient::AuthTokenHelper
|
4
|
+
|
5
|
+
def self.get_with_token(url)
|
6
|
+
response = do_with_username_pw_access_token do |access_token|
|
7
|
+
::HTTParty.get(url, { query: { access_token: access_token },
|
8
|
+
headers: { 'Content-Type' => 'application/json',
|
9
|
+
'Accept' => 'application/json' } })
|
10
|
+
end
|
11
|
+
|
12
|
+
case response.code.to_i
|
13
|
+
when 200
|
14
|
+
JSON.parse(response.body)
|
15
|
+
when 404
|
16
|
+
raise "Couldn't find record at URL '#{url}'"
|
17
|
+
else
|
18
|
+
raise "I got an unexpected response code '#{response.code}'"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,10 +1,20 @@
|
|
1
1
|
class G5Updatable::LocationsUpdater
|
2
|
+
include ::G5Updatable::Indifferentizer
|
3
|
+
cattr_writer :on_update_callbacks, :on_create_callbacks
|
2
4
|
|
3
|
-
|
5
|
+
def initialize(locations_hash, options={})
|
6
|
+
@location_hashes = indifferentize_location_hashes(locations_hash)
|
7
|
+
@client_urn = options[:client_urn] || @location_hashes.first.try(:[], :client_urn)
|
8
|
+
@destroy_orphaned_locations = options.fetch(:destroy_orphaned_locations, false)
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.on_create(&block)
|
12
|
+
self.on_create_callbacks ||= []
|
13
|
+
self.on_create_callbacks += [block]
|
14
|
+
end
|
4
15
|
|
5
|
-
def
|
6
|
-
|
7
|
-
@g5_locations = foundation_client.locations
|
16
|
+
def self.on_create_callbacks
|
17
|
+
@@on_create_callbacks || []
|
8
18
|
end
|
9
19
|
|
10
20
|
def self.on_update(&block)
|
@@ -17,31 +27,69 @@ class G5Updatable::LocationsUpdater
|
|
17
27
|
end
|
18
28
|
|
19
29
|
def update
|
20
|
-
@
|
21
|
-
|
22
|
-
|
23
|
-
|
30
|
+
@location_hashes.each do |g5_location|
|
31
|
+
create_or_update_location(g5_location)
|
32
|
+
end
|
33
|
+
destroy_orphaned_locations! if @destroy_orphaned_locations
|
34
|
+
end
|
35
|
+
|
36
|
+
def create_or_update_location(g5_location)
|
37
|
+
attributes = g5_location.dup
|
38
|
+
location = G5Updatable::Location.find_or_initialize_by(urn: attributes[:urn])
|
39
|
+
before_update_object = location.dup
|
40
|
+
is_new_loc = location.new_record?
|
24
41
|
|
25
|
-
|
26
|
-
|
42
|
+
amenities = attributes.delete(:amenities)
|
43
|
+
location.update_attributes!(
|
44
|
+
uid: attributes[:uid],
|
27
45
|
name: attributes[:name],
|
28
46
|
client_uid: attributes[:client_uid],
|
47
|
+
latitude: attributes[:latitude],
|
48
|
+
longitude: attributes[:longitude],
|
29
49
|
properties: attributes,
|
30
|
-
updated_at:
|
31
|
-
|
32
|
-
|
50
|
+
updated_at: Time.now
|
51
|
+
)
|
52
|
+
create_amenities(amenities, location)
|
53
|
+
self.class.on_create_callbacks.each { |cb| cb.call(location) } if is_new_loc
|
54
|
+
self.class.on_update_callbacks.each { |cb| cb.call(location, before_update_object) }
|
55
|
+
end
|
56
|
+
|
57
|
+
def create_amenities(amenities_hashes, location)
|
58
|
+
location.hub_amenities_locations.delete_all
|
59
|
+
|
60
|
+
amenities_hashes.each do |amenity_hash|
|
61
|
+
location.hub_amenities << create_or_update_amenity(amenity_hash)
|
62
|
+
end
|
63
|
+
location.refresh_flat_amenity_names!
|
64
|
+
end
|
65
|
+
|
66
|
+
def create_or_update_amenity(amenity_hash)
|
67
|
+
amenity = G5Updatable::HubAmenity.where(external_id: amenity_hash[:id]).first_or_create
|
68
|
+
if amenity.name != amenity_hash[:name] || amenity.icon != amenity_hash[:icon]
|
69
|
+
amenity.update_attributes(name: amenity_hash[:name],
|
70
|
+
icon: amenity_hash[:icon],
|
71
|
+
external_updated_at: amenity_hash[:updated_at],
|
72
|
+
external_created_at: amenity_hash[:created_at])
|
33
73
|
end
|
34
|
-
|
74
|
+
amenity
|
35
75
|
end
|
36
76
|
|
37
77
|
private
|
38
78
|
|
79
|
+
def indifferentize_location_hashes(hashes)
|
80
|
+
[hashes].flatten.compact.collect do |loc_hash|
|
81
|
+
indif = indifferentize_hash(loc_hash)
|
82
|
+
indif[:amenities] = indifferentize_array(indif[:amenities]) if indif[:amenities].present?
|
83
|
+
indif
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
39
87
|
def destroy_orphaned_locations!
|
40
|
-
if @
|
41
|
-
G5Updatable::Location.
|
42
|
-
else
|
43
|
-
|
44
|
-
|
88
|
+
if @location_hashes.empty?
|
89
|
+
G5Updatable::Location.by_client_urn(@client_urn)
|
90
|
+
else
|
91
|
+
valid_location_urns = @location_hashes.collect { |lh| lh[:urn] }
|
92
|
+
G5Updatable::Location.where.not(urn: valid_location_urns).by_client_urn(@client_urn)
|
45
93
|
end.destroy_all
|
46
|
-
end
|
94
|
+
end
|
47
95
|
end
|
@@ -4,13 +4,64 @@ FactoryGirl.define do
|
|
4
4
|
urn "g5-cl-1234-location"
|
5
5
|
client_uid "http://example.com/clients/g5-c-1234-client"
|
6
6
|
name 'test location'
|
7
|
-
properties { {
|
7
|
+
properties { {domain: "http://myloc.com"} }
|
8
8
|
end
|
9
9
|
|
10
10
|
factory :client, class: G5Updatable::Client do
|
11
11
|
uid "http://example.com/clients/g5-c-1234-client"
|
12
12
|
urn "g5-c-1234-client"
|
13
13
|
name 'test client'
|
14
|
-
properties { {
|
14
|
+
properties { {city: "Test Client"} }
|
15
|
+
end
|
16
|
+
|
17
|
+
factory :incrementing_location, parent: :location do
|
18
|
+
association :client, factory: :incrementing_client
|
19
|
+
sequence(:urn) { |n| "g5-cl-#{n}-location" }
|
20
|
+
uid { "http://example.com/clients/#{client.urn}/locations/#{urn}" }
|
21
|
+
client_uid { client.uid }
|
22
|
+
end
|
23
|
+
|
24
|
+
factory :incrementing_client, parent: :client do
|
25
|
+
sequence(:urn) { |n| "g5-c-#{n}-client" }
|
26
|
+
uid { "http://example.com/clients/#{urn}" }
|
27
|
+
end
|
28
|
+
|
29
|
+
factory :g5mf_client, parent: :client do
|
30
|
+
uid 'https://g5-hub.herokuapp.com/clients/g5-c-1soj8z7v-g5-mf'
|
31
|
+
urn 'g5-c-1soj8z7v-g5-mf'
|
32
|
+
end
|
33
|
+
|
34
|
+
factory :g5mf_location, parent: :location do
|
35
|
+
uid 'https://g5-hub.herokuapp.com/clients/g5-c-1soj8z7v-g5-selfstorage/locations/g5-cl-loc'
|
36
|
+
urn 'g5-cl-loc'
|
37
|
+
properties { {status: 'Live'} }
|
38
|
+
client { G5Updatable::Client.find_by_urn('g5-c-1soj8z7v-g5-mf') || create(:g5mf_client) }
|
39
|
+
name { 'g5 multi family' }
|
40
|
+
trait :all_properties do
|
41
|
+
latitude { 20.915166 }
|
42
|
+
longitude { -156.379291 }
|
43
|
+
properties { {street_address_1: '71 Baldwin Ave',
|
44
|
+
city: 'paia',
|
45
|
+
state: 'HI',
|
46
|
+
state_name: 'Hawaii',
|
47
|
+
postal_code: '96779',
|
48
|
+
country: 'US',
|
49
|
+
phone_number: '8884443332',
|
50
|
+
email: 'email@example.com',
|
51
|
+
home_page_url: 'homey.com',
|
52
|
+
internal_branded_name: 'zss1',
|
53
|
+
status: 'Live',
|
54
|
+
corporate: 'false',
|
55
|
+
neighborhood: 'Red Light',
|
56
|
+
neighborhood_2: 'Green Light',
|
57
|
+
domain: 'adomain'} }
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
factory :hub_amenity, class: G5Updatable::HubAmenity do
|
63
|
+
sequence(:name) { |n| "amenity-#{n}" }
|
64
|
+
sequence(:external_id) { |n| n }
|
65
|
+
icon 'icon'
|
15
66
|
end
|
16
67
|
end
|
data/lib/g5_updatable/version.rb
CHANGED
@@ -1,12 +1,19 @@
|
|
1
1
|
namespace :g5_updatable do
|
2
|
-
DEFAULT_G5_HUB_CLIENTS_URL = 'https://g5-hub.herokuapp.com/clients.json'
|
3
2
|
|
4
3
|
desc 'loads all of g5-hub into local DB. Note: the ENV variables for G5-Auth need to be set!'
|
4
|
+
|
5
5
|
task load_all: :environment do
|
6
|
-
|
7
|
-
|
6
|
+
puts "loading urns from #{G5Updatable::AllClientUrnsFetcher::url}...."
|
7
|
+
|
8
|
+
G5Updatable::ClientFeedProcessor.load_all_clients
|
8
9
|
|
9
|
-
G5Updatable::ClientFeedProcessor.load_all_clients(clients_url)
|
10
10
|
puts 'Success!!'
|
11
11
|
end
|
12
|
+
|
13
|
+
desc 'convert locations belongs_to :client to client_urn FK'
|
14
|
+
task location_client_urn_conversion: :environment do
|
15
|
+
G5Updatable::Location.find_each do |location|
|
16
|
+
location.save #location has a before_validation #set_client_urn
|
17
|
+
end
|
18
|
+
end
|
12
19
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe G5Updatable::FeedController, type: :controller do
|
4
|
+
routes { G5Updatable::Engine.routes }
|
5
|
+
|
6
|
+
context "#update" do
|
7
|
+
let(:params) { {foo: "bar"} }
|
8
|
+
let(:processor) { double(:processor) }
|
9
|
+
|
10
|
+
subject do
|
11
|
+
post :update, params
|
12
|
+
end
|
13
|
+
|
14
|
+
before do
|
15
|
+
expect(G5Updatable::ClientFeedProcessor).to receive(:new).with(hash_including(params)).and_return processor
|
16
|
+
expect(processor).to receive :work
|
17
|
+
end
|
18
|
+
|
19
|
+
it { should be_successful }
|
20
|
+
end
|
21
|
+
end
|
@@ -6,8 +6,8 @@ describe G5Updatable::SyncsController, type: :controller do
|
|
6
6
|
describe 'GET index' do
|
7
7
|
let(:client){ create(:client) }
|
8
8
|
let!(:location) { create(:location, client: client) }
|
9
|
-
let!(:location2) { create(:location, client: client) }
|
10
|
-
let!(:location3) { create(:location, client:
|
9
|
+
let!(:location2) { create(:location, client: client, urn: 'dif-urn', uid: 'http://hub.com/clients/dd/locations/dif-urn') }
|
10
|
+
let!(:location3) { create(:location, client: client, urn: 'dif-urn2', uid: 'http://hub.com/clients/dd/locations/dif-urn2') }
|
11
11
|
let(:expected_result) { location2.updated_at.in_time_zone.strftime("%I:%M%P on %B %e, %Y") }
|
12
12
|
let(:params) { {urn: client.urn } }
|
13
13
|
|
@@ -16,7 +16,7 @@ describe G5Updatable::SyncsController, type: :controller do
|
|
16
16
|
JSON.parse response.body
|
17
17
|
end
|
18
18
|
|
19
|
-
its(['updated_at']){
|
19
|
+
its(['updated_at']){ is_expected.to eq(expected_result) }
|
20
20
|
|
21
21
|
describe "no client" do
|
22
22
|
let(:params) { {urn: "xxx" } }
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20161209070749) do
|
15
15
|
|
16
16
|
# These are extensions that must be enabled in order to support this database
|
17
17
|
enable_extension "plpgsql"
|
@@ -36,6 +36,26 @@ ActiveRecord::Schema.define(version: 20141222072623) do
|
|
36
36
|
add_index "g5_updatable_clients", ["uid"], name: "index_g5_updatable_clients_on_uid", using: :btree
|
37
37
|
add_index "g5_updatable_clients", ["urn"], name: "index_g5_updatable_clients_on_urn", using: :btree
|
38
38
|
|
39
|
+
create_table "g5_updatable_hub_amenities", force: :cascade do |t|
|
40
|
+
t.integer "external_id"
|
41
|
+
t.string "name"
|
42
|
+
t.string "icon"
|
43
|
+
t.datetime "external_updated_at"
|
44
|
+
t.datetime "external_created_at"
|
45
|
+
t.datetime "created_at"
|
46
|
+
t.datetime "updated_at"
|
47
|
+
end
|
48
|
+
|
49
|
+
add_index "g5_updatable_hub_amenities", ["external_id"], name: "index_g5_updatable_hub_amenities_on_external_id", unique: true, using: :btree
|
50
|
+
|
51
|
+
create_table "g5_updatable_hub_amenities_locations", force: :cascade do |t|
|
52
|
+
t.integer "g5_updatable_hub_amenity_id"
|
53
|
+
t.integer "g5_updatable_location_id"
|
54
|
+
end
|
55
|
+
|
56
|
+
add_index "g5_updatable_hub_amenities_locations", ["g5_updatable_hub_amenity_id"], name: "updatable_amenities_loc_amen_id", using: :btree
|
57
|
+
add_index "g5_updatable_hub_amenities_locations", ["g5_updatable_location_id"], name: "updatable_amenities_loc_loc_id", using: :btree
|
58
|
+
|
39
59
|
create_table "g5_updatable_locations", force: :cascade do |t|
|
40
60
|
t.string "uid"
|
41
61
|
t.string "urn"
|
@@ -44,8 +64,15 @@ ActiveRecord::Schema.define(version: 20141222072623) do
|
|
44
64
|
t.datetime "created_at"
|
45
65
|
t.datetime "updated_at"
|
46
66
|
t.string "name"
|
67
|
+
t.float "latitude"
|
68
|
+
t.float "longitude"
|
69
|
+
t.string "flat_amenity_names"
|
70
|
+
t.string "client_urn"
|
47
71
|
end
|
48
72
|
|
73
|
+
add_index "g5_updatable_locations", ["client_urn"], name: "index_g5_updatable_locations_on_client_urn", using: :btree
|
74
|
+
add_index "g5_updatable_locations", ["latitude"], name: "index_g5_updatable_locations_on_latitude", using: :btree
|
75
|
+
add_index "g5_updatable_locations", ["longitude"], name: "index_g5_updatable_locations_on_longitude", using: :btree
|
49
76
|
add_index "g5_updatable_locations", ["name"], name: "index_g5_updatable_locations_on_name", using: :btree
|
50
77
|
add_index "g5_updatable_locations", ["uid"], name: "index_g5_updatable_locations_on_uid", using: :btree
|
51
78
|
add_index "g5_updatable_locations", ["urn"], name: "index_g5_updatable_locations_on_urn", using: :btree
|
@@ -1,147 +1,6 @@
|
|
1
|
-
[1m[
|
2
|
-
[1m[35m (12.9ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
3
|
-
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4
|
-
Migrating to CreateLocations (20140630175259)
|
5
|
-
[1m[35m (0.1ms)[0m BEGIN
|
6
|
-
[1m[36m (14.8ms)[0m [1mCREATE TABLE "locations" ("id" serial primary key, "uid" character varying(255), "name" character varying(255), "corporate" boolean, "urn" character varying(255), "state" character varying(255), "city" character varying(255), "street_address" character varying(255), "postal_code" character varying(255), "domain" character varying(255), "city_slug" character varying(255), "phone_number" character varying(255), "neighborhood" character varying(255), "primary_amenity" character varying(255), "primary_landmark" character varying(255), "qualifier" character varying(255), "floor_plans" character varying(255), "created_at" timestamp, "updated_at" timestamp) [0m
|
7
|
-
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140630175259"]]
|
8
|
-
[1m[36m (6.3ms)[0m [1mCOMMIT[0m
|
9
|
-
Migrating to CreateClients (20140630175330)
|
10
|
-
[1m[35m (5.6ms)[0m BEGIN
|
11
|
-
[1m[36m (12.3ms)[0m [1mCREATE TABLE "clients" ("id" serial primary key, "uid" character varying(255), "name" character varying(255), "vertical" character varying(255), "type" character varying(255), "domain" character varying(255), "created_at" timestamp, "updated_at" timestamp) [0m
|
12
|
-
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140630175330"]]
|
13
|
-
[1m[36m (0.3ms)[0m [1mCOMMIT[0m
|
14
|
-
Migrating to DropClientsAndLocations (20140709220627)
|
15
|
-
[1m[35m (0.1ms)[0m BEGIN
|
16
|
-
[1m[36m (0.6ms)[0m [1mDROP TABLE "clients"[0m
|
17
|
-
[1m[35m (0.4ms)[0m DROP TABLE "locations"
|
18
|
-
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20140709220627"]]
|
19
|
-
[1m[35m (1.0ms)[0m COMMIT
|
20
|
-
Migrating to CreateG5UpdatableClientsAndLocations (20140709222005)
|
21
|
-
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
22
|
-
[1m[35m (1.7ms)[0m CREATE TABLE "g5_updatable_clients" ("id" serial primary key, "uid" character varying(255), "urn" character varying(255), "properties" json, "created_at" timestamp, "updated_at" timestamp)
|
23
|
-
[1m[36m (0.4ms)[0m [1mCREATE INDEX "index_g5_updatable_clients_on_uid" ON "g5_updatable_clients" ("uid")[0m
|
24
|
-
[1m[35m (0.5ms)[0m CREATE INDEX "index_g5_updatable_clients_on_urn" ON "g5_updatable_clients" ("urn")
|
25
|
-
[1m[36m (1.8ms)[0m [1mCREATE TABLE "g5_updatable_locations" ("id" serial primary key, "uid" character varying(255), "urn" character varying(255), "client_uid" character varying(255), "properties" json, "created_at" timestamp, "updated_at" timestamp) [0m
|
26
|
-
[1m[35m (0.4ms)[0m CREATE INDEX "index_g5_updatable_locations_on_uid" ON "g5_updatable_locations" ("uid")
|
27
|
-
[1m[36m (0.4ms)[0m [1mCREATE INDEX "index_g5_updatable_locations_on_urn" ON "g5_updatable_locations" ("urn")[0m
|
28
|
-
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140709222005"]]
|
29
|
-
[1m[36m (0.3ms)[0m [1mCOMMIT[0m
|
30
|
-
Migrating to CreateFavoriteFoods (20140714225203)
|
31
|
-
[1m[35m (0.3ms)[0m BEGIN
|
32
|
-
[1m[36m (2.0ms)[0m [1mCREATE TABLE "favorite_foods" ("id" serial primary key, "name" character varying(255), "location_uid" character varying(255), "created_at" timestamp, "updated_at" timestamp) [0m
|
33
|
-
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140714225203"]]
|
34
|
-
[1m[36m (0.2ms)[0m [1mCOMMIT[0m
|
35
|
-
Migrating to CreateIntegrationSetting (20141030211945)
|
36
|
-
[1m[35m (0.2ms)[0m BEGIN
|
37
|
-
[1m[36m (2.7ms)[0m [1mCREATE TABLE "g5_updatable_integration_settings" ("id" serial primary key, "uid" character varying(255), "urn" character varying(255), "location_uid" character varying(255), "vendor_action" character varying(255), "job_frequency_in_minutes" integer, "properties" json, "created_at" timestamp, "updated_at" timestamp) [0m
|
38
|
-
[1m[35m (0.8ms)[0m CREATE INDEX "index_g5_updatable_integration_settings_on_urn" ON "g5_updatable_integration_settings" ("urn")
|
39
|
-
[1m[36m (0.9ms)[0m [1mCREATE INDEX "index_g5_updatable_integration_settings_on_uid" ON "g5_updatable_integration_settings" ("uid")[0m
|
40
|
-
[1m[35m (0.8ms)[0m CREATE INDEX "index_g5_updatable_integration_settings_on_vendor_action" ON "g5_updatable_integration_settings" ("vendor_action")
|
41
|
-
[1m[36m (0.6ms)[0m [1mCREATE INDEX "g5_u_is_loc_action" ON "g5_updatable_integration_settings" ("location_uid", "vendor_action")[0m
|
42
|
-
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141030211945"]]
|
43
|
-
[1m[36m (0.2ms)[0m [1mCOMMIT[0m
|
44
|
-
Migrating to RemoveIntegrationSetting (20141122211945)
|
45
|
-
[1m[35m (0.1ms)[0m BEGIN
|
46
|
-
[1m[36m (0.6ms)[0m [1mDROP TABLE "g5_updatable_integration_settings"[0m
|
47
|
-
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141122211945"]]
|
48
|
-
[1m[36m (0.8ms)[0m [1mCOMMIT[0m
|
49
|
-
Migrating to AddNameToClientsAndLocations (20141211211945)
|
50
|
-
[1m[35m (0.1ms)[0m BEGIN
|
51
|
-
[1m[36m (0.3ms)[0m [1mALTER TABLE "g5_updatable_clients" ADD COLUMN "name" character varying(255)[0m
|
52
|
-
[1m[35m (0.8ms)[0m CREATE INDEX "index_g5_updatable_clients_on_name" ON "g5_updatable_clients" ("name")
|
53
|
-
[1m[36m (0.2ms)[0m [1mALTER TABLE "g5_updatable_locations" ADD COLUMN "name" character varying(255)[0m
|
54
|
-
[1m[35m (0.8ms)[0m CREATE INDEX "index_g5_updatable_locations_on_name" ON "g5_updatable_locations" ("name")
|
55
|
-
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20141211211945"]]
|
56
|
-
[1m[35m (0.3ms)[0m COMMIT
|
57
|
-
Migrating to UpdateNames (20141211711945)
|
58
|
-
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
59
|
-
[1m[35mG5Updatable::Client Load (0.6ms)[0m SELECT "g5_updatable_clients".* FROM "g5_updatable_clients"
|
60
|
-
[1m[36mG5Updatable::Location Load (0.4ms)[0m [1mSELECT "g5_updatable_locations".* FROM "g5_updatable_locations"[0m
|
61
|
-
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141211711945"]]
|
62
|
-
[1m[36m (0.3ms)[0m [1mCOMMIT[0m
|
63
|
-
Migrating to CreateRestaurants (20141222072623)
|
64
|
-
[1m[35m (0.1ms)[0m BEGIN
|
65
|
-
[1m[36m (2.0ms)[0m [1mCREATE TABLE "restaurants" ("id" serial primary key, "name" character varying(255), "client_uid" character varying(255), "created_at" timestamp, "updated_at" timestamp) [0m
|
66
|
-
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141222072623"]]
|
67
|
-
[1m[36m (0.2ms)[0m [1mCOMMIT[0m
|
68
|
-
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
69
|
-
[1m[36m (7.5ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
70
|
-
[1m[35m (1.3ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
71
|
-
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
72
|
-
Migrating to CreateLocations (20140630175259)
|
73
|
-
[1m[35m (0.1ms)[0m BEGIN
|
74
|
-
DEPRECATION WARNING: `#timestamps` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/phertler/Software/g5/g5_updatable/spec/dummy/db/migrate/20140630175259_create_locations.rb:21)
|
75
|
-
[1m[36m (5.1ms)[0m [1mCREATE TABLE "locations" ("id" serial primary key, "uid" character varying, "name" character varying, "corporate" boolean, "urn" character varying, "state" character varying, "city" character varying, "street_address" character varying, "postal_code" character varying, "domain" character varying, "city_slug" character varying, "phone_number" character varying, "neighborhood" character varying, "primary_amenity" character varying, "primary_landmark" character varying, "qualifier" character varying, "floor_plans" character varying, "created_at" timestamp, "updated_at" timestamp) [0m
|
76
|
-
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140630175259"]]
|
77
|
-
[1m[36m (0.3ms)[0m [1mCOMMIT[0m
|
78
|
-
Migrating to CreateClients (20140630175330)
|
79
|
-
[1m[35m (0.2ms)[0m BEGIN
|
80
|
-
DEPRECATION WARNING: `#timestamps` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/phertler/Software/g5/g5_updatable/spec/dummy/db/migrate/20140630175330_create_clients.rb:10)
|
81
|
-
[1m[36m (3.0ms)[0m [1mCREATE TABLE "clients" ("id" serial primary key, "uid" character varying, "name" character varying, "vertical" character varying, "type" character varying, "domain" character varying, "created_at" timestamp, "updated_at" timestamp) [0m
|
82
|
-
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140630175330"]]
|
83
|
-
[1m[36m (0.3ms)[0m [1mCOMMIT[0m
|
84
|
-
Migrating to DropClientsAndLocations (20140709220627)
|
85
|
-
[1m[35m (0.2ms)[0m BEGIN
|
86
|
-
[1m[36m (2.2ms)[0m [1mDROP TABLE "clients"[0m
|
87
|
-
[1m[35m (1.0ms)[0m DROP TABLE "locations"
|
88
|
-
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20140709220627"]]
|
89
|
-
[1m[35m (1.6ms)[0m COMMIT
|
90
|
-
Migrating to CreateG5UpdatableClientsAndLocations (20140709222005)
|
91
|
-
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
92
|
-
DEPRECATION WARNING: `#timestamps` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/phertler/Software/g5/g5_updatable/db/migrate/20140709222005_create_g5_updatable_clients_and_locations.rb:8)
|
93
|
-
[1m[35m (2.9ms)[0m CREATE TABLE "g5_updatable_clients" ("id" serial primary key, "uid" character varying, "urn" character varying, "properties" json, "created_at" timestamp, "updated_at" timestamp)
|
94
|
-
[1m[36m (0.9ms)[0m [1mCREATE INDEX "index_g5_updatable_clients_on_uid" ON "g5_updatable_clients" ("uid")[0m
|
95
|
-
[1m[35m (0.8ms)[0m CREATE INDEX "index_g5_updatable_clients_on_urn" ON "g5_updatable_clients" ("urn")
|
96
|
-
DEPRECATION WARNING: `#timestamps` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/phertler/Software/g5/g5_updatable/db/migrate/20140709222005_create_g5_updatable_clients_and_locations.rb:19)
|
97
|
-
[1m[36m (3.0ms)[0m [1mCREATE TABLE "g5_updatable_locations" ("id" serial primary key, "uid" character varying, "urn" character varying, "client_uid" character varying, "properties" json, "created_at" timestamp, "updated_at" timestamp) [0m
|
98
|
-
[1m[35m (0.6ms)[0m CREATE INDEX "index_g5_updatable_locations_on_uid" ON "g5_updatable_locations" ("uid")
|
99
|
-
[1m[36m (0.7ms)[0m [1mCREATE INDEX "index_g5_updatable_locations_on_urn" ON "g5_updatable_locations" ("urn")[0m
|
100
|
-
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140709222005"]]
|
101
|
-
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
102
|
-
Migrating to CreateFavoriteFoods (20140714225203)
|
103
|
-
[1m[35m (0.2ms)[0m BEGIN
|
104
|
-
DEPRECATION WARNING: `#timestamps` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/phertler/Software/g5/g5_updatable/spec/dummy/db/migrate/20140714225203_create_favorite_foods.rb:7)
|
105
|
-
[1m[36m (4.3ms)[0m [1mCREATE TABLE "favorite_foods" ("id" serial primary key, "name" character varying, "location_uid" character varying, "created_at" timestamp, "updated_at" timestamp) [0m
|
106
|
-
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140714225203"]]
|
107
|
-
[1m[36m (0.3ms)[0m [1mCOMMIT[0m
|
108
|
-
Migrating to CreateIntegrationSetting (20141030211945)
|
109
|
-
[1m[35m (0.2ms)[0m BEGIN
|
110
|
-
DEPRECATION WARNING: `#timestamps` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/phertler/Software/g5/g5_updatable/db/migrate/20141030211945_create_integration_setting.rb:10)
|
111
|
-
[1m[36m (3.1ms)[0m [1mCREATE TABLE "g5_updatable_integration_settings" ("id" serial primary key, "uid" character varying, "urn" character varying, "location_uid" character varying, "vendor_action" character varying, "job_frequency_in_minutes" integer, "properties" json, "created_at" timestamp, "updated_at" timestamp) [0m
|
112
|
-
[1m[35m (1.1ms)[0m CREATE INDEX "index_g5_updatable_integration_settings_on_urn" ON "g5_updatable_integration_settings" ("urn")
|
113
|
-
[1m[36m (0.8ms)[0m [1mCREATE INDEX "index_g5_updatable_integration_settings_on_uid" ON "g5_updatable_integration_settings" ("uid")[0m
|
114
|
-
[1m[35m (0.6ms)[0m CREATE INDEX "index_g5_updatable_integration_settings_on_vendor_action" ON "g5_updatable_integration_settings" ("vendor_action")
|
115
|
-
[1m[36m (0.8ms)[0m [1mCREATE INDEX "g5_u_is_loc_action" ON "g5_updatable_integration_settings" ("location_uid", "vendor_action")[0m
|
116
|
-
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141030211945"]]
|
117
|
-
[1m[36m (0.3ms)[0m [1mCOMMIT[0m
|
118
|
-
Migrating to RemoveIntegrationSetting (20141122211945)
|
119
|
-
[1m[35m (0.2ms)[0m BEGIN
|
120
|
-
[1m[36m (1.4ms)[0m [1mDROP TABLE "g5_updatable_integration_settings"[0m
|
121
|
-
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141122211945"]]
|
122
|
-
[1m[36m (0.9ms)[0m [1mCOMMIT[0m
|
123
|
-
Migrating to AddNameToClientsAndLocations (20141211211945)
|
124
|
-
[1m[35m (0.1ms)[0m BEGIN
|
125
|
-
[1m[36m (0.4ms)[0m [1mALTER TABLE "g5_updatable_clients" ADD "name" character varying[0m
|
126
|
-
[1m[35m (0.9ms)[0m CREATE INDEX "index_g5_updatable_clients_on_name" ON "g5_updatable_clients" ("name")
|
127
|
-
[1m[36m (0.3ms)[0m [1mALTER TABLE "g5_updatable_locations" ADD "name" character varying[0m
|
128
|
-
[1m[35m (0.8ms)[0m CREATE INDEX "index_g5_updatable_locations_on_name" ON "g5_updatable_locations" ("name")
|
129
|
-
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20141211211945"]]
|
130
|
-
[1m[35m (0.2ms)[0m COMMIT
|
131
|
-
Migrating to UpdateNames (20141211711945)
|
132
|
-
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
133
|
-
[1m[35mG5Updatable::Client Load (0.5ms)[0m SELECT "g5_updatable_clients".* FROM "g5_updatable_clients"
|
134
|
-
[1m[36mG5Updatable::Location Load (0.5ms)[0m [1mSELECT "g5_updatable_locations".* FROM "g5_updatable_locations"[0m
|
135
|
-
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141211711945"]]
|
136
|
-
[1m[36m (0.3ms)[0m [1mCOMMIT[0m
|
137
|
-
Migrating to CreateRestaurants (20141222072623)
|
138
|
-
[1m[35m (0.1ms)[0m BEGIN
|
139
|
-
DEPRECATION WARNING: `#timestamps` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/phertler/Software/g5/g5_updatable/spec/dummy/db/migrate/20141222072623_create_restaurants.rb:6)
|
140
|
-
[1m[36m (3.5ms)[0m [1mCREATE TABLE "restaurants" ("id" serial primary key, "name" character varying, "client_uid" character varying, "created_at" timestamp, "updated_at" timestamp) [0m
|
141
|
-
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141222072623"]]
|
142
|
-
[1m[36m (0.2ms)[0m [1mCOMMIT[0m
|
1
|
+
[1m[36mActiveRecord::SchemaMigration Load (2.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
143
2
|
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
144
|
-
[1m[36m (
|
3
|
+
[1m[36m (2.8ms)[0m [1mSELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
145
4
|
FROM pg_constraint c
|
146
5
|
JOIN pg_class t1 ON c.conrelid = t1.oid
|
147
6
|
JOIN pg_class t2 ON c.confrelid = t2.oid
|
@@ -153,7 +12,7 @@ WHERE c.contype = 'f'
|
|
153
12
|
AND t3.nspname = ANY (current_schemas(false))
|
154
13
|
ORDER BY c.conname
|
155
14
|
[0m
|
156
|
-
[1m[35m (
|
15
|
+
[1m[35m (1.1ms)[0m SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
157
16
|
FROM pg_constraint c
|
158
17
|
JOIN pg_class t1 ON c.conrelid = t1.oid
|
159
18
|
JOIN pg_class t2 ON c.confrelid = t2.oid
|
@@ -165,7 +24,7 @@ WHERE c.contype = 'f'
|
|
165
24
|
AND t3.nspname = ANY (current_schemas(false))
|
166
25
|
ORDER BY c.conname
|
167
26
|
|
168
|
-
[1m[36m (
|
27
|
+
[1m[36m (1.1ms)[0m [1mSELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
169
28
|
FROM pg_constraint c
|
170
29
|
JOIN pg_class t1 ON c.conrelid = t1.oid
|
171
30
|
JOIN pg_class t2 ON c.confrelid = t2.oid
|
@@ -177,7 +36,92 @@ WHERE c.contype = 'f'
|
|
177
36
|
AND t3.nspname = ANY (current_schemas(false))
|
178
37
|
ORDER BY c.conname
|
179
38
|
[0m
|
180
|
-
[1m[35m (
|
39
|
+
[1m[35m (1.2ms)[0m SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
40
|
+
FROM pg_constraint c
|
41
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
42
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
43
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
44
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
45
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
46
|
+
WHERE c.contype = 'f'
|
47
|
+
AND t1.relname = 'restaurants'
|
48
|
+
AND t3.nspname = ANY (current_schemas(false))
|
49
|
+
ORDER BY c.conname
|
50
|
+
|
51
|
+
[1m[36mActiveRecord::SchemaMigration Load (7.4ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
52
|
+
Migrating to AddAmenities (20161122070749)
|
53
|
+
[1m[35m (0.1ms)[0m BEGIN
|
54
|
+
DEPRECATION WARNING: `#timestamps` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/phertler/Software/g5/g5_updatable/db/migrate/20161122070749_add_amenities.rb:9)
|
55
|
+
[1m[36m (99.9ms)[0m [1mCREATE TABLE "g5_updatable_hub_amenities" ("id" serial primary key, "external_id" integer, "name" character varying, "icon" character varying, "external_updated_at" timestamp, "external_created_at" timestamp, "created_at" timestamp, "updated_at" timestamp) [0m
|
56
|
+
[1m[35m (0.7ms)[0m CREATE UNIQUE INDEX "index_g5_updatable_hub_amenities_on_external_id" ON "g5_updatable_hub_amenities" ("external_id")
|
57
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "g5_updatable_hub_amenities_locations" ("id" serial primary key, "g5_updatable_hub_amenity_id" integer, "g5_updatable_location_id" integer) [0m
|
58
|
+
[1m[35m (0.6ms)[0m CREATE INDEX "updatable_amenities_loc_amen_id" ON "g5_updatable_hub_amenities_locations" ("g5_updatable_hub_amenity_id")
|
59
|
+
[1m[36m (0.5ms)[0m [1mCREATE INDEX "updatable_amenities_loc_loc_id" ON "g5_updatable_hub_amenities_locations" ("g5_updatable_location_id")[0m
|
60
|
+
[1m[35m (1.7ms)[0m ALTER TABLE "g5_updatable_locations" ADD "flat_amenity_names" character varying
|
61
|
+
[1m[36mSQL (4.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20161122070749"]]
|
62
|
+
[1m[35m (12.3ms)[0m COMMIT
|
63
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
64
|
+
[1m[35m (3.9ms)[0m SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
65
|
+
FROM pg_constraint c
|
66
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
67
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
68
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
69
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
70
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
71
|
+
WHERE c.contype = 'f'
|
72
|
+
AND t1.relname = 'favorite_foods'
|
73
|
+
AND t3.nspname = ANY (current_schemas(false))
|
74
|
+
ORDER BY c.conname
|
75
|
+
|
76
|
+
[1m[36m (1.1ms)[0m [1mSELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
77
|
+
FROM pg_constraint c
|
78
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
79
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
80
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
81
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
82
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
83
|
+
WHERE c.contype = 'f'
|
84
|
+
AND t1.relname = 'g5_updatable_clients'
|
85
|
+
AND t3.nspname = ANY (current_schemas(false))
|
86
|
+
ORDER BY c.conname
|
87
|
+
[0m
|
88
|
+
[1m[35m (1.0ms)[0m SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
89
|
+
FROM pg_constraint c
|
90
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
91
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
92
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
93
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
94
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
95
|
+
WHERE c.contype = 'f'
|
96
|
+
AND t1.relname = 'g5_updatable_hub_amenities'
|
97
|
+
AND t3.nspname = ANY (current_schemas(false))
|
98
|
+
ORDER BY c.conname
|
99
|
+
|
100
|
+
[1m[36m (1.0ms)[0m [1mSELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
101
|
+
FROM pg_constraint c
|
102
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
103
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
104
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
105
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
106
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
107
|
+
WHERE c.contype = 'f'
|
108
|
+
AND t1.relname = 'g5_updatable_hub_amenities_locations'
|
109
|
+
AND t3.nspname = ANY (current_schemas(false))
|
110
|
+
ORDER BY c.conname
|
111
|
+
[0m
|
112
|
+
[1m[35m (1.0ms)[0m SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
113
|
+
FROM pg_constraint c
|
114
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
115
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
116
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
117
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
118
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
119
|
+
WHERE c.contype = 'f'
|
120
|
+
AND t1.relname = 'g5_updatable_locations'
|
121
|
+
AND t3.nspname = ANY (current_schemas(false))
|
122
|
+
ORDER BY c.conname
|
123
|
+
|
124
|
+
[1m[36m (1.0ms)[0m [1mSELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
181
125
|
FROM pg_constraint c
|
182
126
|
JOIN pg_class t1 ON c.conrelid = t1.oid
|
183
127
|
JOIN pg_class t2 ON c.confrelid = t2.oid
|
@@ -188,4 +132,86 @@ WHERE c.contype = 'f'
|
|
188
132
|
AND t1.relname = 'restaurants'
|
189
133
|
AND t3.nspname = ANY (current_schemas(false))
|
190
134
|
ORDER BY c.conname
|
135
|
+
[0m
|
136
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
137
|
+
Migrating to AddClientUrnToLocations (20161209070749)
|
138
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
139
|
+
Migrating to AddClientUrnToLocations (20161209070749)
|
140
|
+
[1m[35m (0.1ms)[0m BEGIN
|
141
|
+
[1m[36m (0.5ms)[0m [1mALTER TABLE "g5_updatable_locations" ADD "client_urn" character varying[0m
|
142
|
+
[1m[35m (16.5ms)[0m CREATE INDEX "index_g5_updatable_locations_on_client_urn" ON "g5_updatable_locations" ("client_urn")
|
143
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20161209070749"]]
|
144
|
+
[1m[35m (6.2ms)[0m COMMIT
|
145
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
146
|
+
[1m[35m (1.4ms)[0m SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
147
|
+
FROM pg_constraint c
|
148
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
149
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
150
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
151
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
152
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
153
|
+
WHERE c.contype = 'f'
|
154
|
+
AND t1.relname = 'favorite_foods'
|
155
|
+
AND t3.nspname = ANY (current_schemas(false))
|
156
|
+
ORDER BY c.conname
|
157
|
+
|
158
|
+
[1m[36m (1.0ms)[0m [1mSELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
159
|
+
FROM pg_constraint c
|
160
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
161
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
162
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
163
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
164
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
165
|
+
WHERE c.contype = 'f'
|
166
|
+
AND t1.relname = 'g5_updatable_clients'
|
167
|
+
AND t3.nspname = ANY (current_schemas(false))
|
168
|
+
ORDER BY c.conname
|
169
|
+
[0m
|
170
|
+
[1m[35m (1.0ms)[0m SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
171
|
+
FROM pg_constraint c
|
172
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
173
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
174
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
175
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
176
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
177
|
+
WHERE c.contype = 'f'
|
178
|
+
AND t1.relname = 'g5_updatable_hub_amenities'
|
179
|
+
AND t3.nspname = ANY (current_schemas(false))
|
180
|
+
ORDER BY c.conname
|
181
|
+
|
182
|
+
[1m[36m (1.3ms)[0m [1mSELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
183
|
+
FROM pg_constraint c
|
184
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
185
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
186
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
187
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
188
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
189
|
+
WHERE c.contype = 'f'
|
190
|
+
AND t1.relname = 'g5_updatable_hub_amenities_locations'
|
191
|
+
AND t3.nspname = ANY (current_schemas(false))
|
192
|
+
ORDER BY c.conname
|
193
|
+
[0m
|
194
|
+
[1m[35m (1.0ms)[0m SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
195
|
+
FROM pg_constraint c
|
196
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
197
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
198
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
199
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
200
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
201
|
+
WHERE c.contype = 'f'
|
202
|
+
AND t1.relname = 'g5_updatable_locations'
|
203
|
+
AND t3.nspname = ANY (current_schemas(false))
|
204
|
+
ORDER BY c.conname
|
191
205
|
|
206
|
+
[1m[36m (1.0ms)[0m [1mSELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
|
207
|
+
FROM pg_constraint c
|
208
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
209
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
210
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
211
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
212
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
213
|
+
WHERE c.contype = 'f'
|
214
|
+
AND t1.relname = 'restaurants'
|
215
|
+
AND t3.nspname = ANY (current_schemas(false))
|
216
|
+
ORDER BY c.conname
|
217
|
+
[0m
|