openstax_accounts 7.12.0 → 7.13.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3b938361f8924432c5331e3a38b2caee1418ed89
4
- data.tar.gz: bb41f3f50ba7a36b5a0d82a30ccedbead6934dea
2
+ SHA256:
3
+ metadata.gz: 63f92ee3ec16b3bfa98971c5eb4c7f0fe7e6aa6c9ab55c1a8aaa9987f61adf90
4
+ data.tar.gz: fcf45cbfaf4ddd1108043729a57d0823b994752556762e547aedeeb8af3eeaeb
5
5
  SHA512:
6
- metadata.gz: c341dc0063e4ea88809dd2462bb396a3a91ea0ab0106b421bb223b29d200af7afb7b13681f0c60d43875dd45ae73757349bdc4cdd8519e9ea581bd48e14a926c
7
- data.tar.gz: 18cf4ab2b617bc8fe6f3360e0165694f8baed11e190a8b3cdeac677bf795e1cb78e00fb9d842513a6932ffec96206d273a534a4a2f025eec4198903f5b29862f
6
+ metadata.gz: e23bcba422c20b646574efac818a710df0921dd4c032d1cf653750dce39abbd59833575efbeb25ef02e15f9857aa7c7da0e46e6799040d06c38c0c333a0e1cfb
7
+ data.tar.gz: 2907f10d08578f208ca96064d11ff3d1b857a74d50355e1b92a339edff48f57b5f83ad3f2659f9603cb108f62346bf584cb5b86151ce76c1cdf2804cbb48d595
@@ -44,6 +44,12 @@ module OpenStax
44
44
  account.role = :unknown_role
45
45
  end
46
46
 
47
+ begin
48
+ account.school_type = raw_info['school_type'] || :unknown_school_type
49
+ rescue ArgumentError => ee
50
+ account.school_type = :unknown_school_type
51
+ end
52
+
47
53
  account.uuid = raw_info['uuid']
48
54
  account.support_identifier = raw_info['support_identifier']
49
55
  account.is_test = raw_info['is_test']
@@ -21,12 +21,10 @@ module OpenStax::Accounts
21
21
  has_many :groups_as_member, through: :group_members, source: :group
22
22
 
23
23
  enum faculty_status: [:no_faculty_info, :pending_faculty, :confirmed_faculty, :rejected_faculty]
24
-
25
- after_initialize :set_default_faculty_status
26
- validates :faculty_status, presence: true
27
-
28
24
  enum role: [:unknown_role, :student, :instructor, :administrator, :librarian, :designer, :other]
29
- validates :role, presence: true
25
+ enum school_type: [:unknown_school_type, :other_school_type, :college]
26
+
27
+ validates :faculty_status, :role, :school_type, presence: true
30
28
 
31
29
  validates :openstax_uid, uniqueness: { allow_nil: true }
32
30
  validates :username, uniqueness: { allow_nil: true }
@@ -57,10 +55,6 @@ module OpenStax::Accounts
57
55
 
58
56
  protected
59
57
 
60
- def set_default_faculty_status
61
- self.faculty_status ||= :no_faculty_info
62
- end
63
-
64
58
  def syncing_or_stubbing?
65
59
  syncing || OpenStax::Accounts.configuration.enable_stubbing?
66
60
  end
@@ -11,7 +11,7 @@ module OpenStax
11
11
  # Do not use it in create/update APIs!
12
12
 
13
13
  # Otherwise, this representer can be used directly or subclassed
14
- # for an object that delegates openstax_uid, username, first_name, last_name, full_name, # title, faculty_status and salesforce_contact_id to an account
14
+ # for an object that delegates openstax_uid, username, first_name, last_name, full_name, # title, faculty_status, role, school_type and salesforce_contact_id to an account
15
15
 
16
16
  include Roar::JSON
17
17
 
@@ -78,6 +78,14 @@ module OpenStax
78
78
  required: true
79
79
  }
80
80
 
81
+ property :school_type,
82
+ type: String,
83
+ schema_info: {
84
+ description: "One of #{
85
+ OpenStax::Accounts::Account.school_types.keys.map(&:to_s).inspect
86
+ }"
87
+ }
88
+
81
89
  property :uuid,
82
90
  type: String,
83
91
  schema_info: {
@@ -8,7 +8,7 @@ module OpenStax
8
8
 
9
9
  def exec(email: nil, username: nil, password: nil,
10
10
  first_name: nil, last_name: nil, full_name: nil, title: nil,
11
- salesforce_contact_id: nil, faculty_status: nil, role: nil)
11
+ salesforce_contact_id: nil, faculty_status: nil, role: nil, school_type: nil)
12
12
  raise ArgumentError,
13
13
  'You must specify either an email address or a username (and an optional password)' \
14
14
  if email.nil? && username.nil?
