active_record_doctor 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +41 -0
- data/lib/active_record_doctor/printers/io_printer.rb +6 -0
- data/lib/active_record_doctor/tasks/missing_foreign_keys.rb +69 -0
- data/lib/active_record_doctor/version.rb +1 -1
- data/lib/tasks/active_record_doctor_tasks.rake +5 -0
- data/test/active_record_doctor/tasks/missing_foreign_keys_test.rb +19 -0
- data/test/dummy/config/database.yml +5 -11
- data/test/dummy/config/database.yml.travis +5 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/{20160213102131_create_employers.rb → 20160213101213_create_employers.rb} +0 -0
- data/test/dummy/db/migrate/{20160213101213_create_users.rb → 20160213101221_create_users.rb} +1 -1
- data/test/dummy/db/schema.rb +13 -9
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +1006 -0
- data/test/dummy/log/test.log +3688 -0
- data/test/support/spy_printer.rb +7 -6
- metadata +14 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f49409fa35146d005fc867205172ab87389eacb1
|
4
|
+
data.tar.gz: dc70f64059240bed0a55476e1d3576612e33a326
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20c65babdee5483b998195228023898a63a035ee601452e556c76424bf5411c1a15e43a2c8d63148063fdb0a0f84aa673e989798e22c5f27ca73c12bada4d091
|
7
|
+
data.tar.gz: 6f6c9c0d6df4881fa13a3ff7f204b545ee2a03888ac45371d9b568c363bb0156d94ab40debe136412b33239c119cc2820c3ab643351651711115f6d7bdf22e7c
|
data/README.md
CHANGED
@@ -5,6 +5,7 @@ can:
|
|
5
5
|
|
6
6
|
* index unindexed foreign keys
|
7
7
|
* detect extraneous indexes
|
8
|
+
* detect missing foreign key constraints
|
8
9
|
|
9
10
|
More features coming soon!
|
10
11
|
|
@@ -99,6 +100,46 @@ example, if there's a unique index on `users.login` and a non-unique index on
|
|
99
100
|
`users.login, users.domain` then the tool will _not_ suggest dropping
|
100
101
|
`users.login` as it could violate the uniqueness assumption.
|
101
102
|
|
103
|
+
### Detecting Missing Foreign Key Constraints
|
104
|
+
|
105
|
+
If `users.profile_id` references a row in `profiles` then this can be expressed
|
106
|
+
at the database level with a foreign key constraint. It _forces_
|
107
|
+
`users.profile_id` to point to an existing row in `profiles`. The problem is
|
108
|
+
that in many legacy Rails apps the constraint isn't enforced at the database
|
109
|
+
level.
|
110
|
+
|
111
|
+
`active_record_doctor` can automatically detect foreign keys that could benefit
|
112
|
+
from a foreign key constraint (a future version will generate a migrations that
|
113
|
+
add the constraint; for now, it's your job). You can obtain the list of foreign
|
114
|
+
keys with the following command:
|
115
|
+
|
116
|
+
```bash
|
117
|
+
rake active_record_doctor:missing_foreign_keys
|
118
|
+
```
|
119
|
+
|
120
|
+
The output will look like:
|
121
|
+
|
122
|
+
```
|
123
|
+
users profile_id
|
124
|
+
comments user_id article_id
|
125
|
+
```
|
126
|
+
|
127
|
+
Tables are listed one per line. Each line starts with a table name followed by
|
128
|
+
column names that should have a foreign key constraint. In the example above,
|
129
|
+
`users.profile_id`, `comments.user_id`, and `comments.article_id` lack a foreign
|
130
|
+
key constraint.
|
131
|
+
|
132
|
+
In order to add a foreign key constraint to `users.profile_id` use the following
|
133
|
+
migration:
|
134
|
+
|
135
|
+
```ruby
|
136
|
+
class AddForeignKeyConstraintToUsersProfileId < ActiveRecord::Migration
|
137
|
+
def change
|
138
|
+
add_foreign_key :users, :profiles
|
139
|
+
end
|
140
|
+
end
|
141
|
+
```
|
142
|
+
|
102
143
|
## Author
|
103
144
|
|
104
145
|
This gem is developed and maintained by [Greg Navis](http://www.gregnavis.com).
|
@@ -29,6 +29,12 @@ module ActiveRecordDoctor
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
32
|
+
|
33
|
+
def print_missing_foreign_keys(missing_foreign_keys)
|
34
|
+
@io.puts(missing_foreign_keys.sort.map do |table, columns|
|
35
|
+
"#{table} #{columns.sort.join(' ')}"
|
36
|
+
end.join("\n"))
|
37
|
+
end
|
32
38
|
end
|
33
39
|
end
|
34
40
|
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require "active_record_doctor/compatibility"
|
2
|
+
require "active_record_doctor/printers/io_printer"
|
3
|
+
|
4
|
+
module ActiveRecordDoctor
|
5
|
+
module Tasks
|
6
|
+
class MissingForeignKeys
|
7
|
+
include Compatibility
|
8
|
+
|
9
|
+
def self.run
|
10
|
+
new.run
|
11
|
+
end
|
12
|
+
|
13
|
+
def initialize(printer: ActiveRecordDoctor::Printers::IOPrinter.new)
|
14
|
+
@printer = printer
|
15
|
+
end
|
16
|
+
|
17
|
+
def run
|
18
|
+
@printer.print_missing_foreign_keys(missing_foreign_keys)
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def missing_foreign_keys
|
24
|
+
hash_from_pairs(connection_tables.select do |table|
|
25
|
+
"schema_migrations" != table
|
26
|
+
end.map do |table|
|
27
|
+
[
|
28
|
+
table,
|
29
|
+
connection.columns(table).select do |column|
|
30
|
+
# We need to skip polymorphic associations as they can reference
|
31
|
+
# multiple tables but a foreign key constraint can reference
|
32
|
+
# a single predefined table.
|
33
|
+
id?(table, column) &&
|
34
|
+
!foreign_key?(table, column) &&
|
35
|
+
!polymorphic_foreign_key?(table, column)
|
36
|
+
end.map(&:name)
|
37
|
+
]
|
38
|
+
end.select do |table, columns|
|
39
|
+
!columns.empty?
|
40
|
+
end)
|
41
|
+
end
|
42
|
+
|
43
|
+
def id?(table, column)
|
44
|
+
column.name.end_with?("_id")
|
45
|
+
end
|
46
|
+
|
47
|
+
def foreign_key?(table, column)
|
48
|
+
connection.foreign_keys(table).any? do |foreign_key|
|
49
|
+
foreign_key.options[:column] == column.name
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def polymorphic_foreign_key?(table, column)
|
54
|
+
type_column_name = column.name.sub(/_id\Z/, '_type')
|
55
|
+
connection.columns(table).any? do |another_column|
|
56
|
+
another_column.name == type_column_name
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def connection
|
61
|
+
@connection ||= ActiveRecord::Base.connection
|
62
|
+
end
|
63
|
+
|
64
|
+
def hash_from_pairs(pairs)
|
65
|
+
Hash[*pairs.flatten(1)]
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require "active_record_doctor/tasks/unindexed_foreign_keys"
|
2
2
|
require "active_record_doctor/tasks/extraneous_indexes"
|
3
|
+
require "active_record_doctor/tasks/missing_foreign_keys"
|
3
4
|
|
4
5
|
namespace :active_record_doctor do
|
5
6
|
task :unindexed_foreign_keys => :environment do
|
@@ -9,4 +10,8 @@ namespace :active_record_doctor do
|
|
9
10
|
task :extraneous_indexes => :environment do
|
10
11
|
ActiveRecordDoctor::Tasks::ExtraneousIndexes.run
|
11
12
|
end
|
13
|
+
|
14
|
+
task :missing_foreign_keys => :environment do
|
15
|
+
ActiveRecordDoctor::Tasks::MissingForeignKeys.run
|
16
|
+
end
|
12
17
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
require 'active_record_doctor/tasks/missing_foreign_keys'
|
4
|
+
|
5
|
+
class ActiveRecordDoctor::Tasks::MissingForeignKeysTest < ActiveSupport::TestCase
|
6
|
+
def test_missing_foreign_keys_are_reported
|
7
|
+
result = run_task
|
8
|
+
|
9
|
+
assert_equal({'users' => ['profile_id']}, result)
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def run_task
|
15
|
+
printer = SpyPrinter.new
|
16
|
+
ActiveRecordDoctor::Tasks::MissingForeignKeys.new(printer: printer).run
|
17
|
+
printer.missing_foreign_keys
|
18
|
+
end
|
19
|
+
end
|
@@ -1,25 +1,19 @@
|
|
1
|
-
# SQLite version 3.x
|
2
|
-
# gem install sqlite3
|
3
|
-
#
|
4
|
-
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
-
# gem 'sqlite3'
|
6
|
-
#
|
7
1
|
default: &default
|
8
|
-
adapter:
|
2
|
+
adapter: postgresql
|
3
|
+
encoding: unicode
|
9
4
|
pool: 5
|
10
|
-
timeout: 5000
|
11
5
|
|
12
6
|
development:
|
13
7
|
<<: *default
|
14
|
-
database:
|
8
|
+
database: active_record_doctor_development
|
15
9
|
|
16
10
|
# Warning: The database defined as "test" will be erased and
|
17
11
|
# re-generated from your development database when you run "rake".
|
18
12
|
# Do not set this db to the same as development or production.
|
19
13
|
test:
|
20
14
|
<<: *default
|
21
|
-
database:
|
15
|
+
database: active_record_doctor_test
|
22
16
|
|
23
17
|
production:
|
24
18
|
<<: *default
|
25
|
-
database:
|
19
|
+
database: active_record_doctor_production
|
Binary file
|
data/test/dummy/db/migrate/{20160213102131_create_employers.rb → 20160213101213_create_employers.rb}
RENAMED
File without changes
|
data/test/dummy/db/migrate/{20160213101213_create_users.rb → 20160213101221_create_users.rb}
RENAMED
@@ -4,7 +4,7 @@ class CreateUsers < ActiveRecord::Migration
|
|
4
4
|
t.string :email
|
5
5
|
t.string :first_name
|
6
6
|
t.string :last_name
|
7
|
-
t.references :profile, foreign_key:
|
7
|
+
t.references :profile, foreign_key: false
|
8
8
|
t.references :employer, foreign_key: true
|
9
9
|
t.string :country_code, null: false
|
10
10
|
|
data/test/dummy/db/schema.rb
CHANGED
@@ -13,6 +13,9 @@
|
|
13
13
|
|
14
14
|
ActiveRecord::Schema.define(version: 20160604081452) do
|
15
15
|
|
16
|
+
# These are extensions that must be enabled in order to support this database
|
17
|
+
enable_extension "plpgsql"
|
18
|
+
|
16
19
|
create_table "comments", force: :cascade do |t|
|
17
20
|
t.integer "commentable_id"
|
18
21
|
t.string "commentable_type"
|
@@ -20,7 +23,7 @@ ActiveRecord::Schema.define(version: 20160604081452) do
|
|
20
23
|
t.datetime "updated_at", null: false
|
21
24
|
end
|
22
25
|
|
23
|
-
add_index "comments", ["commentable_type", "commentable_id"], name: "index_comments_on_commentable_type_and_commentable_id"
|
26
|
+
add_index "comments", ["commentable_type", "commentable_id"], name: "index_comments_on_commentable_type_and_commentable_id", using: :btree
|
24
27
|
|
25
28
|
create_table "employers", force: :cascade do |t|
|
26
29
|
t.string "name"
|
@@ -28,7 +31,7 @@ ActiveRecord::Schema.define(version: 20160604081452) do
|
|
28
31
|
t.datetime "updated_at", null: false
|
29
32
|
end
|
30
33
|
|
31
|
-
add_index "employers", ["id"], name: "index_employers_on_id"
|
34
|
+
add_index "employers", ["id"], name: "index_employers_on_id", using: :btree
|
32
35
|
|
33
36
|
create_table "profiles", force: :cascade do |t|
|
34
37
|
t.string "first_name"
|
@@ -48,12 +51,13 @@ ActiveRecord::Schema.define(version: 20160604081452) do
|
|
48
51
|
t.datetime "updated_at", null: false
|
49
52
|
end
|
50
53
|
|
51
|
-
add_index "users", ["email"], name: "index_users_on_email"
|
52
|
-
add_index "users", ["email"], name: "unique_index_on_users_email", unique: true
|
53
|
-
add_index "users", ["employer_id", "country_code"], name: "index_users_on_employer_id_and_country_code"
|
54
|
-
add_index "users", ["last_name", "first_name", "email"], name: "index_users_on_last_name_and_first_name_and_email"
|
55
|
-
add_index "users", ["last_name", "first_name"], name: "index_users_on_last_name_and_first_name"
|
56
|
-
add_index "users", ["last_name", "first_name"], name: "unique_index_on_users_last_name_and_first_name", unique: true
|
57
|
-
add_index "users", ["last_name"], name: "index_users_on_last_name"
|
54
|
+
add_index "users", ["email"], name: "index_users_on_email", using: :btree
|
55
|
+
add_index "users", ["email"], name: "unique_index_on_users_email", unique: true, using: :btree
|
56
|
+
add_index "users", ["employer_id", "country_code"], name: "index_users_on_employer_id_and_country_code", using: :btree
|
57
|
+
add_index "users", ["last_name", "first_name", "email"], name: "index_users_on_last_name_and_first_name_and_email", using: :btree
|
58
|
+
add_index "users", ["last_name", "first_name"], name: "index_users_on_last_name_and_first_name", using: :btree
|
59
|
+
add_index "users", ["last_name", "first_name"], name: "unique_index_on_users_last_name_and_first_name", unique: true, using: :btree
|
60
|
+
add_index "users", ["last_name"], name: "index_users_on_last_name", using: :btree
|
58
61
|
|
62
|
+
add_foreign_key "users", "employers"
|
59
63
|
end
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -4690,3 +4690,1009 @@ Migrating to CreateComments (20160604081452)
|
|
4690
4690
|
FROM sqlite_temp_master
|
4691
4691
|
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4692
4692
|
|
4693
|
+
[1m[36m (28.5ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
4694
|
+
[1m[35m (0.0ms)[0m select sqlite_version(*)
|
4695
|
+
[1m[36m (26.8ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
4696
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.0ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
4697
|
+
Migrating to CreateUsers (20160213101213)
|
4698
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4699
|
+
[1m[35m (0.1ms)[0m CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar, "first_name" varchar, "last_name" varchar, "profile_id" integer, "employer_id" integer, "country_code" varchar NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
4700
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_users_on_last_name_and_first_name_and_email" ON "users" ("last_name", "first_name", "email")[0m
|
4701
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
4702
|
+
FROM sqlite_master
|
4703
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4704
|
+
UNION ALL
|
4705
|
+
SELECT sql
|
4706
|
+
FROM sqlite_temp_master
|
4707
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4708
|
+
|
4709
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_users_on_last_name_and_first_name" ON "users" ("last_name", "first_name")[0m
|
4710
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
4711
|
+
FROM sqlite_master
|
4712
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
4713
|
+
UNION ALL
|
4714
|
+
SELECT sql
|
4715
|
+
FROM sqlite_temp_master
|
4716
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
4717
|
+
|
4718
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
4719
|
+
FROM sqlite_master
|
4720
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4721
|
+
UNION ALL
|
4722
|
+
SELECT sql
|
4723
|
+
FROM sqlite_temp_master
|
4724
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4725
|
+
[0m
|
4726
|
+
[1m[35m (0.1ms)[0m CREATE UNIQUE INDEX "unique_index_on_users_last_name_and_first_name" ON "users" ("last_name", "first_name")
|
4727
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
4728
|
+
FROM sqlite_master
|
4729
|
+
WHERE name='unique_index_on_users_last_name_and_first_name' AND type='index'
|
4730
|
+
UNION ALL
|
4731
|
+
SELECT sql
|
4732
|
+
FROM sqlite_temp_master
|
4733
|
+
WHERE name='unique_index_on_users_last_name_and_first_name' AND type='index'
|
4734
|
+
[0m
|
4735
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
4736
|
+
FROM sqlite_master
|
4737
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
4738
|
+
UNION ALL
|
4739
|
+
SELECT sql
|
4740
|
+
FROM sqlite_temp_master
|
4741
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
4742
|
+
|
4743
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
4744
|
+
FROM sqlite_master
|
4745
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4746
|
+
UNION ALL
|
4747
|
+
SELECT sql
|
4748
|
+
FROM sqlite_temp_master
|
4749
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4750
|
+
[0m
|
4751
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_users_on_last_name" ON "users" ("last_name")
|
4752
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
4753
|
+
FROM sqlite_master
|
4754
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
4755
|
+
UNION ALL
|
4756
|
+
SELECT sql
|
4757
|
+
FROM sqlite_temp_master
|
4758
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
4759
|
+
[0m
|
4760
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
4761
|
+
FROM sqlite_master
|
4762
|
+
WHERE name='unique_index_on_users_last_name_and_first_name' AND type='index'
|
4763
|
+
UNION ALL
|
4764
|
+
SELECT sql
|
4765
|
+
FROM sqlite_temp_master
|
4766
|
+
WHERE name='unique_index_on_users_last_name_and_first_name' AND type='index'
|
4767
|
+
|
4768
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
4769
|
+
FROM sqlite_master
|
4770
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
4771
|
+
UNION ALL
|
4772
|
+
SELECT sql
|
4773
|
+
FROM sqlite_temp_master
|
4774
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
4775
|
+
[0m
|
4776
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
4777
|
+
FROM sqlite_master
|
4778
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4779
|
+
UNION ALL
|
4780
|
+
SELECT sql
|
4781
|
+
FROM sqlite_temp_master
|
4782
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4783
|
+
|
4784
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_users_on_email" ON "users" ("email")[0m
|
4785
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
4786
|
+
FROM sqlite_master
|
4787
|
+
WHERE name='index_users_on_email' AND type='index'
|
4788
|
+
UNION ALL
|
4789
|
+
SELECT sql
|
4790
|
+
FROM sqlite_temp_master
|
4791
|
+
WHERE name='index_users_on_email' AND type='index'
|
4792
|
+
|
4793
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
4794
|
+
FROM sqlite_master
|
4795
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
4796
|
+
UNION ALL
|
4797
|
+
SELECT sql
|
4798
|
+
FROM sqlite_temp_master
|
4799
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
4800
|
+
[0m
|
4801
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
4802
|
+
FROM sqlite_master
|
4803
|
+
WHERE name='unique_index_on_users_last_name_and_first_name' AND type='index'
|
4804
|
+
UNION ALL
|
4805
|
+
SELECT sql
|
4806
|
+
FROM sqlite_temp_master
|
4807
|
+
WHERE name='unique_index_on_users_last_name_and_first_name' AND type='index'
|
4808
|
+
|
4809
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
4810
|
+
FROM sqlite_master
|
4811
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
4812
|
+
UNION ALL
|
4813
|
+
SELECT sql
|
4814
|
+
FROM sqlite_temp_master
|
4815
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
4816
|
+
[0m
|
4817
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
4818
|
+
FROM sqlite_master
|
4819
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4820
|
+
UNION ALL
|
4821
|
+
SELECT sql
|
4822
|
+
FROM sqlite_temp_master
|
4823
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4824
|
+
|
4825
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_index_on_users_email" ON "users" ("email")[0m
|
4826
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
4827
|
+
FROM sqlite_master
|
4828
|
+
WHERE name='unique_index_on_users_email' AND type='index'
|
4829
|
+
UNION ALL
|
4830
|
+
SELECT sql
|
4831
|
+
FROM sqlite_temp_master
|
4832
|
+
WHERE name='unique_index_on_users_email' AND type='index'
|
4833
|
+
|
4834
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
4835
|
+
FROM sqlite_master
|
4836
|
+
WHERE name='index_users_on_email' AND type='index'
|
4837
|
+
UNION ALL
|
4838
|
+
SELECT sql
|
4839
|
+
FROM sqlite_temp_master
|
4840
|
+
WHERE name='index_users_on_email' AND type='index'
|
4841
|
+
[0m
|
4842
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
4843
|
+
FROM sqlite_master
|
4844
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
4845
|
+
UNION ALL
|
4846
|
+
SELECT sql
|
4847
|
+
FROM sqlite_temp_master
|
4848
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
4849
|
+
|
4850
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
4851
|
+
FROM sqlite_master
|
4852
|
+
WHERE name='unique_index_on_users_last_name_and_first_name' AND type='index'
|
4853
|
+
UNION ALL
|
4854
|
+
SELECT sql
|
4855
|
+
FROM sqlite_temp_master
|
4856
|
+
WHERE name='unique_index_on_users_last_name_and_first_name' AND type='index'
|
4857
|
+
[0m
|
4858
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
4859
|
+
FROM sqlite_master
|
4860
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
4861
|
+
UNION ALL
|
4862
|
+
SELECT sql
|
4863
|
+
FROM sqlite_temp_master
|
4864
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
4865
|
+
|
4866
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
4867
|
+
FROM sqlite_master
|
4868
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4869
|
+
UNION ALL
|
4870
|
+
SELECT sql
|
4871
|
+
FROM sqlite_temp_master
|
4872
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4873
|
+
[0m
|
4874
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_users_on_employer_id_and_country_code" ON "users" ("employer_id", "country_code")
|
4875
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20160213101213"]]
|
4876
|
+
[1m[35m (30.4ms)[0m commit transaction
|
4877
|
+
Migrating to CreateProfiles (20160213101232)
|
4878
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4879
|
+
[1m[35m (0.1ms)[0m CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "first_name" varchar, "last_name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
4880
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20160213101232"]]
|
4881
|
+
[1m[35m (21.5ms)[0m commit transaction
|
4882
|
+
Migrating to CreateEmployers (20160213102131)
|
4883
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4884
|
+
[1m[35m (0.1ms)[0m CREATE TABLE "employers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
4885
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_employers_on_id" ON "employers" ("id")[0m
|
4886
|
+
[1m[35mSQL (0.0ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160213102131"]]
|
4887
|
+
[1m[36m (29.9ms)[0m [1mcommit transaction[0m
|
4888
|
+
Migrating to CreateComments (20160604081452)
|
4889
|
+
[1m[35m (0.0ms)[0m begin transaction
|
4890
|
+
[1m[36m (0.1ms)[0m [1mCREATE TABLE "comments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "commentable_id" integer, "commentable_type" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
4891
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_comments_on_commentable_type_and_commentable_id" ON "comments" ("commentable_type", "commentable_id")
|
4892
|
+
[1m[36mSQL (0.0ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20160604081452"]]
|
4893
|
+
[1m[35m (22.1ms)[0m commit transaction
|
4894
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.0ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4895
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
4896
|
+
FROM sqlite_master
|
4897
|
+
WHERE name='index_comments_on_commentable_type_and_commentable_id' AND type='index'
|
4898
|
+
UNION ALL
|
4899
|
+
SELECT sql
|
4900
|
+
FROM sqlite_temp_master
|
4901
|
+
WHERE name='index_comments_on_commentable_type_and_commentable_id' AND type='index'
|
4902
|
+
|
4903
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
4904
|
+
FROM sqlite_master
|
4905
|
+
WHERE name='index_employers_on_id' AND type='index'
|
4906
|
+
UNION ALL
|
4907
|
+
SELECT sql
|
4908
|
+
FROM sqlite_temp_master
|
4909
|
+
WHERE name='index_employers_on_id' AND type='index'
|
4910
|
+
[0m
|
4911
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
4912
|
+
FROM sqlite_master
|
4913
|
+
WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
|
4914
|
+
UNION ALL
|
4915
|
+
SELECT sql
|
4916
|
+
FROM sqlite_temp_master
|
4917
|
+
WHERE name='index_users_on_employer_id_and_country_code' AND type='index'
|
4918
|
+
|
4919
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
4920
|
+
FROM sqlite_master
|
4921
|
+
WHERE name='unique_index_on_users_email' AND type='index'
|
4922
|
+
UNION ALL
|
4923
|
+
SELECT sql
|
4924
|
+
FROM sqlite_temp_master
|
4925
|
+
WHERE name='unique_index_on_users_email' AND type='index'
|
4926
|
+
[0m
|
4927
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
4928
|
+
FROM sqlite_master
|
4929
|
+
WHERE name='index_users_on_email' AND type='index'
|
4930
|
+
UNION ALL
|
4931
|
+
SELECT sql
|
4932
|
+
FROM sqlite_temp_master
|
4933
|
+
WHERE name='index_users_on_email' AND type='index'
|
4934
|
+
|
4935
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
4936
|
+
FROM sqlite_master
|
4937
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
4938
|
+
UNION ALL
|
4939
|
+
SELECT sql
|
4940
|
+
FROM sqlite_temp_master
|
4941
|
+
WHERE name='index_users_on_last_name' AND type='index'
|
4942
|
+
[0m
|
4943
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
4944
|
+
FROM sqlite_master
|
4945
|
+
WHERE name='unique_index_on_users_last_name_and_first_name' AND type='index'
|
4946
|
+
UNION ALL
|
4947
|
+
SELECT sql
|
4948
|
+
FROM sqlite_temp_master
|
4949
|
+
WHERE name='unique_index_on_users_last_name_and_first_name' AND type='index'
|
4950
|
+
|
4951
|
+
[1m[36m (0.0ms)[0m [1m SELECT sql
|
4952
|
+
FROM sqlite_master
|
4953
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
4954
|
+
UNION ALL
|
4955
|
+
SELECT sql
|
4956
|
+
FROM sqlite_temp_master
|
4957
|
+
WHERE name='index_users_on_last_name_and_first_name' AND type='index'
|
4958
|
+
[0m
|
4959
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
4960
|
+
FROM sqlite_master
|
4961
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4962
|
+
UNION ALL
|
4963
|
+
SELECT sql
|
4964
|
+
FROM sqlite_temp_master
|
4965
|
+
WHERE name='index_users_on_last_name_and_first_name_and_email' AND type='index'
|
4966
|
+
|
4967
|
+
[1m[36m (36.7ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
4968
|
+
[1m[35m (18.4ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
4969
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4970
|
+
Migrating to CreateUsers (20160213101213)
|
4971
|
+
[1m[35m (0.1ms)[0m BEGIN
|
4972
|
+
[1m[36m (36.1ms)[0m [1mCREATE TABLE "users" ("id" serial primary key, "email" character varying, "first_name" character varying, "last_name" character varying, "profile_id" integer, "employer_id" integer, "country_code" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
4973
|
+
[1m[35m (0.5ms)[0m ALTER TABLE "users" ADD CONSTRAINT "fk_rails_e0dbdd604c"
|
4974
|
+
FOREIGN KEY ("employer_id")
|
4975
|
+
REFERENCES "employers" ("id")
|
4976
|
+
|
4977
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
4978
|
+
[1m[36m (34.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
4979
|
+
[1m[35m (32.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
4980
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4981
|
+
Migrating to CreateEmployers (20160213101213)
|
4982
|
+
[1m[35m (0.1ms)[0m BEGIN
|
4983
|
+
[1m[36m (31.8ms)[0m [1mCREATE TABLE "employers" ("id" serial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
4984
|
+
[1m[35m (12.3ms)[0m CREATE INDEX "index_employers_on_id" ON "employers" ("id")
|
4985
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213101213"]]
|
4986
|
+
[1m[35m (12.2ms)[0m COMMIT
|
4987
|
+
Migrating to CreateUsers (20160213101221)
|
4988
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
4989
|
+
[1m[35m (25.1ms)[0m CREATE TABLE "users" ("id" serial primary key, "email" character varying, "first_name" character varying, "last_name" character varying, "profile_id" integer, "employer_id" integer, "country_code" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
4990
|
+
[1m[36m (0.8ms)[0m [1mALTER TABLE "users" ADD CONSTRAINT "fk_rails_e0dbdd604c"
|
4991
|
+
FOREIGN KEY ("employer_id")
|
4992
|
+
REFERENCES "employers" ("id")
|
4993
|
+
[0m
|
4994
|
+
[1m[35m (12.3ms)[0m CREATE INDEX "index_users_on_last_name_and_first_name_and_email" ON "users" ("last_name", "first_name", "email")
|
4995
|
+
[1m[36m (18.2ms)[0m [1mCREATE INDEX "index_users_on_last_name_and_first_name" ON "users" ("last_name", "first_name")[0m
|
4996
|
+
[1m[35m (20.5ms)[0m CREATE UNIQUE INDEX "unique_index_on_users_last_name_and_first_name" ON "users" ("last_name", "first_name")
|
4997
|
+
[1m[36m (12.5ms)[0m [1mCREATE INDEX "index_users_on_last_name" ON "users" ("last_name")[0m
|
4998
|
+
[1m[35m (11.6ms)[0m CREATE INDEX "index_users_on_email" ON "users" ("email")
|
4999
|
+
[1m[36m (11.2ms)[0m [1mCREATE UNIQUE INDEX "unique_index_on_users_email" ON "users" ("email")[0m
|
5000
|
+
[1m[35m (17.6ms)[0m CREATE INDEX "index_users_on_employer_id_and_country_code" ON "users" ("employer_id", "country_code")
|
5001
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213101221"]]
|
5002
|
+
[1m[35m (2.6ms)[0m COMMIT
|
5003
|
+
Migrating to CreateProfiles (20160213101232)
|
5004
|
+
[1m[36m (0.2ms)[0m [1mBEGIN[0m
|
5005
|
+
[1m[35m (36.7ms)[0m CREATE TABLE "profiles" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5006
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213101232"]]
|
5007
|
+
[1m[35m (8.2ms)[0m COMMIT
|
5008
|
+
Migrating to CreateComments (20160604081452)
|
5009
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5010
|
+
[1m[35m (38.4ms)[0m CREATE TABLE "comments" ("id" serial primary key, "commentable_id" integer, "commentable_type" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5011
|
+
[1m[36m (21.1ms)[0m [1mCREATE INDEX "index_comments_on_commentable_type_and_commentable_id" ON "comments" ("commentable_type", "commentable_id")[0m
|
5012
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160604081452"]]
|
5013
|
+
[1m[36m (15.9ms)[0m [1mCOMMIT[0m
|
5014
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5015
|
+
[1m[36m (1.2ms)[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
|
5016
|
+
FROM pg_constraint c
|
5017
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5018
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5019
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5020
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5021
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5022
|
+
WHERE c.contype = 'f'
|
5023
|
+
AND t1.relname = 'comments'
|
5024
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5025
|
+
ORDER BY c.conname
|
5026
|
+
[0m
|
5027
|
+
[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
|
5028
|
+
FROM pg_constraint c
|
5029
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5030
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5031
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5032
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5033
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5034
|
+
WHERE c.contype = 'f'
|
5035
|
+
AND t1.relname = 'employers'
|
5036
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5037
|
+
ORDER BY c.conname
|
5038
|
+
|
5039
|
+
[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
|
5040
|
+
FROM pg_constraint c
|
5041
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5042
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5043
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5044
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5045
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5046
|
+
WHERE c.contype = 'f'
|
5047
|
+
AND t1.relname = 'profiles'
|
5048
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5049
|
+
ORDER BY c.conname
|
5050
|
+
[0m
|
5051
|
+
[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
|
5052
|
+
FROM pg_constraint c
|
5053
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5054
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5055
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5056
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5057
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5058
|
+
WHERE c.contype = 'f'
|
5059
|
+
AND t1.relname = 'users'
|
5060
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5061
|
+
ORDER BY c.conname
|
5062
|
+
|
5063
|
+
[1m[36m (23.5ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
5064
|
+
[1m[35m (18.1ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
5065
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5066
|
+
Migrating to CreateUsers (20160213101213)
|
5067
|
+
[1m[35m (0.2ms)[0m BEGIN
|
5068
|
+
[1m[36m (27.4ms)[0m [1mCREATE TABLE "users" ("id" serial primary key, "email" character varying, "first_name" character varying, "last_name" character varying, "profile_id" integer, "employer_id" integer, "country_code" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5069
|
+
[1m[35m (0.7ms)[0m ALTER TABLE "users" ADD CONSTRAINT "fk_rails_a8794354f0"
|
5070
|
+
FOREIGN KEY ("profile_id")
|
5071
|
+
REFERENCES "profiles" ("id")
|
5072
|
+
|
5073
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
5074
|
+
[1m[36m (26.6ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
5075
|
+
[1m[35m (18.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
5076
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5077
|
+
Migrating to CreateUsers (20160213101213)
|
5078
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5079
|
+
[1m[36m (35.6ms)[0m [1mCREATE TABLE "users" ("id" serial primary key, "email" character varying, "first_name" character varying, "last_name" character varying, "profile_id" integer, "employer_id" integer, "country_code" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5080
|
+
[1m[35m (0.6ms)[0m ALTER TABLE "users" ADD CONSTRAINT "fk_rails_a8794354f0"
|
5081
|
+
FOREIGN KEY ("profile_id")
|
5082
|
+
REFERENCES "profiles" ("id")
|
5083
|
+
|
5084
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
5085
|
+
[1m[36m (37.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
5086
|
+
[1m[35m (23.2ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
5087
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5088
|
+
Migrating to CreateProfiles (20160213101232)
|
5089
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5090
|
+
[1m[36m (47.0ms)[0m [1mCREATE TABLE "profiles" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5091
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160213101232"]]
|
5092
|
+
[1m[36m (15.1ms)[0m [1mCOMMIT[0m
|
5093
|
+
Migrating to CreateUsers (20160213101513)
|
5094
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5095
|
+
[1m[36m (32.1ms)[0m [1mCREATE TABLE "users" ("id" serial primary key, "email" character varying, "first_name" character varying, "last_name" character varying, "profile_id" integer, "employer_id" integer, "country_code" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5096
|
+
[1m[35m (0.8ms)[0m ALTER TABLE "users" ADD CONSTRAINT "fk_rails_a8794354f0"
|
5097
|
+
FOREIGN KEY ("profile_id")
|
5098
|
+
REFERENCES "profiles" ("id")
|
5099
|
+
|
5100
|
+
[1m[36m (0.6ms)[0m [1mALTER TABLE "users" ADD CONSTRAINT "fk_rails_e0dbdd604c"
|
5101
|
+
FOREIGN KEY ("employer_id")
|
5102
|
+
REFERENCES "employers" ("id")
|
5103
|
+
[0m
|
5104
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
5105
|
+
[1m[36m (26.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
5106
|
+
[1m[35m (18.3ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
5107
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5108
|
+
Migrating to CreateProfiles (20160213101232)
|
5109
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5110
|
+
[1m[36m (30.9ms)[0m [1mCREATE TABLE "profiles" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5111
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160213101232"]]
|
5112
|
+
[1m[36m (13.5ms)[0m [1mCOMMIT[0m
|
5113
|
+
Migrating to CreateEmployers (20160213102131)
|
5114
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5115
|
+
[1m[36m (26.5ms)[0m [1mCREATE TABLE "employers" ("id" serial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5116
|
+
[1m[35m (15.9ms)[0m CREATE INDEX "index_employers_on_id" ON "employers" ("id")
|
5117
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213102131"]]
|
5118
|
+
[1m[35m (16.7ms)[0m COMMIT
|
5119
|
+
Migrating to CreateUsers (20160213103017)
|
5120
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5121
|
+
[1m[35m (22.1ms)[0m CREATE TABLE "users" ("id" serial primary key, "email" character varying, "first_name" character varying, "last_name" character varying, "profile_id" integer, "employer_id" integer, "country_code" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5122
|
+
[1m[36m (0.9ms)[0m [1mALTER TABLE "users" ADD CONSTRAINT "fk_rails_a8794354f0"
|
5123
|
+
FOREIGN KEY ("profile_id")
|
5124
|
+
REFERENCES "profiles" ("id")
|
5125
|
+
[0m
|
5126
|
+
[1m[35m (0.5ms)[0m ALTER TABLE "users" ADD CONSTRAINT "fk_rails_e0dbdd604c"
|
5127
|
+
FOREIGN KEY ("employer_id")
|
5128
|
+
REFERENCES "employers" ("id")
|
5129
|
+
|
5130
|
+
[1m[36m (32.9ms)[0m [1mCREATE INDEX "index_users_on_last_name_and_first_name_and_email" ON "users" ("last_name", "first_name", "email")[0m
|
5131
|
+
[1m[35m (16.1ms)[0m CREATE INDEX "index_users_on_last_name_and_first_name" ON "users" ("last_name", "first_name")
|
5132
|
+
[1m[36m (13.0ms)[0m [1mCREATE UNIQUE INDEX "unique_index_on_users_last_name_and_first_name" ON "users" ("last_name", "first_name")[0m
|
5133
|
+
[1m[35m (16.4ms)[0m CREATE INDEX "index_users_on_last_name" ON "users" ("last_name")
|
5134
|
+
[1m[36m (15.7ms)[0m [1mCREATE INDEX "index_users_on_email" ON "users" ("email")[0m
|
5135
|
+
[1m[35m (10.1ms)[0m CREATE UNIQUE INDEX "unique_index_on_users_email" ON "users" ("email")
|
5136
|
+
[1m[36m (10.7ms)[0m [1mCREATE INDEX "index_users_on_employer_id_and_country_code" ON "users" ("employer_id", "country_code")[0m
|
5137
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160213103017"]]
|
5138
|
+
[1m[36m (7.7ms)[0m [1mCOMMIT[0m
|
5139
|
+
Migrating to CreateComments (20160604081452)
|
5140
|
+
[1m[35m (0.2ms)[0m BEGIN
|
5141
|
+
[1m[36m (30.8ms)[0m [1mCREATE TABLE "comments" ("id" serial primary key, "commentable_id" integer, "commentable_type" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5142
|
+
[1m[35m (10.4ms)[0m CREATE INDEX "index_comments_on_commentable_type_and_commentable_id" ON "comments" ("commentable_type", "commentable_id")
|
5143
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160604081452"]]
|
5144
|
+
[1m[35m (8.3ms)[0m COMMIT
|
5145
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5146
|
+
[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
|
5147
|
+
FROM pg_constraint c
|
5148
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5149
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5150
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5151
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5152
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5153
|
+
WHERE c.contype = 'f'
|
5154
|
+
AND t1.relname = 'comments'
|
5155
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5156
|
+
ORDER BY c.conname
|
5157
|
+
|
5158
|
+
[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
|
5159
|
+
FROM pg_constraint c
|
5160
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5161
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5162
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5163
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5164
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5165
|
+
WHERE c.contype = 'f'
|
5166
|
+
AND t1.relname = 'employers'
|
5167
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5168
|
+
ORDER BY c.conname
|
5169
|
+
[0m
|
5170
|
+
[1m[35m (1.6ms)[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
|
5171
|
+
FROM pg_constraint c
|
5172
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5173
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5174
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5175
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5176
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5177
|
+
WHERE c.contype = 'f'
|
5178
|
+
AND t1.relname = 'profiles'
|
5179
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5180
|
+
ORDER BY c.conname
|
5181
|
+
|
5182
|
+
[1m[36m (1.5ms)[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
|
5183
|
+
FROM pg_constraint c
|
5184
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5185
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5186
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5187
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5188
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5189
|
+
WHERE c.contype = 'f'
|
5190
|
+
AND t1.relname = 'users'
|
5191
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5192
|
+
ORDER BY c.conname
|
5193
|
+
[0m
|
5194
|
+
[1m[36m (44.1ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
5195
|
+
[1m[35m (27.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
5196
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5197
|
+
Migrating to CreateEmployers (20160213101213)
|
5198
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5199
|
+
[1m[36m (43.3ms)[0m [1mCREATE TABLE "employers" ("id" serial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5200
|
+
[1m[35m (10.5ms)[0m CREATE INDEX "index_employers_on_id" ON "employers" ("id")
|
5201
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213101213"]]
|
5202
|
+
[1m[35m (17.8ms)[0m COMMIT
|
5203
|
+
Migrating to CreateUsers (20160213101221)
|
5204
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5205
|
+
[1m[35m (30.2ms)[0m CREATE TABLE "users" ("id" serial primary key, "email" character varying, "first_name" character varying, "last_name" character varying, "profile_id" integer, "employer_id" integer, "country_code" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5206
|
+
[1m[36m (0.8ms)[0m [1mALTER TABLE "users" ADD CONSTRAINT "fk_rails_e0dbdd604c"
|
5207
|
+
FOREIGN KEY ("employer_id")
|
5208
|
+
REFERENCES "employers" ("id")
|
5209
|
+
[0m
|
5210
|
+
[1m[35m (11.0ms)[0m CREATE INDEX "index_users_on_last_name_and_first_name_and_email" ON "users" ("last_name", "first_name", "email")
|
5211
|
+
[1m[36m (16.3ms)[0m [1mCREATE INDEX "index_users_on_last_name_and_first_name" ON "users" ("last_name", "first_name")[0m
|
5212
|
+
[1m[35m (16.9ms)[0m CREATE UNIQUE INDEX "unique_index_on_users_last_name_and_first_name" ON "users" ("last_name", "first_name")
|
5213
|
+
[1m[36m (10.3ms)[0m [1mCREATE INDEX "index_users_on_last_name" ON "users" ("last_name")[0m
|
5214
|
+
[1m[35m (16.3ms)[0m CREATE INDEX "index_users_on_email" ON "users" ("email")
|
5215
|
+
[1m[36m (10.6ms)[0m [1mCREATE UNIQUE INDEX "unique_index_on_users_email" ON "users" ("email")[0m
|
5216
|
+
[1m[35m (15.9ms)[0m CREATE INDEX "index_users_on_employer_id_and_country_code" ON "users" ("employer_id", "country_code")
|
5217
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213101221"]]
|
5218
|
+
[1m[35m (8.0ms)[0m COMMIT
|
5219
|
+
Migrating to CreateProfiles (20160213101232)
|
5220
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5221
|
+
[1m[35m (30.1ms)[0m CREATE TABLE "profiles" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5222
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213101232"]]
|
5223
|
+
[1m[35m (8.3ms)[0m COMMIT
|
5224
|
+
Migrating to CreateComments (20160604081452)
|
5225
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5226
|
+
[1m[35m (32.6ms)[0m CREATE TABLE "comments" ("id" serial primary key, "commentable_id" integer, "commentable_type" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5227
|
+
[1m[36m (16.3ms)[0m [1mCREATE INDEX "index_comments_on_commentable_type_and_commentable_id" ON "comments" ("commentable_type", "commentable_id")[0m
|
5228
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160604081452"]]
|
5229
|
+
[1m[36m (8.5ms)[0m [1mCOMMIT[0m
|
5230
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5231
|
+
[1m[36m (1.4ms)[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
|
5232
|
+
FROM pg_constraint c
|
5233
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5234
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5235
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5236
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5237
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5238
|
+
WHERE c.contype = 'f'
|
5239
|
+
AND t1.relname = 'comments'
|
5240
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5241
|
+
ORDER BY c.conname
|
5242
|
+
[0m
|
5243
|
+
[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
|
5244
|
+
FROM pg_constraint c
|
5245
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5246
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5247
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5248
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5249
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5250
|
+
WHERE c.contype = 'f'
|
5251
|
+
AND t1.relname = 'employers'
|
5252
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5253
|
+
ORDER BY c.conname
|
5254
|
+
|
5255
|
+
[1m[36m (1.2ms)[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
|
5256
|
+
FROM pg_constraint c
|
5257
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5258
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5259
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5260
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5261
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5262
|
+
WHERE c.contype = 'f'
|
5263
|
+
AND t1.relname = 'profiles'
|
5264
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5265
|
+
ORDER BY c.conname
|
5266
|
+
[0m
|
5267
|
+
[1m[35m (1.3ms)[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
|
5268
|
+
FROM pg_constraint c
|
5269
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5270
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5271
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5272
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5273
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5274
|
+
WHERE c.contype = 'f'
|
5275
|
+
AND t1.relname = 'users'
|
5276
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5277
|
+
ORDER BY c.conname
|
5278
|
+
|
5279
|
+
[1m[36m (40.1ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
5280
|
+
[1m[35m (24.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
5281
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5282
|
+
Migrating to CreateProfiles (20160213101232)
|
5283
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5284
|
+
[1m[36m (30.8ms)[0m [1mCREATE TABLE "profiles" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5285
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160213101232"]]
|
5286
|
+
[1m[36m (15.9ms)[0m [1mCOMMIT[0m
|
5287
|
+
Migrating to CreateEmployers (20160213102131)
|
5288
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5289
|
+
[1m[36m (40.9ms)[0m [1mCREATE TABLE "employers" ("id" serial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5290
|
+
[1m[35m (23.9ms)[0m CREATE INDEX "index_employers_on_id" ON "employers" ("id")
|
5291
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213102131"]]
|
5292
|
+
[1m[35m (11.4ms)[0m COMMIT
|
5293
|
+
Migrating to CreateUsers (20160213103017)
|
5294
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5295
|
+
[1m[35m (33.8ms)[0m CREATE TABLE "users" ("id" serial primary key, "email" character varying, "first_name" character varying, "last_name" character varying, "profile_id" integer, "employer_id" integer, "country_code" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5296
|
+
[1m[36m (0.8ms)[0m [1mALTER TABLE "users" ADD CONSTRAINT "fk_rails_a8794354f0"
|
5297
|
+
FOREIGN KEY ("profile_id")
|
5298
|
+
REFERENCES "profiles" ("id")
|
5299
|
+
[0m
|
5300
|
+
[1m[35m (0.5ms)[0m ALTER TABLE "users" ADD CONSTRAINT "fk_rails_e0dbdd604c"
|
5301
|
+
FOREIGN KEY ("employer_id")
|
5302
|
+
REFERENCES "employers" ("id")
|
5303
|
+
|
5304
|
+
[1m[36m (18.5ms)[0m [1mCREATE INDEX "index_users_on_last_name_and_first_name_and_email" ON "users" ("last_name", "first_name", "email")[0m
|
5305
|
+
[1m[35m (31.4ms)[0m CREATE INDEX "index_users_on_last_name_and_first_name" ON "users" ("last_name", "first_name")
|
5306
|
+
[1m[36m (13.4ms)[0m [1mCREATE UNIQUE INDEX "unique_index_on_users_last_name_and_first_name" ON "users" ("last_name", "first_name")[0m
|
5307
|
+
[1m[35m (13.4ms)[0m CREATE INDEX "index_users_on_last_name" ON "users" ("last_name")
|
5308
|
+
[1m[36m (16.0ms)[0m [1mCREATE INDEX "index_users_on_email" ON "users" ("email")[0m
|
5309
|
+
[1m[35m (16.8ms)[0m CREATE UNIQUE INDEX "unique_index_on_users_email" ON "users" ("email")
|
5310
|
+
[1m[36m (10.6ms)[0m [1mCREATE INDEX "index_users_on_employer_id_and_country_code" ON "users" ("employer_id", "country_code")[0m
|
5311
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160213103017"]]
|
5312
|
+
[1m[36m (11.2ms)[0m [1mCOMMIT[0m
|
5313
|
+
Migrating to CreateComments (20160604081452)
|
5314
|
+
[1m[35m (0.2ms)[0m BEGIN
|
5315
|
+
[1m[36m (30.3ms)[0m [1mCREATE TABLE "comments" ("id" serial primary key, "commentable_id" integer, "commentable_type" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5316
|
+
[1m[35m (24.9ms)[0m CREATE INDEX "index_comments_on_commentable_type_and_commentable_id" ON "comments" ("commentable_type", "commentable_id")
|
5317
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160604081452"]]
|
5318
|
+
[1m[35m (7.8ms)[0m COMMIT
|
5319
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5320
|
+
[1m[35m (1.3ms)[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
|
5321
|
+
FROM pg_constraint c
|
5322
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5323
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5324
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5325
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5326
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5327
|
+
WHERE c.contype = 'f'
|
5328
|
+
AND t1.relname = 'comments'
|
5329
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5330
|
+
ORDER BY c.conname
|
5331
|
+
|
5332
|
+
[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
|
5333
|
+
FROM pg_constraint c
|
5334
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5335
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5336
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5337
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5338
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5339
|
+
WHERE c.contype = 'f'
|
5340
|
+
AND t1.relname = 'employers'
|
5341
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5342
|
+
ORDER BY c.conname
|
5343
|
+
[0m
|
5344
|
+
[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
|
5345
|
+
FROM pg_constraint c
|
5346
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5347
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5348
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5349
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5350
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5351
|
+
WHERE c.contype = 'f'
|
5352
|
+
AND t1.relname = 'profiles'
|
5353
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5354
|
+
ORDER BY c.conname
|
5355
|
+
|
5356
|
+
[1m[36m (1.2ms)[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
|
5357
|
+
FROM pg_constraint c
|
5358
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5359
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5360
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5361
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5362
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5363
|
+
WHERE c.contype = 'f'
|
5364
|
+
AND t1.relname = 'users'
|
5365
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5366
|
+
ORDER BY c.conname
|
5367
|
+
[0m
|
5368
|
+
[1m[36m (30.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
5369
|
+
[1m[35m (17.9ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
5370
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5371
|
+
Migrating to CreateProfiles (20160213101232)
|
5372
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5373
|
+
[1m[36m (35.5ms)[0m [1mCREATE TABLE "profiles" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5374
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160213101232"]]
|
5375
|
+
[1m[36m (10.8ms)[0m [1mCOMMIT[0m
|
5376
|
+
Migrating to CreateEmployers (20160213102131)
|
5377
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5378
|
+
[1m[36m (34.7ms)[0m [1mCREATE TABLE "employers" ("id" serial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5379
|
+
[1m[35m (10.3ms)[0m CREATE INDEX "index_employers_on_id" ON "employers" ("id")
|
5380
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213102131"]]
|
5381
|
+
[1m[35m (13.4ms)[0m COMMIT
|
5382
|
+
Migrating to CreateUsers (20160213103017)
|
5383
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5384
|
+
[1m[35m (26.8ms)[0m CREATE TABLE "users" ("id" serial primary key, "email" character varying, "first_name" character varying, "last_name" character varying, "profile_id" integer, "employer_id" integer, "country_code" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5385
|
+
[1m[36m (0.7ms)[0m [1mALTER TABLE "users" ADD CONSTRAINT "fk_rails_a8794354f0"
|
5386
|
+
FOREIGN KEY ("profile_id")
|
5387
|
+
REFERENCES "profiles" ("id")
|
5388
|
+
[0m
|
5389
|
+
[1m[35m (0.4ms)[0m ALTER TABLE "users" ADD CONSTRAINT "fk_rails_e0dbdd604c"
|
5390
|
+
FOREIGN KEY ("employer_id")
|
5391
|
+
REFERENCES "employers" ("id")
|
5392
|
+
|
5393
|
+
[1m[36m (15.8ms)[0m [1mCREATE INDEX "index_users_on_last_name_and_first_name_and_email" ON "users" ("last_name", "first_name", "email")[0m
|
5394
|
+
[1m[35m (23.4ms)[0m CREATE INDEX "index_users_on_last_name_and_first_name" ON "users" ("last_name", "first_name")
|
5395
|
+
[1m[36m (10.3ms)[0m [1mCREATE UNIQUE INDEX "unique_index_on_users_last_name_and_first_name" ON "users" ("last_name", "first_name")[0m
|
5396
|
+
[1m[35m (13.3ms)[0m CREATE INDEX "index_users_on_last_name" ON "users" ("last_name")
|
5397
|
+
[1m[36m (9.9ms)[0m [1mCREATE INDEX "index_users_on_email" ON "users" ("email")[0m
|
5398
|
+
[1m[35m (16.0ms)[0m CREATE UNIQUE INDEX "unique_index_on_users_email" ON "users" ("email")
|
5399
|
+
[1m[36m (13.2ms)[0m [1mCREATE INDEX "index_users_on_employer_id_and_country_code" ON "users" ("employer_id", "country_code")[0m
|
5400
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160213103017"]]
|
5401
|
+
[1m[36m (7.7ms)[0m [1mCOMMIT[0m
|
5402
|
+
Migrating to CreateComments (20160604081452)
|
5403
|
+
[1m[35m (0.2ms)[0m BEGIN
|
5404
|
+
[1m[36m (26.5ms)[0m [1mCREATE TABLE "comments" ("id" serial primary key, "commentable_id" integer, "commentable_type" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5405
|
+
[1m[35m (14.1ms)[0m CREATE INDEX "index_comments_on_commentable_type_and_commentable_id" ON "comments" ("commentable_type", "commentable_id")
|
5406
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160604081452"]]
|
5407
|
+
[1m[35m (8.3ms)[0m COMMIT
|
5408
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5409
|
+
[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
|
5410
|
+
FROM pg_constraint c
|
5411
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5412
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5413
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5414
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5415
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5416
|
+
WHERE c.contype = 'f'
|
5417
|
+
AND t1.relname = 'comments'
|
5418
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5419
|
+
ORDER BY c.conname
|
5420
|
+
|
5421
|
+
[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
|
5422
|
+
FROM pg_constraint c
|
5423
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5424
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5425
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5426
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5427
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5428
|
+
WHERE c.contype = 'f'
|
5429
|
+
AND t1.relname = 'employers'
|
5430
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5431
|
+
ORDER BY c.conname
|
5432
|
+
[0m
|
5433
|
+
[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
|
5434
|
+
FROM pg_constraint c
|
5435
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5436
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5437
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5438
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5439
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5440
|
+
WHERE c.contype = 'f'
|
5441
|
+
AND t1.relname = 'profiles'
|
5442
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5443
|
+
ORDER BY c.conname
|
5444
|
+
|
5445
|
+
[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
|
5446
|
+
FROM pg_constraint c
|
5447
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5448
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5449
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5450
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5451
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5452
|
+
WHERE c.contype = 'f'
|
5453
|
+
AND t1.relname = 'users'
|
5454
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5455
|
+
ORDER BY c.conname
|
5456
|
+
[0m
|
5457
|
+
[1m[36m (34.8ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
5458
|
+
[1m[35m (26.6ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
5459
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5460
|
+
Migrating to CreateEmployers (20160213101213)
|
5461
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5462
|
+
[1m[36m (36.1ms)[0m [1mCREATE TABLE "employers" ("id" serial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5463
|
+
[1m[35m (10.4ms)[0m CREATE INDEX "index_employers_on_id" ON "employers" ("id")
|
5464
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213101213"]]
|
5465
|
+
[1m[35m (16.2ms)[0m COMMIT
|
5466
|
+
Migrating to CreateUsers (20160213101221)
|
5467
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5468
|
+
[1m[35m (32.8ms)[0m CREATE TABLE "users" ("id" serial primary key, "email" character varying, "first_name" character varying, "last_name" character varying, "profile_id" integer, "employer_id" integer, "country_code" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5469
|
+
[1m[36m (0.8ms)[0m [1mALTER TABLE "users" ADD CONSTRAINT "fk_rails_e0dbdd604c"
|
5470
|
+
FOREIGN KEY ("employer_id")
|
5471
|
+
REFERENCES "employers" ("id")
|
5472
|
+
[0m
|
5473
|
+
[1m[35m (19.1ms)[0m CREATE INDEX "index_users_on_last_name_and_first_name_and_email" ON "users" ("last_name", "first_name", "email")
|
5474
|
+
[1m[36m (9.8ms)[0m [1mCREATE INDEX "index_users_on_last_name_and_first_name" ON "users" ("last_name", "first_name")[0m
|
5475
|
+
[1m[35m (16.6ms)[0m CREATE UNIQUE INDEX "unique_index_on_users_last_name_and_first_name" ON "users" ("last_name", "first_name")
|
5476
|
+
[1m[36m (13.7ms)[0m [1mCREATE INDEX "index_users_on_last_name" ON "users" ("last_name")[0m
|
5477
|
+
[1m[35m (18.7ms)[0m CREATE INDEX "index_users_on_email" ON "users" ("email")
|
5478
|
+
[1m[36m (16.3ms)[0m [1mCREATE UNIQUE INDEX "unique_index_on_users_email" ON "users" ("email")[0m
|
5479
|
+
[1m[35m (15.9ms)[0m CREATE INDEX "index_users_on_employer_id_and_country_code" ON "users" ("employer_id", "country_code")
|
5480
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213101221"]]
|
5481
|
+
[1m[35m (7.9ms)[0m COMMIT
|
5482
|
+
Migrating to CreateProfiles (20160213101232)
|
5483
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5484
|
+
[1m[35m (24.4ms)[0m CREATE TABLE "profiles" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5485
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213101232"]]
|
5486
|
+
[1m[35m (8.3ms)[0m COMMIT
|
5487
|
+
Migrating to CreateComments (20160604081452)
|
5488
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5489
|
+
[1m[35m (33.0ms)[0m CREATE TABLE "comments" ("id" serial primary key, "commentable_id" integer, "commentable_type" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5490
|
+
[1m[36m (9.9ms)[0m [1mCREATE INDEX "index_comments_on_commentable_type_and_commentable_id" ON "comments" ("commentable_type", "commentable_id")[0m
|
5491
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160604081452"]]
|
5492
|
+
[1m[36m (8.3ms)[0m [1mCOMMIT[0m
|
5493
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5494
|
+
[1m[36m (1.2ms)[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
|
5495
|
+
FROM pg_constraint c
|
5496
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5497
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5498
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5499
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5500
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5501
|
+
WHERE c.contype = 'f'
|
5502
|
+
AND t1.relname = 'comments'
|
5503
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5504
|
+
ORDER BY c.conname
|
5505
|
+
[0m
|
5506
|
+
[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
|
5507
|
+
FROM pg_constraint c
|
5508
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5509
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5510
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5511
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5512
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5513
|
+
WHERE c.contype = 'f'
|
5514
|
+
AND t1.relname = 'employers'
|
5515
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5516
|
+
ORDER BY c.conname
|
5517
|
+
|
5518
|
+
[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
|
5519
|
+
FROM pg_constraint c
|
5520
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5521
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5522
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5523
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5524
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5525
|
+
WHERE c.contype = 'f'
|
5526
|
+
AND t1.relname = 'profiles'
|
5527
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5528
|
+
ORDER BY c.conname
|
5529
|
+
[0m
|
5530
|
+
[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
|
5531
|
+
FROM pg_constraint c
|
5532
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5533
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5534
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5535
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5536
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5537
|
+
WHERE c.contype = 'f'
|
5538
|
+
AND t1.relname = 'users'
|
5539
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5540
|
+
ORDER BY c.conname
|
5541
|
+
|
5542
|
+
[1m[36m (1.5ms)[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
|
5543
|
+
FROM pg_constraint c
|
5544
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5545
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5546
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5547
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5548
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5549
|
+
WHERE c.contype = 'f'
|
5550
|
+
AND t1.relname = 'users'
|
5551
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5552
|
+
ORDER BY c.conname
|
5553
|
+
[0m
|
5554
|
+
[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
|
5555
|
+
FROM pg_constraint c
|
5556
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5557
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5558
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5559
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5560
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5561
|
+
WHERE c.contype = 'f'
|
5562
|
+
AND t1.relname = 'users'
|
5563
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5564
|
+
ORDER BY c.conname
|
5565
|
+
|
5566
|
+
[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
|
5567
|
+
FROM pg_constraint c
|
5568
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5569
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5570
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5571
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5572
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5573
|
+
WHERE c.contype = 'f'
|
5574
|
+
AND t1.relname = 'comments'
|
5575
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5576
|
+
ORDER BY c.conname
|
5577
|
+
[0m
|
5578
|
+
[1m[36m (2.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
|
5579
|
+
FROM pg_constraint c
|
5580
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5581
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5582
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5583
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5584
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5585
|
+
WHERE c.contype = 'f'
|
5586
|
+
AND t1.relname = 'users'
|
5587
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5588
|
+
ORDER BY c.conname
|
5589
|
+
[0m
|
5590
|
+
[1m[35m (1.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
|
5591
|
+
FROM pg_constraint c
|
5592
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5593
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5594
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5595
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5596
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5597
|
+
WHERE c.contype = 'f'
|
5598
|
+
AND t1.relname = 'users'
|
5599
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5600
|
+
ORDER BY c.conname
|
5601
|
+
|
5602
|
+
[1m[36m (1.2ms)[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
|
5603
|
+
FROM pg_constraint c
|
5604
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5605
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5606
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5607
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5608
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5609
|
+
WHERE c.contype = 'f'
|
5610
|
+
AND t1.relname = 'comments'
|
5611
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5612
|
+
ORDER BY c.conname
|
5613
|
+
[0m
|
5614
|
+
[1m[36m (20.1ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
5615
|
+
[1m[35m (18.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
5616
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5617
|
+
Migrating to CreateEmployers (20160213101213)
|
5618
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5619
|
+
[1m[36m (32.9ms)[0m [1mCREATE TABLE "employers" ("id" serial primary key, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) [0m
|
5620
|
+
[1m[35m (18.9ms)[0m CREATE INDEX "index_employers_on_id" ON "employers" ("id")
|
5621
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213101213"]]
|
5622
|
+
[1m[35m (2.7ms)[0m COMMIT
|
5623
|
+
Migrating to CreateUsers (20160213101221)
|
5624
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5625
|
+
[1m[35m (26.4ms)[0m CREATE TABLE "users" ("id" serial primary key, "email" character varying, "first_name" character varying, "last_name" character varying, "profile_id" integer, "employer_id" integer, "country_code" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5626
|
+
[1m[36m (1.2ms)[0m [1mALTER TABLE "users" ADD CONSTRAINT "fk_rails_e0dbdd604c"
|
5627
|
+
FOREIGN KEY ("employer_id")
|
5628
|
+
REFERENCES "employers" ("id")
|
5629
|
+
[0m
|
5630
|
+
[1m[35m (10.6ms)[0m CREATE INDEX "index_users_on_last_name_and_first_name_and_email" ON "users" ("last_name", "first_name", "email")
|
5631
|
+
[1m[36m (10.3ms)[0m [1mCREATE INDEX "index_users_on_last_name_and_first_name" ON "users" ("last_name", "first_name")[0m
|
5632
|
+
[1m[35m (10.3ms)[0m CREATE UNIQUE INDEX "unique_index_on_users_last_name_and_first_name" ON "users" ("last_name", "first_name")
|
5633
|
+
[1m[36m (15.6ms)[0m [1mCREATE INDEX "index_users_on_last_name" ON "users" ("last_name")[0m
|
5634
|
+
[1m[35m (15.7ms)[0m CREATE INDEX "index_users_on_email" ON "users" ("email")
|
5635
|
+
[1m[36m (22.6ms)[0m [1mCREATE UNIQUE INDEX "unique_index_on_users_email" ON "users" ("email")[0m
|
5636
|
+
[1m[35m (10.2ms)[0m CREATE INDEX "index_users_on_employer_id_and_country_code" ON "users" ("employer_id", "country_code")
|
5637
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213101221"]]
|
5638
|
+
[1m[35m (2.2ms)[0m COMMIT
|
5639
|
+
Migrating to CreateProfiles (20160213101232)
|
5640
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5641
|
+
[1m[35m (21.1ms)[0m CREATE TABLE "profiles" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5642
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20160213101232"]]
|
5643
|
+
[1m[35m (8.1ms)[0m COMMIT
|
5644
|
+
Migrating to CreateComments (20160604081452)
|
5645
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5646
|
+
[1m[35m (26.9ms)[0m CREATE TABLE "comments" ("id" serial primary key, "commentable_id" integer, "commentable_type" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5647
|
+
[1m[36m (15.6ms)[0m [1mCREATE INDEX "index_comments_on_commentable_type_and_commentable_id" ON "comments" ("commentable_type", "commentable_id")[0m
|
5648
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20160604081452"]]
|
5649
|
+
[1m[36m (8.0ms)[0m [1mCOMMIT[0m
|
5650
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5651
|
+
[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
|
5652
|
+
FROM pg_constraint c
|
5653
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5654
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5655
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5656
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5657
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5658
|
+
WHERE c.contype = 'f'
|
5659
|
+
AND t1.relname = 'comments'
|
5660
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5661
|
+
ORDER BY c.conname
|
5662
|
+
[0m
|
5663
|
+
[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
|
5664
|
+
FROM pg_constraint c
|
5665
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5666
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5667
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5668
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5669
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5670
|
+
WHERE c.contype = 'f'
|
5671
|
+
AND t1.relname = 'employers'
|
5672
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5673
|
+
ORDER BY c.conname
|
5674
|
+
|
5675
|
+
[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
|
5676
|
+
FROM pg_constraint c
|
5677
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5678
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5679
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5680
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5681
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5682
|
+
WHERE c.contype = 'f'
|
5683
|
+
AND t1.relname = 'profiles'
|
5684
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5685
|
+
ORDER BY c.conname
|
5686
|
+
[0m
|
5687
|
+
[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
|
5688
|
+
FROM pg_constraint c
|
5689
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
5690
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
5691
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
5692
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
5693
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
5694
|
+
WHERE c.contype = 'f'
|
5695
|
+
AND t1.relname = 'users'
|
5696
|
+
AND t3.nspname = ANY (current_schemas(false))
|
5697
|
+
ORDER BY c.conname
|
5698
|
+
|