slugs 2.0.1 → 4.0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +59 -19
  3. data/Rakefile +1 -19
  4. data/lib/generators/slugs/install/install_generator.rb +24 -0
  5. data/lib/generators/slugs/{templates/configuration.rb → install/templates/initializer.rb} +1 -1
  6. data/lib/generators/slugs/install/templates/migration.rb +15 -0
  7. data/lib/slugs.rb +7 -4
  8. data/lib/slugs/concern.rb +16 -9
  9. data/lib/slugs/configuration.rb +11 -1
  10. data/lib/slugs/extensions/action_dispatch/generator.rb +1 -0
  11. data/lib/slugs/extensions/action_dispatch/optimized_url_helper.rb +1 -0
  12. data/lib/slugs/extensions/active_record/finders.rb +27 -0
  13. data/lib/slugs/railtie.rb +10 -4
  14. data/lib/slugs/slug.rb +9 -0
  15. data/lib/slugs/version.rb +1 -1
  16. data/test/dummy/bin/bundle +1 -0
  17. data/test/dummy/bin/rails +1 -0
  18. data/test/dummy/bin/rake +1 -0
  19. data/test/dummy/bin/setup +1 -0
  20. data/test/dummy/config/database.yml.travis +2 -11
  21. data/test/dummy/config/environments/development.rb +1 -1
  22. data/test/dummy/config/environments/production.rb +1 -1
  23. data/test/dummy/config/environments/test.rb +2 -2
  24. data/test/dummy/config/initializers/slugs.rb +1 -1
  25. data/test/dummy/config/secrets.yml +2 -2
  26. data/test/dummy/db/migrate/20161016174020_create_users.rb +2 -0
  27. data/test/dummy/db/migrate/20161016174126_create_shops.rb +2 -0
  28. data/test/dummy/db/migrate/20161016174202_create_products.rb +2 -0
  29. data/test/dummy/db/migrate/20161016174225_create_categories.rb +2 -0
  30. data/test/dummy/db/migrate/20161124162802_create_slugs.rb +15 -0
  31. data/test/dummy/db/schema.rb +33 -13
  32. data/test/dummy/log/development.log +394 -30
  33. data/test/dummy/log/test.log +3017 -3978
  34. data/test/dummy/public/404.html +57 -63
  35. data/test/dummy/public/422.html +57 -63
  36. data/test/dummy/public/500.html +56 -62
  37. data/test/generator_test.rb +3 -4
  38. data/test/record_test.rb +65 -0
  39. data/test/{routes_test.rb → route_test.rb} +1 -1
  40. data/test/test_helper.rb +2 -2
  41. metadata +14 -9
  42. data/lib/generators/slugs/install_generator.rb +0 -15
  43. data/test/records_test.rb +0 -27
@@ -1,4 +1,4 @@
1
- Dummy::Application.configure do
1
+ Rails.application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # In the development environment your application's code is reloaded on
@@ -1,4 +1,4 @@
1
- Dummy::Application.configure do
1
+ Rails.application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # Code is not reloaded between requests.
@@ -1,4 +1,4 @@
1
- Dummy::Application.configure do
1
+ Rails.application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # The test environment is used exclusively to run your application's
@@ -17,7 +17,7 @@ Dummy::Application.configure do
17
17
  config.static_cache_control = 'public, max-age=3600'
18
18
 
19
19
  # Show full error reports and disable caching.
20
- config.consider_all_requests_local = true
20
+ config.consider_all_requests_local = true
21
21
  config.action_controller.perform_caching = false
22
22
 
23
23
  # Raise exceptions instead of rendering exception templates.
@@ -1,6 +1,6 @@
1
1
  Slugs.configure do |config|
2
2
 
3
- config.use_slug_proc = Proc.new do |record, params|
3
+ config.use_slug? do |record, params|
4
4
  true
5
5
  end
6
6
 
@@ -11,10 +11,10 @@
11
11
  # if you're sharing your code publicly.
12
12
 
13
13
  development:
14
- secret_key_base: 921ea9f25943669d3a4b0a6c8762cb6a97a00c42732c84b3a4c80900d4f2be79081cad03e0ec8d5d0f2f293874b2bbd04c1444e7a6d6b9147de8f4ffb3acff11
14
+ secret_key_base: 2c1c8d4cbaa726b21aa6483b7d556125f4897508e2b94f8b3ddaec675168382c9b3b6eb5a9359d2fade03f539c16ac1ef905891c2410f2fd00b83b76c1666feb
15
15
 