@@ -24,7 +24,7 @@ module OpenStax
24
24
  email: email, username: username, password: password,
25
25
  first_name: first_name, last_name: last_name, full_name: full_name,
26
26
  salesforce_contact_id: salesforce_contact_id, faculty_status: faculty_status,
27
- role: role)
27
+ role: role, school_type: school_type)
28
28
  fatal_error(code: :invalid_inputs) unless (200..202).include?(response.status)
29
29
 
30
30
  struct = OpenStruct.new
@@ -49,6 +49,7 @@ module OpenStax
49
49
  account.salesforce_contact_id = salesforce_contact_id
50
50
  account.faculty_status = faculty_status || :no_faculty_info
51
51
  account.role = role || :unknown_role
52
+ account.school_type = school_type || :unknown_school_type
52
53
  account.uuid = uuid
53
54
  account.support_identifier = support_identifier
54
55
  account.is_test = is_test
@@ -8,8 +8,8 @@ module OpenStax
8
8
  class SyncAccounts
9
9
 
10
10
  SYNC_ATTRIBUTES = [
11
- 'username', 'first_name', 'last_name', 'full_name', 'title', 'role',
12
- 'faculty_status', 'salesforce_contact_id', 'uuid', 'support_identifier', 'is_test'
11
+ 'username', 'first_name', 'last_name', 'full_name', 'title', 'role', 'faculty_status',
12
+ 'school_type', 'salesforce_contact_id', 'uuid', 'support_identifier', 'is_test'
13
13
  ]
14
14
 
15
15
  lev_routine transaction: :no_transaction
@@ -0,0 +1,6 @@
1
+ class AddSchoolTypeToAccountsAccounts < ActiveRecord::Migration
2
+ def change
3
+ add_column :openstax_accounts_accounts, :school_type, :integer, null: false, default: 0
4
+ add_index :openstax_accounts_accounts, :school_type
5
+ end
6
+ end
@@ -1,5 +1,5 @@
1
1
  module OpenStax
2
2
  module Accounts
3
- VERSION = "7.12.0"
3
+ VERSION = "7.13.0"
4
4
  end
5
5
  end
@@ -54,7 +54,7 @@ http_interactions:
54
54
  uri: http://localhost:2999/api/user/find-or-create
55
55
  body:
56
56
  encoding: UTF-8
57
- string: '{"email":"alice@example.com","username":null,"password":null,"first_name":null,"last_name":null,"full_name":null,"salesforce_contact_id":null,"faculty_status":null,"role":null}'
57
+ string: '{"email":"alice@example.com","username":null,"password":null,"first_name":null,"last_name":null,"full_name":null,"salesforce_contact_id":null,"faculty_status":null,"role":null,"school_type":null}'
58
58
  headers:
59
59
  User-Agent:
60
60
  - Faraday v0.9.2
@@ -154,7 +154,7 @@ http_interactions:
154
154
  uri: http://localhost:2999/api/user/find-or-create
155
155
  body:
156
156
  encoding: UTF-8
157
- string: '{"email":null,"username":"alice","password":null,"first_name":null,"last_name":null,"full_name":null,"salesforce_contact_id":null,"faculty_status":null,"role":null}'
157
+ string: '{"email":null,"username":"alice","password":null,"first_name":null,"last_name":null,"full_name":null,"salesforce_contact_id":null,"faculty_status":null,"role":null,"school_type":null}'
158
158
  headers:
159
159
  User-Agent:
160
160
  - Faraday v0.9.2
@@ -254,7 +254,7 @@ http_interactions:
254
254
  uri: http://localhost:2999/api/user/find-or-create
255
255
  body:
256
256
  encoding: UTF-8
257
- string: '{"email":null,"username":"alice2","password":"abcdefghijklmnop","first_name":null,"last_name":null,"full_name":null,"salesforce_contact_id":null,"faculty_status":null,"role":null}'
257
+ string: '{"email":null,"username":"alice2","password":"abcdefghijklmnop","first_name":null,"last_name":null,"full_name":null,"salesforce_contact_id":null,"faculty_status":null,"role":null,"school_type":null}'
258
258
  headers:
259
259
  User-Agent:
260
260
  - Faraday v0.9.2
@@ -34,6 +34,7 @@ ActiveRecord::Schema.define(version: 1001) do
34
34
  t.integer "role", default: 0, null: false
35
35
  t.citext "support_identifier"
36
36
  t.boolean "is_test"
37
+ t.integer "school_type", default: 0, null: false
37
38
  end
38
39
 
39
40
  add_index "openstax_accounts_accounts", ["access_token"], name: "index_openstax_accounts_accounts_on_access_token", unique: true, using: :btree
@@ -44,6 +45,7 @@ ActiveRecord::Schema.define(version: 1001) do
44
45
  add_index "openstax_accounts_accounts", ["openstax_uid"], name: "index_openstax_accounts_accounts_on_openstax_uid", unique: true, using: :btree
45
46
  add_index "openstax_accounts_accounts", ["role"], name: "index_openstax_accounts_accounts_on_role", using: :btree
46
47
  add_index "openstax_accounts_accounts", ["salesforce_contact_id"], name: "index_openstax_accounts_accounts_on_salesforce_contact_id", using: :btree
48
+ add_index "openstax_accounts_accounts", ["school_type"], name: "index_openstax_accounts_accounts_on_school_type", using: :btree
47
49
  add_index "openstax_accounts_accounts", ["support_identifier"], name: "index_openstax_accounts_accounts_on_support_identifier", unique: true, using: :btree
48
50
  add_index "openstax_accounts_accounts", ["username"], name: "index_openstax_accounts_accounts_on_username", unique: true, using: :btree
49
51
  add_index "openstax_accounts_accounts", ["uuid"], name: "index_openstax_accounts_accounts_on_uuid", unique: true, using: :btree
@@ -4738,3 +4738,400 @@ WHERE c.contype = 'f'
4738
4738
  ORDER BY c.conname
4739
4739
  
4740
4740
  ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