16
16
  test:
17
- secret_key_base: 0e085a62fbfd58069441e0eb7dd8c3d0a7035017443181a5fba2c04041a03f8d0d427216ac56a51da79125898d125bb9fb8badb48404919fe3188eb309231570
17
+ secret_key_base: 9dd531171128e7c3d11dd2c5c18c84ba43d29b677043002634a6f4d58bf2687a283b7b6dc6af741d63c3824f11fa1f858010d7c2509a932023f2ece0d3bfe6cf
18
18
 
19
19
  # Do not keep production secrets in the repository,
20
20
  # instead read values from the environment.
@@ -4,6 +4,8 @@ class CreateUsers < ActiveRecord::Migration
4
4
  t.string :first_name
5
5
  t.string :last_name
6
6
  t.string :slug
7
+
8
+ t.timestamps null: false
7
9
  end
8
10
  end
9
11
  end
@@ -3,6 +3,8 @@ class CreateShops < ActiveRecord::Migration
3
3
  create_table :shops do |t|
4
4
  t.string :name
5
5
  t.string :slug
6
+
7
+ t.timestamps null: false
6
8
  end
7
9
  end
8
10
  end
@@ -5,6 +5,8 @@ class CreateProducts < ActiveRecord::Migration
5
5
  t.integer :shop_id
6
6
  t.integer :category_id
7
7
  t.string :slug
8
+
9
+ t.timestamps null: false
8
10
  end
9
11
  end
10
12
  end
@@ -4,6 +4,8 @@ class CreateCategories < ActiveRecord::Migration
4
4
  t.string :name
5
5
  t.integer :shop_id
6
6
  t.string :slug
7
+
8
+ t.timestamps null: false
7
9
  end
8
10
  end
9
11
  end
@@ -0,0 +1,15 @@
1
+ class CreateSlugs < ActiveRecord::Migration
2
+ def change
3
+ create_table :slugs do |t|
4
+ t.integer :sluggable_id
5
+ t.string :sluggable_type
6
+ t.string :value
7
+
8
+ t.timestamps null: false
9
+ end
10
+
11
+ add_index :slugs, :sluggable_id
12
+ add_index :slugs, :sluggable_type
13
+ add_index :slugs, :value
14
+ end
15
+ end
@@ -11,33 +11,53 @@
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: 20161016174225) do
14
+ ActiveRecord::Schema.define(version: 20161124162802) do
15
15
 
16
16
  # These are extensions that must be enabled in order to support this database
17
17
  enable_extension "plpgsql"
18
18
 
19
19
  create_table "categories", force: :cascade do |t|
20
- t.string "name"
21
- t.integer "shop_id"
22
- t.string "slug"
20
+ t.string "name"
21
+ t.integer "shop_id"
22
+ t.string "slug"
23
+ t.datetime "created_at", null: false
24
+ t.datetime "updated_at", null: false
23
25
  end
24
26
 
25
27
  create_table "products", force: :cascade do |t|
26
- t.string "name"
27
- t.integer "shop_id"
28
- t.integer "category_id"
29
- t.string "slug"
28
+ t.string "name"
29
+ t.integer "shop_id"
30
+ t.integer "category_id"
31
+ t.string "slug"
32
+ t.datetime "created_at", null: false
33
+ t.datetime "updated_at", null: false
30
34
  end
31
35
 
32
36
  create_table "shops", force: :cascade do |t|
33
- t.string "name"
34
- t.string "slug"
37
+ t.string "name"
38
+ t.string "slug"
39
+ t.datetime "created_at", null: false
40
+ t.datetime "updated_at", null: false
35
41
  end
36
42
 
43
+ create_table "slugs", force: :cascade do |t|
44
+ t.integer "sluggable_id"
45
+ t.string "sluggable_type"
46
+ t.string "value"
47
+ t.datetime "created_at", null: false
48
+ t.datetime "updated_at", null: false
49
+ end
50
+
51
+ add_index "slugs", ["sluggable_id"], name: "index_slugs_on_sluggable_id", using: :btree
52
+ add_index "slugs", ["sluggable_type"], name: "index_slugs_on_sluggable_type", using: :btree
53
+ add_index "slugs", ["value"], name: "index_slugs_on_value", using: :btree
54
+
37
55
  create_table "users", force: :cascade do |t|
38
- t.string "first_name"
39
- t.string "last_name"
40
- t.string "slug"
56
+ t.string "first_name"
57
+ t.string "last_name"
58
+ t.string "slug"
59
+ t.datetime "created_at", null: false
60
+ t.datetime "updated_at", null: false
41
61
  end
42
62
 
43
63
  end
@@ -1,26 +1,26 @@
1
-  (31.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
2
-  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
1
+  (2.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
2
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
4
  Migrating to CreateUsers (20161016174020)
5
5
   (0.2ms) BEGIN
6
-  (20.8ms) CREATE TABLE "users" ("id" serial primary key, "first_name" character varying, "last_name" character varying) 
6
+  (13.6ms) CREATE TABLE "users" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
7
7
  SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174020"]]
8
-  (6.4ms) COMMIT
8
+  (5.8ms) COMMIT
9
9
  Migrating to CreateShops (20161016174126)
10
-  (6.2ms) BEGIN
11
-  (13.5ms) CREATE TABLE "shops" ("id" serial primary key, "name" character varying) 
10
+  (5.9ms) BEGIN
11
+  (19.4ms) CREATE TABLE "shops" ("id" serial primary key, "name" character varying, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
12
12
  SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174126"]]
13
-  (5.1ms) COMMIT
13
+  (0.4ms) COMMIT
14
14
  Migrating to CreateProducts (20161016174202)
15
-  (6.2ms) BEGIN
16
-  (13.9ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "shop_id" integer, "category_id" integer) 
17
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174202"]]
18
-  (0.5ms) COMMIT
15
+  (5.9ms) BEGIN
16
+  (18.3ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "shop_id" integer, "category_id" integer, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
17
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174202"]]
18
+  (1.7ms) COMMIT
19
19
  Migrating to CreateCategories (20161016174225)
20
-  (6.2ms) BEGIN
21
-  (19.3ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying, "shop_id" integer) 
22
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174225"]]
23
-  (0.4ms) COMMIT
20
+  (5.9ms) BEGIN
21
+  (43.7ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying, "shop_id" integer, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
22
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174225"]]
23
+  (0.2ms) COMMIT
24
24
  ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
25
25
   (1.7ms) 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
26
26
  FROM pg_constraint c
@@ -34,7 +34,7 @@ WHERE c.contype = 'f'
34
34
  AND t3.nspname = ANY (current_schemas(false))
35
35
  ORDER BY c.conname
36
36
  
37
-  (1.3ms) 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
37
+  (1.4ms) 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
38
38
  FROM pg_constraint c
39
39
  JOIN pg_class t1 ON c.conrelid = t1.oid
40
40
  JOIN pg_class t2 ON c.confrelid = t2.oid
@@ -71,30 +71,174 @@ WHERE c.contype = 'f'
71
71
  ORDER BY c.conname
72
72
 
73
73
   (2.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
74
-  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
74
+  (17.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
75
75
  ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
76
76
  Migrating to CreateUsers (20161016174020)
77
77
   (0.1ms) BEGIN
78
-  (2.4ms) CREATE TABLE "users" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "slug" character varying) 
78
+  (0.2ms) ROLLBACK
79
+  (2.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
80
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
81
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
82
+ Migrating to CreateUsers (20161016174020)
83
+  (0.2ms) BEGIN
84
+  (13.6ms) CREATE TABLE "users" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "slugs" jsonb DEFAULT '[]', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
79
85
  SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174020"]]
80
-  (0.5ms) COMMIT
86
+  (6.2ms) COMMIT
81
87
  Migrating to CreateShops (20161016174126)
82
-  (0.2ms) BEGIN
83
-  (1.8ms) CREATE TABLE "shops" ("id" serial primary key, "name" character varying, "slug" character varying) 
88
+  (11.3ms) BEGIN
89
+  (13.1ms) CREATE TABLE "shops" ("id" serial primary key, "name" character varying, "slugs" jsonb DEFAULT '[]', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
84
90
  SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174126"]]
85
-  (0.5ms) COMMIT
91
+  (0.3ms) COMMIT
86
92
  Migrating to CreateProducts (20161016174202)
87
-  (0.2ms) BEGIN
88
-  (1.7ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "shop_id" integer, "category_id" integer, "slug" character varying) 
93
+  (5.8ms) BEGIN
94
+  (13.1ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "shop_id" integer, "category_id" integer, "slugs" jsonb DEFAULT '[]', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
89
95
  SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174202"]]
90
-  (0.4ms) COMMIT
96
+  (4.9ms) COMMIT
91
97
  Migrating to CreateCategories (20161016174225)
98
+  (6.1ms) BEGIN
99
+  (12.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying, "shop_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
100
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174225"]]
101
+  (4.9ms) COMMIT
102
+ Migrating to AddSlugsToCategories (20161122160434)
103
+  (5.9ms) BEGIN
104
+  (19.4ms) ALTER TABLE "categories" ADD "slugs" jsonb DEFAULT '[]'
105
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161122160434"]]
106
+  (0.6ms) COMMIT
107
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
108
+  (1.8ms) 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
109
+ FROM pg_constraint c
110
+ JOIN pg_class t1 ON c.conrelid = t1.oid
111
+ JOIN pg_class t2 ON c.confrelid = t2.oid
112
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
113
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
114
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
115
+ WHERE c.contype = 'f'
116
+ AND t1.relname = 'categories'
117
+ AND t3.nspname = ANY (current_schemas(false))
118
+ ORDER BY c.conname
119
+ 
120
+  (1.2ms) 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
121
+ FROM pg_constraint c
122
+ JOIN pg_class t1 ON c.conrelid = t1.oid
123
+ JOIN pg_class t2 ON c.confrelid = t2.oid
124
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
125
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
126
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
127
+ WHERE c.contype = 'f'
128
+ AND t1.relname = 'products'
129
+ AND t3.nspname = ANY (current_schemas(false))
130
+ ORDER BY c.conname
131
+
132
+  (1.4ms) 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
133
+ FROM pg_constraint c
134
+ JOIN pg_class t1 ON c.conrelid = t1.oid
135
+ JOIN pg_class t2 ON c.confrelid = t2.oid
136
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
137
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
138
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
139
+ WHERE c.contype = 'f'
140
+ AND t1.relname = 'shops'
141
+ AND t3.nspname = ANY (current_schemas(false))
142
+ ORDER BY c.conname
143
+ 
144
+  (1.3ms) 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
145
+ FROM pg_constraint c
146
+ JOIN pg_class t1 ON c.conrelid = t1.oid
147
+ JOIN pg_class t2 ON c.confrelid = t2.oid
148
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
149
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
150
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
151
+ WHERE c.contype = 'f'
152
+ AND t1.relname = 'users'
153
+ AND t3.nspname = ANY (current_schemas(false))
154
+ ORDER BY c.conname
155
+
156
+  (13.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
157
+  (17.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
158
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
159
+ Migrating to CreateUsers (20161016174020)
92
160
   (0.2ms) BEGIN
93
-  (2.0ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying, "shop_id" integer, "slug" character varying) 
94
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174225"]]
161
+  (13.4ms) CREATE TABLE "users" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "slug" character varying, "previous_slugs" character varying[], "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
162
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174020"]]
163
+  (5.5ms) COMMIT
164
+ Migrating to CreateShops (20161016174126)
165
+  (5.8ms) BEGIN
166
+  (12.4ms) CREATE TABLE "shops" ("id" serial primary key, "name" character varying, "slug" character varying, "previous_slugs" character varying[], "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
167
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174126"]]
95
168
   (0.4ms) COMMIT
169
+ Migrating to CreateProducts (20161016174202)
170
+  (0.2ms) BEGIN
171
+  (1.9ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "shop_id" integer, "category_id" integer, "slug" character varying, "previous_slugs" character varying[], "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
172
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174202"]]
173
+  (0.3ms) COMMIT
174
+ Migrating to CreateCategories (20161016174225)
175
+  (0.2ms) BEGIN
176
+  (1.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying, "shop_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
177
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174225"]]
178
+  (0.3ms) COMMIT
179
+ Migrating to AddSlugsToCategories (20161122160434)
180
+  (0.2ms) BEGIN
181
+  (0.3ms) ALTER TABLE "categories" ADD "slug" character varying
182
+  (0.2ms) ALTER TABLE "categories" ADD "previous_slugs" character varying[]
183
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161122160434"]]
184
+  (0.2ms) COMMIT
185
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
186
+  (1.7ms) 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
187
+ FROM pg_constraint c
188
+ JOIN pg_class t1 ON c.conrelid = t1.oid
189
+ JOIN pg_class t2 ON c.confrelid = t2.oid
190
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
191
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
192
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
193
+ WHERE c.contype = 'f'
194
+ AND t1.relname = 'categories'
195
+ AND t3.nspname = ANY (current_schemas(false))
196
+ ORDER BY c.conname
197
+
198
+  (1.4ms) 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
199
+ FROM pg_constraint c
200
+ JOIN pg_class t1 ON c.conrelid = t1.oid
201
+ JOIN pg_class t2 ON c.confrelid = t2.oid
202
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
203
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
204
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
205
+ WHERE c.contype = 'f'
206
+ AND t1.relname = 'products'
207
+ AND t3.nspname = ANY (current_schemas(false))
208
+ ORDER BY c.conname
209
+ 
210
+  (1.2ms) 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
211
+ FROM pg_constraint c
212
+ JOIN pg_class t1 ON c.conrelid = t1.oid
213
+ JOIN pg_class t2 ON c.confrelid = t2.oid
214
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
215
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
216
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
217
+ WHERE c.contype = 'f'
218
+ AND t1.relname = 'shops'
219
+ AND t3.nspname = ANY (current_schemas(false))
220
+ ORDER BY c.conname
221
+
222
+  (1.2ms) 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
223
+ FROM pg_constraint c
224
+ JOIN pg_class t1 ON c.conrelid = t1.oid
225
+ JOIN pg_class t2 ON c.confrelid = t2.oid
226
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
227
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
228
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
229
+ WHERE c.contype = 'f'
230
+ AND t1.relname = 'users'
231
+ AND t3.nspname = ANY (current_schemas(false))
232
+ ORDER BY c.conname
233
+ 
234
+ ActiveRecord::SchemaMigration Load (6.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
235
+ Migrating to CreateSlugs (20161124162802)
236
+  (0.2ms) BEGIN
237
+  (25.1ms) CREATE TABLE "slugs" ("id" serial primary key, "sluggable_id" integer, "sluggable_type" character varying, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
238
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161124162802"]]
239
+  (7.0ms) COMMIT
96
240
  ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
97
-  (2.2ms) 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
241
+  (1.7ms) 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
98
242
  FROM pg_constraint c
99
243
  JOIN pg_class t1 ON c.conrelid = t1.oid
100
244
  JOIN pg_class t2 ON c.confrelid = t2.oid
@@ -106,7 +250,7 @@ WHERE c.contype = 'f'
106
250
  AND t3.nspname = ANY (current_schemas(false))
107
251
  ORDER BY c.conname
108
252
  
109
-  (1.4ms) 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
253
+  (1.5ms) 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
110
254
  FROM pg_constraint c
111
255
  JOIN pg_class t1 ON c.conrelid = t1.oid
112
256
  JOIN pg_class t2 ON c.confrelid = t2.oid
@@ -129,6 +273,226 @@ WHERE c.contype = 'f'
129
273
  AND t1.relname = 'shops'
130
274
  AND t3.nspname = ANY (current_schemas(false))
131
275
  ORDER BY c.conname
276
+ 
277
+  (1.2ms) 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
278
+ FROM pg_constraint c
279
+ JOIN pg_class t1 ON c.conrelid = t1.oid
280
+ JOIN pg_class t2 ON c.confrelid = t2.oid
281
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
282
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
283
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
284
+ WHERE c.contype = 'f'
285
+ AND t1.relname = 'slugs'
286
+ AND t3.nspname = ANY (current_schemas(false))
287
+ ORDER BY c.conname
288
+
289
+  (1.2ms) 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
290
+ FROM pg_constraint c
291
+ JOIN pg_class t1 ON c.conrelid = t1.oid
292
+ JOIN pg_class t2 ON c.confrelid = t2.oid
293
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
294
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
295
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
296
+ WHERE c.contype = 'f'
297
+ AND t1.relname = 'users'
298
+ AND t3.nspname = ANY (current_schemas(false))
299
+ ORDER BY c.conname
300
+ 
301
+ Product Load (2.0ms) SELECT "products".* FROM "products" ORDER BY "products"."id" ASC LIMIT 1
302
+  (24.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
303
+  (16.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
304
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
305
+ Migrating to CreateUsers (20161016174020)
306
+  (0.2ms) BEGIN
307
+  (13.8ms) CREATE TABLE "users" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
308
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174020"]]
309
+  (16.5ms) COMMIT
310
+ Migrating to CreateShops (20161016174126)
311
+  (6.1ms) BEGIN
312
+  (3.1ms) CREATE TABLE "shops" ("id" serial primary key, "name" character varying, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
313
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174126"]]
314
+  (0.4ms) COMMIT
315
+ Migrating to CreateProducts (20161016174202)
316
+  (0.3ms) BEGIN
317
+  (2.0ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "shop_id" integer, "category_id" integer, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
318
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174202"]]
319
+  (1.3ms) COMMIT
320
+ Migrating to CreateCategories (20161016174225)
321
+  (0.2ms) BEGIN
322
+  (3.9ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying, "shop_id" integer, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
323
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174225"]]
324
+  (0.3ms) COMMIT
325
+ Migrating to CreateSlugs (20161124162802)
326
+  (6.2ms) CREATE INDEX "index_slugs_on_sluggable_id" ON "slugs" ("sluggable_id")
327
+  (0.2ms) CREATE INDEX "index_slugs_on_sluggable_id" ON "slugs" ("sluggable_id")
328
+  (24.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
329
+  (18.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
330
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
331
+ Migrating to CreateUsers (20161016174020)
332
+  (0.2ms) BEGIN
333
+  (13.9ms) CREATE TABLE "users" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
334
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174020"]]
335
+  (5.9ms) COMMIT
336
+ Migrating to CreateShops (20161016174126)
337
+  (5.9ms) BEGIN
338
+  (12.3ms) CREATE TABLE "shops" ("id" serial primary key, "name" character varying, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
339
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174126"]]
340
+  (0.3ms) COMMIT
341
+ Migrating to CreateProducts (20161016174202)
342
+  (0.2ms) BEGIN
343
+  (1.8ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "shop_id" integer, "category_id" integer, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
344
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174202"]]
345
+  (0.3ms) COMMIT
346
+ Migrating to CreateCategories (20161016174225)
347
+  (0.2ms) BEGIN
348
+  (1.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying, "shop_id" integer, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
349
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174225"]]
350
+  (0.3ms) COMMIT
351
+ Migrating to CreateSlugs (20161124162802)
352
+  (0.2ms) BEGIN
353
+  (1.8ms) CREATE TABLE "slugs" ("id" serial primary key, "sluggable_id" integer, "sluggable_type" character varying, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
354
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161124162802"]]
355
+  (0.3ms) COMMIT
356
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
357
+  (1.8ms) 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
358
+ FROM pg_constraint c
359
+ JOIN pg_class t1 ON c.conrelid = t1.oid
360
+ JOIN pg_class t2 ON c.confrelid = t2.oid
361
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
362
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
363
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
364
+ WHERE c.contype = 'f'
365
+ AND t1.relname = 'categories'
366
+ AND t3.nspname = ANY (current_schemas(false))
367
+ ORDER BY c.conname
368
+ 
369
+  (1.5ms) 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
370
+ FROM pg_constraint c
371
+ JOIN pg_class t1 ON c.conrelid = t1.oid
372
+ JOIN pg_class t2 ON c.confrelid = t2.oid
373
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
374
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
375
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
376
+ WHERE c.contype = 'f'
377
+ AND t1.relname = 'products'
378
+ AND t3.nspname = ANY (current_schemas(false))
379
+ ORDER BY c.conname
380
+
381
+  (2.5ms) 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
382
+ FROM pg_constraint c
383
+ JOIN pg_class t1 ON c.conrelid = t1.oid
384
+ JOIN pg_class t2 ON c.confrelid = t2.oid
385
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
386
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
387
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
388
+ WHERE c.contype = 'f'
389
+ AND t1.relname = 'shops'
390
+ AND t3.nspname = ANY (current_schemas(false))
391
+ ORDER BY c.conname
392
+ 
393
+  (1.3ms) 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
394
+ FROM pg_constraint c
395
+ JOIN pg_class t1 ON c.conrelid = t1.oid
396
+ JOIN pg_class t2 ON c.confrelid = t2.oid
397
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
398
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
399
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
400
+ WHERE c.contype = 'f'
401
+ AND t1.relname = 'slugs'
402
+ AND t3.nspname = ANY (current_schemas(false))
403
+ ORDER BY c.conname
404
+
405
+  (1.3ms) 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
406
+ FROM pg_constraint c
407
+ JOIN pg_class t1 ON c.conrelid = t1.oid
408
+ JOIN pg_class t2 ON c.confrelid = t2.oid
409
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
410
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
411
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
412
+ WHERE c.contype = 'f'
413
+ AND t1.relname = 'users'
414
+ AND t3.nspname = ANY (current_schemas(false))
415
+ ORDER BY c.conname
416
+ 
417
+  (2.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
418
+  (17.6ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
419
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
420
+ Migrating to CreateUsers (20161016174020)
421
+  (0.2ms) BEGIN
422
+  (12.7ms) CREATE TABLE "users" ("id" serial primary key, "first_name" character varying, "last_name" character varying, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
423
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174020"]]
424
+  (5.9ms) COMMIT
425
+ Migrating to CreateShops (20161016174126)
426
+  (5.9ms) BEGIN
427
+  (12.6ms) CREATE TABLE "shops" ("id" serial primary key, "name" character varying, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
428
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174126"]]
429
+  (0.3ms) COMMIT
430
+ Migrating to CreateProducts (20161016174202)
431
+  (0.2ms) BEGIN
432
+  (10.6ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "shop_id" integer, "category_id" integer, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
433
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174202"]]
434
+  (5.9ms) COMMIT
435
+ Migrating to CreateCategories (20161016174225)
436
+  (5.9ms) BEGIN
437
+  (6.6ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying, "shop_id" integer, "slug" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
438
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161016174225"]]
439
+  (0.3ms) COMMIT
440
+ Migrating to CreateSlugs (20161124162802)
441
+  (5.5ms) BEGIN
442
+  (13.5ms) CREATE TABLE "slugs" ("id" serial primary key, "sluggable_id" integer, "sluggable_type" character varying, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
443
+  (5.1ms) CREATE INDEX "index_slugs_on_sluggable_id" ON "slugs" ("sluggable_id")
444
+  (0.5ms) CREATE INDEX "index_slugs_on_sluggable_type" ON "slugs" ("sluggable_type")
445
+  (1.2ms) CREATE INDEX "index_slugs_on_value" ON "slugs" ("value")
446
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161124162802"]]
447
+  (0.4ms) COMMIT
448
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
449
+  (1.7ms) 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
450
+ FROM pg_constraint c
451
+ JOIN pg_class t1 ON c.conrelid = t1.oid
452
+ JOIN pg_class t2 ON c.confrelid = t2.oid
453
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
454
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
455
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
456
+ WHERE c.contype = 'f'
457
+ AND t1.relname = 'categories'
458
+ AND t3.nspname = ANY (current_schemas(false))
459
+ ORDER BY c.conname
460
+
461
+  (1.3ms) 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
462
+ FROM pg_constraint c
463
+ JOIN pg_class t1 ON c.conrelid = t1.oid
464
+ JOIN pg_class t2 ON c.confrelid = t2.oid
465
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
466
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
467
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
468
+ WHERE c.contype = 'f'
469
+ AND t1.relname = 'products'
470
+ AND t3.nspname = ANY (current_schemas(false))
471
+ ORDER BY c.conname
472
+ 
473
+  (1.3ms) 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
474
+ FROM pg_constraint c
475
+ JOIN pg_class t1 ON c.conrelid = t1.oid
476
+ JOIN pg_class t2 ON c.confrelid = t2.oid
477
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
478
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
479
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
480
+ WHERE c.contype = 'f'
481
+ AND t1.relname = 'shops'
482
+ AND t3.nspname = ANY (current_schemas(false))
483
+ ORDER BY c.conname
484
+
485
+  (1.4ms) 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
486
+ FROM pg_constraint c
487
+ JOIN pg_class t1 ON c.conrelid = t1.oid
488
+ JOIN pg_class t2 ON c.confrelid = t2.oid
489
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
490
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
491
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
492
+ WHERE c.contype = 'f'
493
+ AND t1.relname = 'slugs'
494
+ AND t3.nspname = ANY (current_schemas(false))
495
+ ORDER BY c.conname
132
496
  
133
497
   (1.3ms) 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
134
498
  FROM pg_constraint c