4741
+  (14.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
4742
+  (13.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4743
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
4744
+ Migrating to CreateOpenStaxAccountsAccounts (0)
4745
+  (0.2ms) BEGIN
4746
+  (16.7ms) CREATE TABLE "openstax_accounts_accounts" ("id" serial primary key, "openstax_uid" integer NOT NULL, "username" character varying NOT NULL, "access_token" character varying, "first_name" character varying, "last_name" character varying, "full_name" character varying, "title" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
4747
+  (6.0ms) CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_openstax_uid" ON "openstax_accounts_accounts" ("openstax_uid")
4748
+  (1.2ms) CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_username" ON "openstax_accounts_accounts" ("username")
4749
+  (1.1ms) CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_access_token" ON "openstax_accounts_accounts" ("access_token")
4750
+  (1.0ms) CREATE INDEX "index_openstax_accounts_accounts_on_first_name" ON "openstax_accounts_accounts" ("first_name")
4751
+  (0.9ms) CREATE INDEX "index_openstax_accounts_accounts_on_last_name" ON "openstax_accounts_accounts" ("last_name")
4752
+  (0.9ms) CREATE INDEX "index_openstax_accounts_accounts_on_full_name" ON "openstax_accounts_accounts" ("full_name")
4753
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "0"]]
4754
+  (0.6ms) COMMIT
4755
+ Migrating to CreateOpenStaxAccountsGroups (1)
4756
+  (0.2ms) BEGIN
4757
+  (2.4ms) CREATE TABLE "openstax_accounts_groups" ("id" serial primary key, "openstax_uid" integer NOT NULL, "is_public" boolean DEFAULT 'f' NOT NULL, "name" character varying, "cached_subtree_group_ids" text, "cached_supertree_group_ids" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
4758
+  (0.8ms) CREATE UNIQUE INDEX "index_openstax_accounts_groups_on_openstax_uid" ON "openstax_accounts_groups" ("openstax_uid")
4759
+  (0.8ms) CREATE INDEX "index_openstax_accounts_groups_on_is_public" ON "openstax_accounts_groups" ("is_public")
4760
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "1"]]
4761
+  (0.4ms) COMMIT
4762
+ Migrating to CreateOpenStaxAccountsGroupMembers (2)
4763
+  (0.2ms) BEGIN
4764
+  (1.6ms) CREATE TABLE "openstax_accounts_group_members" ("id" serial primary key, "group_id" integer NOT NULL, "user_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
4765
+  (0.8ms) CREATE UNIQUE INDEX "index_openstax_accounts_group_members_on_group_id_and_user_id" ON "openstax_accounts_group_members" ("group_id", "user_id")
4766
+  (0.7ms) CREATE INDEX "index_openstax_accounts_group_members_on_user_id" ON "openstax_accounts_group_members" ("user_id")
4767
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "2"]]
4768
+  (0.4ms) COMMIT
4769
+ Migrating to CreateOpenStaxAccountsGroupOwners (3)
4770
+  (0.2ms) BEGIN
4771
+  (1.8ms) CREATE TABLE "openstax_accounts_group_owners" ("id" serial primary key, "group_id" integer NOT NULL, "user_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
4772
+  (0.7ms) CREATE UNIQUE INDEX "index_openstax_accounts_group_owners_on_group_id_and_user_id" ON "openstax_accounts_group_owners" ("group_id", "user_id")
4773
+  (0.7ms) CREATE INDEX "index_openstax_accounts_group_owners_on_user_id" ON "openstax_accounts_group_owners" ("user_id")
4774
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "3"]]
4775
+  (0.4ms) COMMIT
4776
+ Migrating to CreateOpenStaxAccountsGroupNestings (4)
4777
+  (0.3ms) BEGIN
4778
+  (2.2ms) CREATE TABLE "openstax_accounts_group_nestings" ("id" serial primary key, "member_group_id" integer NOT NULL, "container_group_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
4779
+  (0.7ms) CREATE UNIQUE INDEX "index_openstax_accounts_group_nestings_on_member_group_id" ON "openstax_accounts_group_nestings" ("member_group_id")
4780
+  (0.7ms) CREATE INDEX "index_openstax_accounts_group_nestings_on_container_group_id" ON "openstax_accounts_group_nestings" ("container_group_id")
4781
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "4"]]
4782
+  (0.4ms) COMMIT
4783
+ Migrating to AddFacultyStatusToAccountsAccounts (5)
4784
+  (0.2ms) BEGIN
4785
+  (6.0ms) ALTER TABLE "openstax_accounts_accounts" ADD "faculty_status" integer DEFAULT 0 NOT NULL
4786
+  (1.0ms) CREATE INDEX "index_openstax_accounts_accounts_on_faculty_status" ON "openstax_accounts_accounts" ("faculty_status")
4787
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "5"]]
4788
+  (1.6ms) COMMIT
4789
+ Migrating to AddSalesforceContactIdToAccountsAccounts (6)
4790
+  (0.1ms) BEGIN
4791
+  (0.3ms) ALTER TABLE "openstax_accounts_accounts" ADD "salesforce_contact_id" character varying
4792
+  (0.9ms) CREATE INDEX "index_openstax_accounts_accounts_on_salesforce_contact_id" ON "openstax_accounts_accounts" ("salesforce_contact_id")
4793
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "6"]]
4794
+  (0.4ms) COMMIT
4795
+ Migrating to ChangeAccountsOpenStaxUidToBeNullable (7)
4796
+  (0.1ms) BEGIN
4797
+  (0.2ms) ALTER TABLE "openstax_accounts_accounts" ALTER "openstax_uid" DROP NOT NULL
4798
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "7"]]
4799
+  (0.4ms) COMMIT
4800
+ Migrating to ChangeAccountsUsernameToBeNullable (8)
4801
+  (0.1ms) BEGIN
4802
+  (0.2ms) ALTER TABLE "openstax_accounts_accounts" ALTER "username" DROP NOT NULL
4803
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "8"]]
4804
+  (0.3ms) COMMIT
4805
+ Migrating to AddUuidAndRoleToAccountsAccounts (9)
4806
+  (0.1ms) BEGIN
4807
+  (0.3ms) ALTER TABLE "openstax_accounts_accounts" ADD "uuid" character varying
4808
+  (1.0ms) CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_uuid" ON "openstax_accounts_accounts" ("uuid")
4809
+  (7.0ms) ALTER TABLE "openstax_accounts_accounts" ADD "role" integer DEFAULT 0 NOT NULL
4810
+  (0.7ms) CREATE INDEX "index_openstax_accounts_accounts_on_role" ON "openstax_accounts_accounts" ("role")
4811
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "9"]]
4812
+  (1.8ms) COMMIT
4813
+ Migrating to AssignMissingUuidsForLocalAccounts (10)
4814
+  (0.1ms) BEGIN
4815
+ SQL (5.5ms) CREATE EXTENSION IF NOT EXISTS "pgcrypto"
4816
+ SQL (0.8ms) UPDATE "openstax_accounts_accounts" SET "uuid" = gen_random_uuid() WHERE "openstax_accounts_accounts"."uuid" IS NULL
4817
+  (27.6ms) ALTER TABLE "openstax_accounts_accounts" ALTER COLUMN "uuid" TYPE uuid USING uuid::uuid
4818
+  (0.3ms) ALTER TABLE "openstax_accounts_accounts" ALTER COLUMN "uuid" SET DEFAULT gen_random_uuid()
4819
+  (0.5ms) UPDATE "openstax_accounts_accounts" SET "uuid"=gen_random_uuid() WHERE "uuid" IS NULL
4820
+  (0.2ms) ALTER TABLE "openstax_accounts_accounts" ALTER "uuid" SET NOT NULL
4821
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "10"]]
4822
+  (2.5ms) COMMIT
4823
+ Migrating to AddSupportIdentifierToAccountsAccounts (11)
4824
+  (0.2ms) BEGIN
4825
+ SQL (10.7ms) CREATE EXTENSION IF NOT EXISTS "citext"
4826
+  (0.3ms) ALTER TABLE "openstax_accounts_accounts" ADD "support_identifier" citext
4827
+  (1.0ms) CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_support_identifier" ON "openstax_accounts_accounts" ("support_identifier")
4828
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "11"]]
4829
+  (0.6ms) COMMIT
4830
+ Migrating to AddIsTestToAccountsAccounts (12)
4831
+  (0.1ms) BEGIN
4832
+  (0.2ms) ALTER TABLE "openstax_accounts_accounts" ADD "is_test" boolean
4833
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "12"]]
4834
+  (0.4ms) COMMIT
4835
+ Migrating to AddSchoolTypeToAccountsAccounts (13)
4836
+  (0.1ms) BEGIN
4837
+  (8.3ms) ALTER TABLE "openstax_accounts_accounts" ADD "school_type" integer DEFAULT 0 NOT NULL
4838
+  (0.8ms) CREATE INDEX "index_openstax_accounts_accounts_on_school_type" ON "openstax_accounts_accounts" ("school_type")
4839
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "13"]]
4840
+  (2.1ms) COMMIT
4841
+ Migrating to CreateUsers (1000)
4842
+  (0.1ms) BEGIN
4843
+  (1.5ms) CREATE TABLE "users" ("id" serial primary key, "account_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
4844
+  (0.7ms) CREATE UNIQUE INDEX "index_users_on_account_id" ON "users" ("account_id")
4845
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "1000"]]
4846
+  (0.4ms) COMMIT
4847
+ Migrating to CreateOwnerships (1001)
4848
+  (0.2ms) BEGIN
4849
+  (2.4ms) CREATE TABLE "ownerships" ("id" serial primary key, "owner_id" integer NOT NULL, "owner_type" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
4850
+  (1.0ms) CREATE UNIQUE INDEX "index_ownerships_on_owner_id_and_owner_type" ON "ownerships" ("owner_id", "owner_type")
4851
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "1001"]]
4852
+  (0.4ms) COMMIT
4853
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
4854
+  (1.9ms) 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
4855
+ FROM pg_constraint c
4856
+ JOIN pg_class t1 ON c.conrelid = t1.oid
4857
+ JOIN pg_class t2 ON c.confrelid = t2.oid
4858
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
4859
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
4860
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
4861
+ WHERE c.contype = 'f'
4862
+ AND t1.relname = 'openstax_accounts_accounts'
4863
+ AND t3.nspname = ANY (current_schemas(false))
4864
+ ORDER BY c.conname
4865
+
4866
+  (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
4867
+ FROM pg_constraint c
4868
+ JOIN pg_class t1 ON c.conrelid = t1.oid
4869
+ JOIN pg_class t2 ON c.confrelid = t2.oid
4870
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
4871
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
4872
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
4873
+ WHERE c.contype = 'f'
4874
+ AND t1.relname = 'openstax_accounts_group_members'
4875
+ AND t3.nspname = ANY (current_schemas(false))
4876
+ ORDER BY c.conname
4877
+ 
4878
+  (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
4879
+ FROM pg_constraint c
4880
+ JOIN pg_class t1 ON c.conrelid = t1.oid
4881
+ JOIN pg_class t2 ON c.confrelid = t2.oid
4882
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
4883
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
4884
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
4885
+ WHERE c.contype = 'f'
4886
+ AND t1.relname = 'openstax_accounts_group_nestings'
4887
+ AND t3.nspname = ANY (current_schemas(false))
4888
+ ORDER BY c.conname
4889
+
4890
+  (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
4891
+ FROM pg_constraint c
4892
+ JOIN pg_class t1 ON c.conrelid = t1.oid
4893
+ JOIN pg_class t2 ON c.confrelid = t2.oid
4894
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
4895
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
4896
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
4897
+ WHERE c.contype = 'f'
4898
+ AND t1.relname = 'openstax_accounts_group_owners'
4899
+ AND t3.nspname = ANY (current_schemas(false))
4900
+ ORDER BY c.conname
4901
+ 
4902
+  (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
4903
+ FROM pg_constraint c
4904
+ JOIN pg_class t1 ON c.conrelid = t1.oid
4905
+ JOIN pg_class t2 ON c.confrelid = t2.oid
4906
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
4907
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
4908
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
4909
+ WHERE c.contype = 'f'
4910
+ AND t1.relname = 'openstax_accounts_groups'
4911
+ AND t3.nspname = ANY (current_schemas(false))
4912
+ ORDER BY c.conname
4913
+
4914
+  (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
4915
+ FROM pg_constraint c
4916
+ JOIN pg_class t1 ON c.conrelid = t1.oid
4917
+ JOIN pg_class t2 ON c.confrelid = t2.oid
4918
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
4919
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
4920
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
4921
+ WHERE c.contype = 'f'
4922
+ AND t1.relname = 'ownerships'
4923
+ AND t3.nspname = ANY (current_schemas(false))
4924
+ ORDER BY c.conname
4925
+ 
4926
+  (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
4927
+ FROM pg_constraint c
4928
+ JOIN pg_class t1 ON c.conrelid = t1.oid
4929
+ JOIN pg_class t2 ON c.confrelid = t2.oid
4930
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
4931
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
4932
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
4933
+ WHERE c.contype = 'f'
4934
+ AND t1.relname = 'users'
4935
+ AND t3.nspname = ANY (current_schemas(false))
4936
+ ORDER BY c.conname
4937
+
4938
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
4939
+  (2.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
4940
+  (12.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4941
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
4942
+ Migrating to CreateOpenStaxAccountsAccounts (0)
4943
+  (0.2ms) BEGIN
4944
+  (3.8ms) CREATE TABLE "openstax_accounts_accounts" ("id" serial primary key, "openstax_uid" integer NOT NULL, "username" character varying NOT NULL, "access_token" character varying, "first_name" character varying, "last_name" character varying, "full_name" character varying, "title" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
4945
+  (0.8ms) CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_openstax_uid" ON "openstax_accounts_accounts" ("openstax_uid")
4946
+  (0.8ms) CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_username" ON "openstax_accounts_accounts" ("username")
4947
+  (0.6ms) CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_access_token" ON "openstax_accounts_accounts" ("access_token")
4948
+  (0.6ms) CREATE INDEX "index_openstax_accounts_accounts_on_first_name" ON "openstax_accounts_accounts" ("first_name")
4949
+  (0.7ms) CREATE INDEX "index_openstax_accounts_accounts_on_last_name" ON "openstax_accounts_accounts" ("last_name")
4950
+  (0.8ms) CREATE INDEX "index_openstax_accounts_accounts_on_full_name" ON "openstax_accounts_accounts" ("full_name")
4951
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "0"]]
4952
+  (0.5ms) COMMIT
4953
+ Migrating to CreateOpenStaxAccountsGroups (1)
4954
+  (0.2ms) BEGIN
4955
+  (2.8ms) CREATE TABLE "openstax_accounts_groups" ("id" serial primary key, "openstax_uid" integer NOT NULL, "is_public" boolean DEFAULT 'f' NOT NULL, "name" character varying, "cached_subtree_group_ids" text, "cached_supertree_group_ids" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
4956
+  (0.8ms) CREATE UNIQUE INDEX "index_openstax_accounts_groups_on_openstax_uid" ON "openstax_accounts_groups" ("openstax_uid")
4957
+  (1.0ms) CREATE INDEX "index_openstax_accounts_groups_on_is_public" ON "openstax_accounts_groups" ("is_public")
4958
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "1"]]
4959
+  (0.5ms) COMMIT
4960
+ Migrating to CreateOpenStaxAccountsGroupMembers (2)
4961
+  (0.4ms) BEGIN
4962
+  (2.2ms) CREATE TABLE "openstax_accounts_group_members" ("id" serial primary key, "group_id" integer NOT NULL, "user_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
4963
+  (0.9ms) CREATE UNIQUE INDEX "index_openstax_accounts_group_members_on_group_id_and_user_id" ON "openstax_accounts_group_members" ("group_id", "user_id")
4964
+  (0.7ms) CREATE INDEX "index_openstax_accounts_group_members_on_user_id" ON "openstax_accounts_group_members" ("user_id")
4965
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "2"]]
4966
+  (0.4ms) COMMIT
4967
+ Migrating to CreateOpenStaxAccountsGroupOwners (3)
4968
+  (0.2ms) BEGIN
4969
+  (1.9ms) CREATE TABLE "openstax_accounts_group_owners" ("id" serial primary key, "group_id" integer NOT NULL, "user_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
4970
+  (0.7ms) CREATE UNIQUE INDEX "index_openstax_accounts_group_owners_on_group_id_and_user_id" ON "openstax_accounts_group_owners" ("group_id", "user_id")
4971
+  (0.7ms) CREATE INDEX "index_openstax_accounts_group_owners_on_user_id" ON "openstax_accounts_group_owners" ("user_id")
4972
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "3"]]
4973
+  (0.5ms) COMMIT
4974
+ Migrating to CreateOpenStaxAccountsGroupNestings (4)
4975
+  (0.3ms) BEGIN
4976
+  (2.4ms) CREATE TABLE "openstax_accounts_group_nestings" ("id" serial primary key, "member_group_id" integer NOT NULL, "container_group_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
4977
+  (0.9ms) CREATE UNIQUE INDEX "index_openstax_accounts_group_nestings_on_member_group_id" ON "openstax_accounts_group_nestings" ("member_group_id")
4978
+  (0.8ms) CREATE INDEX "index_openstax_accounts_group_nestings_on_container_group_id" ON "openstax_accounts_group_nestings" ("container_group_id")
4979
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "4"]]
4980
+  (0.4ms) COMMIT
4981
+ Migrating to AddFacultyStatusToAccountsAccounts (5)
4982
+  (0.2ms) BEGIN
4983
+  (6.8ms) ALTER TABLE "openstax_accounts_accounts" ADD "faculty_status" integer DEFAULT 0 NOT NULL
4984
+  (0.7ms) CREATE INDEX "index_openstax_accounts_accounts_on_faculty_status" ON "openstax_accounts_accounts" ("faculty_status")
4985
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "5"]]
4986
+  (2.0ms) COMMIT
4987
+ Migrating to AddSalesforceContactIdToAccountsAccounts (6)
4988
+  (0.1ms) BEGIN
4989
+  (0.3ms) ALTER TABLE "openstax_accounts_accounts" ADD "salesforce_contact_id" character varying
4990
+  (0.7ms) CREATE INDEX "index_openstax_accounts_accounts_on_salesforce_contact_id" ON "openstax_accounts_accounts" ("salesforce_contact_id")
4991
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "6"]]
4992
+  (0.3ms) COMMIT
4993
+ Migrating to ChangeAccountsOpenStaxUidToBeNullable (7)
4994
+  (0.1ms) BEGIN
4995
+  (0.2ms) ALTER TABLE "openstax_accounts_accounts" ALTER "openstax_uid" DROP NOT NULL
4996
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "7"]]
4997
+  (0.3ms) COMMIT
4998
+ Migrating to ChangeAccountsUsernameToBeNullable (8)
4999
+  (0.1ms) BEGIN
5000
+  (0.2ms) ALTER TABLE "openstax_accounts_accounts" ALTER "username" DROP NOT NULL
5001
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "8"]]
5002
+  (0.3ms) COMMIT
5003
+ Migrating to AddUuidAndRoleToAccountsAccounts (9)
5004
+  (0.1ms) BEGIN
5005
+  (0.2ms) ALTER TABLE "openstax_accounts_accounts" ADD "uuid" character varying
5006
+  (0.8ms) CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_uuid" ON "openstax_accounts_accounts" ("uuid")
5007
+  (7.2ms) ALTER TABLE "openstax_accounts_accounts" ADD "role" integer DEFAULT 0 NOT NULL
5008
+  (0.6ms) CREATE INDEX "index_openstax_accounts_accounts_on_role" ON "openstax_accounts_accounts" ("role")
5009
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "9"]]
5010
+  (1.9ms) COMMIT
5011
+ Migrating to AssignMissingUuidsForLocalAccounts (10)
5012
+  (0.1ms) BEGIN
5013
+ SQL (5.1ms) CREATE EXTENSION IF NOT EXISTS "pgcrypto"
5014
+ SQL (0.7ms) UPDATE "openstax_accounts_accounts" SET "uuid" = gen_random_uuid() WHERE "openstax_accounts_accounts"."uuid" IS NULL
5015
+  (7.9ms) ALTER TABLE "openstax_accounts_accounts" ALTER COLUMN "uuid" TYPE uuid USING uuid::uuid
5016
+  (0.2ms) ALTER TABLE "openstax_accounts_accounts" ALTER COLUMN "uuid" SET DEFAULT gen_random_uuid()
5017
+  (0.4ms) UPDATE "openstax_accounts_accounts" SET "uuid"=gen_random_uuid() WHERE "uuid" IS NULL
5018
+  (0.2ms) ALTER TABLE "openstax_accounts_accounts" ALTER "uuid" SET NOT NULL
5019
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "10"]]
5020
+  (20.1ms) COMMIT
5021
+ Migrating to AddSupportIdentifierToAccountsAccounts (11)
5022
+  (0.4ms) BEGIN
5023
+ SQL (11.0ms) CREATE EXTENSION IF NOT EXISTS "citext"
5024
+  (0.3ms) ALTER TABLE "openstax_accounts_accounts" ADD "support_identifier" citext
5025
+  (1.1ms) CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_support_identifier" ON "openstax_accounts_accounts" ("support_identifier")
5026
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "11"]]
5027
+  (0.9ms) COMMIT
5028
+ Migrating to AddIsTestToAccountsAccounts (12)
5029
+  (0.1ms) BEGIN
5030
+  (0.2ms) ALTER TABLE "openstax_accounts_accounts" ADD "is_test" boolean
5031
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "12"]]
5032
+  (0.4ms) COMMIT
5033
+ Migrating to AddSchoolTypeToAccountsAccounts (13)
5034
+  (0.1ms) BEGIN
5035
+  (8.8ms) ALTER TABLE "openstax_accounts_accounts" ADD "school_type" integer DEFAULT 0 NOT NULL
5036
+  (0.9ms) CREATE INDEX "index_openstax_accounts_accounts_on_school_type" ON "openstax_accounts_accounts" ("school_type")
5037
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "13"]]
5038
+  (2.1ms) COMMIT
5039
+ Migrating to CreateUsers (1000)
5040
+  (0.1ms) BEGIN
5041
+  (1.7ms) CREATE TABLE "users" ("id" serial primary key, "account_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
5042
+  (0.6ms) CREATE UNIQUE INDEX "index_users_on_account_id" ON "users" ("account_id")
5043
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "1000"]]
5044
+  (0.3ms) COMMIT
5045
+ Migrating to CreateOwnerships (1001)
5046
+  (0.2ms) BEGIN
5047
+  (2.4ms) CREATE TABLE "ownerships" ("id" serial primary key, "owner_id" integer NOT NULL, "owner_type" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
5048
+  (0.7ms) CREATE UNIQUE INDEX "index_ownerships_on_owner_id_and_owner_type" ON "ownerships" ("owner_id", "owner_type")
5049
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "1001"]]
5050
+  (0.4ms) COMMIT
5051
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
5052
+  (1.9ms) 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
5053
+ FROM pg_constraint c
5054
+ JOIN pg_class t1 ON c.conrelid = t1.oid
5055
+ JOIN pg_class t2 ON c.confrelid = t2.oid
5056
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
5057
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
5058
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
5059
+ WHERE c.contype = 'f'
5060
+ AND t1.relname = 'openstax_accounts_accounts'
5061
+ AND t3.nspname = ANY (current_schemas(false))
5062
+ ORDER BY c.conname
5063
+
5064
+  (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
5065
+ FROM pg_constraint c
5066
+ JOIN pg_class t1 ON c.conrelid = t1.oid
5067
+ JOIN pg_class t2 ON c.confrelid = t2.oid
5068
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
5069
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
5070
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
5071
+ WHERE c.contype = 'f'
5072
+ AND t1.relname = 'openstax_accounts_group_members'
5073
+ AND t3.nspname = ANY (current_schemas(false))
5074
+ ORDER BY c.conname
5075
+ 
5076
+  (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
5077
+ FROM pg_constraint c
5078
+ JOIN pg_class t1 ON c.conrelid = t1.oid
5079
+ JOIN pg_class t2 ON c.confrelid = t2.oid
5080
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
5081
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
5082
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
5083
+ WHERE c.contype = 'f'
5084
+ AND t1.relname = 'openstax_accounts_group_nestings'
5085
+ AND t3.nspname = ANY (current_schemas(false))
5086
+ ORDER BY c.conname
5087
+
5088
+  (1.6ms) 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
5089
+ FROM pg_constraint c
5090
+ JOIN pg_class t1 ON c.conrelid = t1.oid
5091
+ JOIN pg_class t2 ON c.confrelid = t2.oid
5092
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
5093
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
5094
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
5095
+ WHERE c.contype = 'f'
5096
+ AND t1.relname = 'openstax_accounts_group_owners'
5097
+ AND t3.nspname = ANY (current_schemas(false))
5098
+ ORDER BY c.conname
5099
+ 
5100
+  (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
5101
+ FROM pg_constraint c
5102
+ JOIN pg_class t1 ON c.conrelid = t1.oid
5103
+ JOIN pg_class t2 ON c.confrelid = t2.oid
5104
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
5105
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
5106
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
5107
+ WHERE c.contype = 'f'
5108
+ AND t1.relname = 'openstax_accounts_groups'
5109
+ AND t3.nspname = ANY (current_schemas(false))
5110
+ ORDER BY c.conname
5111
+
5112
+  (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
5113
+ FROM pg_constraint c
5114
+ JOIN pg_class t1 ON c.conrelid = t1.oid
5115
+ JOIN pg_class t2 ON c.confrelid = t2.oid
5116
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
5117
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
5118
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
5119
+ WHERE c.contype = 'f'
5120
+ AND t1.relname = 'ownerships'
5121
+ AND t3.nspname = ANY (current_schemas(false))
5122
+ ORDER BY c.conname
5123
+ 
5124
+  (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
5125
+ FROM pg_constraint c
5126
+ JOIN pg_class t1 ON c.conrelid = t1.oid
5127
+ JOIN pg_class t2 ON c.confrelid = t2.oid
5128
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
5129
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
5130
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
5131
+ WHERE c.contype = 'f'
5132
+ AND t1.relname = 'users'
5133
+ AND t3.nspname = ANY (current_schemas(false))
5134
+ ORDER BY c.conname
5135
+
5136
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
5137
+ OpenStax::Accounts::Account Load (1.3ms) SELECT "openstax_accounts_accounts".* FROM "openstax_accounts_accounts" ORDER BY "openstax_accounts_accounts"."id" ASC LIMIT 1