openstax_accounts 7.12.0 → 7.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/handlers/openstax/accounts/sessions_callback.rb +6 -0
- data/app/models/openstax/accounts/account.rb +3 -9
- data/app/representers/openstax/accounts/api/v1/account_representer.rb +9 -1
- data/app/routines/openstax/accounts/find_or_create_account.rb +3 -2
- data/app/routines/openstax/accounts/sync_accounts.rb +2 -2
- data/db/migrate/13_add_school_type_to_accounts_accounts.rb +6 -0
- data/lib/openstax/accounts/version.rb +1 -1
- data/spec/cassettes/OpenStax_Accounts_FindOrCreateAccount/can_create_users.yml +3 -3
- data/spec/dummy/db/schema.rb +2 -0
- data/spec/dummy/log/development.log +397 -0
- data/spec/dummy/log/test.log +26120 -0
- data/spec/factories/openstax_accounts_account.rb +1 -0
- data/spec/handlers/openstax/accounts/sessions_callback_spec.rb +40 -24
- data/spec/routines/openstax/accounts/find_or_create_account_spec.rb +3 -2
- data/spec/spec_helper.rb +3 -2
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 63f92ee3ec16b3bfa98971c5eb4c7f0fe7e6aa6c9ab55c1a8aaa9987f61adf90
|
4
|
+
data.tar.gz: fcf45cbfaf4ddd1108043729a57d0823b994752556762e547aedeeb8af3eeaeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
'
|
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
|
@@ -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
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -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
|
[0m
|
4740
4740
|
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
4741
|
+
[1m[36m (14.4ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
4742
|
+
[1m[35m (13.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
4743
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4744
|
+
Migrating to CreateOpenStaxAccountsAccounts (0)
|
4745
|
+
[1m[35m (0.2ms)[0m BEGIN
|
4746
|
+
[1m[36m (16.7ms)[0m [1mCREATE 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) [0m
|
4747
|
+
[1m[35m (6.0ms)[0m CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_openstax_uid" ON "openstax_accounts_accounts" ("openstax_uid")
|
4748
|
+
[1m[36m (1.2ms)[0m [1mCREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_username" ON "openstax_accounts_accounts" ("username")[0m
|
4749
|
+
[1m[35m (1.1ms)[0m CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_access_token" ON "openstax_accounts_accounts" ("access_token")
|
4750
|
+
[1m[36m (1.0ms)[0m [1mCREATE INDEX "index_openstax_accounts_accounts_on_first_name" ON "openstax_accounts_accounts" ("first_name")[0m
|
4751
|
+
[1m[35m (0.9ms)[0m CREATE INDEX "index_openstax_accounts_accounts_on_last_name" ON "openstax_accounts_accounts" ("last_name")
|
4752
|
+
[1m[36m (0.9ms)[0m [1mCREATE INDEX "index_openstax_accounts_accounts_on_full_name" ON "openstax_accounts_accounts" ("full_name")[0m
|
4753
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "0"]]
|
4754
|
+
[1m[36m (0.6ms)[0m [1mCOMMIT[0m
|
4755
|
+
Migrating to CreateOpenStaxAccountsGroups (1)
|
4756
|
+
[1m[35m (0.2ms)[0m BEGIN
|
4757
|
+
[1m[36m (2.4ms)[0m [1mCREATE 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) [0m
|
4758
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "index_openstax_accounts_groups_on_openstax_uid" ON "openstax_accounts_groups" ("openstax_uid")
|
4759
|
+
[1m[36m (0.8ms)[0m [1mCREATE INDEX "index_openstax_accounts_groups_on_is_public" ON "openstax_accounts_groups" ("is_public")[0m
|
4760
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "1"]]
|
4761
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
4762
|
+
Migrating to CreateOpenStaxAccountsGroupMembers (2)
|
4763
|
+
[1m[35m (0.2ms)[0m BEGIN
|
4764
|
+
[1m[36m (1.6ms)[0m [1mCREATE 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) [0m
|
4765
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "index_openstax_accounts_group_members_on_group_id_and_user_id" ON "openstax_accounts_group_members" ("group_id", "user_id")
|
4766
|
+
[1m[36m (0.7ms)[0m [1mCREATE INDEX "index_openstax_accounts_group_members_on_user_id" ON "openstax_accounts_group_members" ("user_id")[0m
|
4767
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "2"]]
|
4768
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
4769
|
+
Migrating to CreateOpenStaxAccountsGroupOwners (3)
|
4770
|
+
[1m[35m (0.2ms)[0m BEGIN
|
4771
|
+
[1m[36m (1.8ms)[0m [1mCREATE 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) [0m
|
4772
|
+
[1m[35m (0.7ms)[0m CREATE UNIQUE INDEX "index_openstax_accounts_group_owners_on_group_id_and_user_id" ON "openstax_accounts_group_owners" ("group_id", "user_id")
|
4773
|
+
[1m[36m (0.7ms)[0m [1mCREATE INDEX "index_openstax_accounts_group_owners_on_user_id" ON "openstax_accounts_group_owners" ("user_id")[0m
|
4774
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "3"]]
|
4775
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
4776
|
+
Migrating to CreateOpenStaxAccountsGroupNestings (4)
|
4777
|
+
[1m[35m (0.3ms)[0m BEGIN
|
4778
|
+
[1m[36m (2.2ms)[0m [1mCREATE 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) [0m
|
4779
|
+
[1m[35m (0.7ms)[0m CREATE UNIQUE INDEX "index_openstax_accounts_group_nestings_on_member_group_id" ON "openstax_accounts_group_nestings" ("member_group_id")
|
4780
|
+
[1m[36m (0.7ms)[0m [1mCREATE INDEX "index_openstax_accounts_group_nestings_on_container_group_id" ON "openstax_accounts_group_nestings" ("container_group_id")[0m
|
4781
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "4"]]
|
4782
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
4783
|
+
Migrating to AddFacultyStatusToAccountsAccounts (5)
|
4784
|
+
[1m[35m (0.2ms)[0m BEGIN
|
4785
|
+
[1m[36m (6.0ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ADD "faculty_status" integer DEFAULT 0 NOT NULL[0m
|
4786
|
+
[1m[35m (1.0ms)[0m CREATE INDEX "index_openstax_accounts_accounts_on_faculty_status" ON "openstax_accounts_accounts" ("faculty_status")
|
4787
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "5"]]
|
4788
|
+
[1m[35m (1.6ms)[0m COMMIT
|
4789
|
+
Migrating to AddSalesforceContactIdToAccountsAccounts (6)
|
4790
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
4791
|
+
[1m[35m (0.3ms)[0m ALTER TABLE "openstax_accounts_accounts" ADD "salesforce_contact_id" character varying
|
4792
|
+
[1m[36m (0.9ms)[0m [1mCREATE INDEX "index_openstax_accounts_accounts_on_salesforce_contact_id" ON "openstax_accounts_accounts" ("salesforce_contact_id")[0m
|
4793
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "6"]]
|
4794
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
4795
|
+
Migrating to ChangeAccountsOpenStaxUidToBeNullable (7)
|
4796
|
+
[1m[35m (0.1ms)[0m BEGIN
|
4797
|
+
[1m[36m (0.2ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ALTER "openstax_uid" DROP NOT NULL[0m
|
4798
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "7"]]
|
4799
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
4800
|
+
Migrating to ChangeAccountsUsernameToBeNullable (8)
|
4801
|
+
[1m[35m (0.1ms)[0m BEGIN
|
4802
|
+
[1m[36m (0.2ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ALTER "username" DROP NOT NULL[0m
|
4803
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "8"]]
|
4804
|
+
[1m[36m (0.3ms)[0m [1mCOMMIT[0m
|
4805
|
+
Migrating to AddUuidAndRoleToAccountsAccounts (9)
|
4806
|
+
[1m[35m (0.1ms)[0m BEGIN
|
4807
|
+
[1m[36m (0.3ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ADD "uuid" character varying[0m
|
4808
|
+
[1m[35m (1.0ms)[0m CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_uuid" ON "openstax_accounts_accounts" ("uuid")
|
4809
|
+
[1m[36m (7.0ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ADD "role" integer DEFAULT 0 NOT NULL[0m
|
4810
|
+
[1m[35m (0.7ms)[0m CREATE INDEX "index_openstax_accounts_accounts_on_role" ON "openstax_accounts_accounts" ("role")
|
4811
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "9"]]
|
4812
|
+
[1m[35m (1.8ms)[0m COMMIT
|
4813
|
+
Migrating to AssignMissingUuidsForLocalAccounts (10)
|
4814
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
4815
|
+
[1m[35mSQL (5.5ms)[0m CREATE EXTENSION IF NOT EXISTS "pgcrypto"
|
4816
|
+
[1m[36mSQL (0.8ms)[0m [1mUPDATE "openstax_accounts_accounts" SET "uuid" = gen_random_uuid() WHERE "openstax_accounts_accounts"."uuid" IS NULL[0m
|
4817
|
+
[1m[35m (27.6ms)[0m ALTER TABLE "openstax_accounts_accounts" ALTER COLUMN "uuid" TYPE uuid USING uuid::uuid
|
4818
|
+
[1m[36m (0.3ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ALTER COLUMN "uuid" SET DEFAULT gen_random_uuid()[0m
|
4819
|
+
[1m[35m (0.5ms)[0m UPDATE "openstax_accounts_accounts" SET "uuid"=gen_random_uuid() WHERE "uuid" IS NULL
|
4820
|
+
[1m[36m (0.2ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ALTER "uuid" SET NOT NULL[0m
|
4821
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "10"]]
|
4822
|
+
[1m[36m (2.5ms)[0m [1mCOMMIT[0m
|
4823
|
+
Migrating to AddSupportIdentifierToAccountsAccounts (11)
|
4824
|
+
[1m[35m (0.2ms)[0m BEGIN
|
4825
|
+
[1m[36mSQL (10.7ms)[0m [1mCREATE EXTENSION IF NOT EXISTS "citext"[0m
|
4826
|
+
[1m[35m (0.3ms)[0m ALTER TABLE "openstax_accounts_accounts" ADD "support_identifier" citext
|
4827
|
+
[1m[36m (1.0ms)[0m [1mCREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_support_identifier" ON "openstax_accounts_accounts" ("support_identifier")[0m
|
4828
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "11"]]
|
4829
|
+
[1m[36m (0.6ms)[0m [1mCOMMIT[0m
|
4830
|
+
Migrating to AddIsTestToAccountsAccounts (12)
|
4831
|
+
[1m[35m (0.1ms)[0m BEGIN
|
4832
|
+
[1m[36m (0.2ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ADD "is_test" boolean[0m
|
4833
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "12"]]
|
4834
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
4835
|
+
Migrating to AddSchoolTypeToAccountsAccounts (13)
|
4836
|
+
[1m[35m (0.1ms)[0m BEGIN
|
4837
|
+
[1m[36m (8.3ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ADD "school_type" integer DEFAULT 0 NOT NULL[0m
|
4838
|
+
[1m[35m (0.8ms)[0m CREATE INDEX "index_openstax_accounts_accounts_on_school_type" ON "openstax_accounts_accounts" ("school_type")
|
4839
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "13"]]
|
4840
|
+
[1m[35m (2.1ms)[0m COMMIT
|
4841
|
+
Migrating to CreateUsers (1000)
|
4842
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
4843
|
+
[1m[35m (1.5ms)[0m CREATE TABLE "users" ("id" serial primary key, "account_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
4844
|
+
[1m[36m (0.7ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_account_id" ON "users" ("account_id")[0m
|
4845
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "1000"]]
|
4846
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
4847
|
+
Migrating to CreateOwnerships (1001)
|
4848
|
+
[1m[35m (0.2ms)[0m BEGIN
|
4849
|
+
[1m[36m (2.4ms)[0m [1mCREATE 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) [0m
|
4850
|
+
[1m[35m (1.0ms)[0m CREATE UNIQUE INDEX "index_ownerships_on_owner_id_and_owner_type" ON "ownerships" ("owner_id", "owner_type")
|
4851
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "1001"]]
|
4852
|
+
[1m[35m (0.4ms)[0m COMMIT
|
4853
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4854
|
+
[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
|
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
|
+
[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
|
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
|
+
[0m
|
4878
|
+
[1m[35m (1.5ms)[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
|
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
|
+
[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
|
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
|
+
[0m
|
4902
|
+
[1m[35m (1.5ms)[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
|
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
|
+
[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
|
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
|
+
[0m
|
4926
|
+
[1m[35m (1.5ms)[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
|
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
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4939
|
+
[1m[36m (2.6ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
4940
|
+
[1m[35m (12.7ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
4941
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4942
|
+
Migrating to CreateOpenStaxAccountsAccounts (0)
|
4943
|
+
[1m[35m (0.2ms)[0m BEGIN
|
4944
|
+
[1m[36m (3.8ms)[0m [1mCREATE 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) [0m
|
4945
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_openstax_uid" ON "openstax_accounts_accounts" ("openstax_uid")
|
4946
|
+
[1m[36m (0.8ms)[0m [1mCREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_username" ON "openstax_accounts_accounts" ("username")[0m
|
4947
|
+
[1m[35m (0.6ms)[0m CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_access_token" ON "openstax_accounts_accounts" ("access_token")
|
4948
|
+
[1m[36m (0.6ms)[0m [1mCREATE INDEX "index_openstax_accounts_accounts_on_first_name" ON "openstax_accounts_accounts" ("first_name")[0m
|
4949
|
+
[1m[35m (0.7ms)[0m CREATE INDEX "index_openstax_accounts_accounts_on_last_name" ON "openstax_accounts_accounts" ("last_name")
|
4950
|
+
[1m[36m (0.8ms)[0m [1mCREATE INDEX "index_openstax_accounts_accounts_on_full_name" ON "openstax_accounts_accounts" ("full_name")[0m
|
4951
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "0"]]
|
4952
|
+
[1m[36m (0.5ms)[0m [1mCOMMIT[0m
|
4953
|
+
Migrating to CreateOpenStaxAccountsGroups (1)
|
4954
|
+
[1m[35m (0.2ms)[0m BEGIN
|
4955
|
+
[1m[36m (2.8ms)[0m [1mCREATE 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) [0m
|
4956
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "index_openstax_accounts_groups_on_openstax_uid" ON "openstax_accounts_groups" ("openstax_uid")
|
4957
|
+
[1m[36m (1.0ms)[0m [1mCREATE INDEX "index_openstax_accounts_groups_on_is_public" ON "openstax_accounts_groups" ("is_public")[0m
|
4958
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "1"]]
|
4959
|
+
[1m[36m (0.5ms)[0m [1mCOMMIT[0m
|
4960
|
+
Migrating to CreateOpenStaxAccountsGroupMembers (2)
|
4961
|
+
[1m[35m (0.4ms)[0m BEGIN
|
4962
|
+
[1m[36m (2.2ms)[0m [1mCREATE 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) [0m
|
4963
|
+
[1m[35m (0.9ms)[0m CREATE UNIQUE INDEX "index_openstax_accounts_group_members_on_group_id_and_user_id" ON "openstax_accounts_group_members" ("group_id", "user_id")
|
4964
|
+
[1m[36m (0.7ms)[0m [1mCREATE INDEX "index_openstax_accounts_group_members_on_user_id" ON "openstax_accounts_group_members" ("user_id")[0m
|
4965
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "2"]]
|
4966
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
4967
|
+
Migrating to CreateOpenStaxAccountsGroupOwners (3)
|
4968
|
+
[1m[35m (0.2ms)[0m BEGIN
|
4969
|
+
[1m[36m (1.9ms)[0m [1mCREATE 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) [0m
|
4970
|
+
[1m[35m (0.7ms)[0m CREATE UNIQUE INDEX "index_openstax_accounts_group_owners_on_group_id_and_user_id" ON "openstax_accounts_group_owners" ("group_id", "user_id")
|
4971
|
+
[1m[36m (0.7ms)[0m [1mCREATE INDEX "index_openstax_accounts_group_owners_on_user_id" ON "openstax_accounts_group_owners" ("user_id")[0m
|
4972
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "3"]]
|
4973
|
+
[1m[36m (0.5ms)[0m [1mCOMMIT[0m
|
4974
|
+
Migrating to CreateOpenStaxAccountsGroupNestings (4)
|
4975
|
+
[1m[35m (0.3ms)[0m BEGIN
|
4976
|
+
[1m[36m (2.4ms)[0m [1mCREATE 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) [0m
|
4977
|
+
[1m[35m (0.9ms)[0m CREATE UNIQUE INDEX "index_openstax_accounts_group_nestings_on_member_group_id" ON "openstax_accounts_group_nestings" ("member_group_id")
|
4978
|
+
[1m[36m (0.8ms)[0m [1mCREATE INDEX "index_openstax_accounts_group_nestings_on_container_group_id" ON "openstax_accounts_group_nestings" ("container_group_id")[0m
|
4979
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "4"]]
|
4980
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
4981
|
+
Migrating to AddFacultyStatusToAccountsAccounts (5)
|
4982
|
+
[1m[35m (0.2ms)[0m BEGIN
|
4983
|
+
[1m[36m (6.8ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ADD "faculty_status" integer DEFAULT 0 NOT NULL[0m
|
4984
|
+
[1m[35m (0.7ms)[0m CREATE INDEX "index_openstax_accounts_accounts_on_faculty_status" ON "openstax_accounts_accounts" ("faculty_status")
|
4985
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "5"]]
|
4986
|
+
[1m[35m (2.0ms)[0m COMMIT
|
4987
|
+
Migrating to AddSalesforceContactIdToAccountsAccounts (6)
|
4988
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
4989
|
+
[1m[35m (0.3ms)[0m ALTER TABLE "openstax_accounts_accounts" ADD "salesforce_contact_id" character varying
|
4990
|
+
[1m[36m (0.7ms)[0m [1mCREATE INDEX "index_openstax_accounts_accounts_on_salesforce_contact_id" ON "openstax_accounts_accounts" ("salesforce_contact_id")[0m
|
4991
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "6"]]
|
4992
|
+
[1m[36m (0.3ms)[0m [1mCOMMIT[0m
|
4993
|
+
Migrating to ChangeAccountsOpenStaxUidToBeNullable (7)
|
4994
|
+
[1m[35m (0.1ms)[0m BEGIN
|
4995
|
+
[1m[36m (0.2ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ALTER "openstax_uid" DROP NOT NULL[0m
|
4996
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "7"]]
|
4997
|
+
[1m[36m (0.3ms)[0m [1mCOMMIT[0m
|
4998
|
+
Migrating to ChangeAccountsUsernameToBeNullable (8)
|
4999
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5000
|
+
[1m[36m (0.2ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ALTER "username" DROP NOT NULL[0m
|
5001
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "8"]]
|
5002
|
+
[1m[36m (0.3ms)[0m [1mCOMMIT[0m
|
5003
|
+
Migrating to AddUuidAndRoleToAccountsAccounts (9)
|
5004
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5005
|
+
[1m[36m (0.2ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ADD "uuid" character varying[0m
|
5006
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_uuid" ON "openstax_accounts_accounts" ("uuid")
|
5007
|
+
[1m[36m (7.2ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ADD "role" integer DEFAULT 0 NOT NULL[0m
|
5008
|
+
[1m[35m (0.6ms)[0m CREATE INDEX "index_openstax_accounts_accounts_on_role" ON "openstax_accounts_accounts" ("role")
|
5009
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "9"]]
|
5010
|
+
[1m[35m (1.9ms)[0m COMMIT
|
5011
|
+
Migrating to AssignMissingUuidsForLocalAccounts (10)
|
5012
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5013
|
+
[1m[35mSQL (5.1ms)[0m CREATE EXTENSION IF NOT EXISTS "pgcrypto"
|
5014
|
+
[1m[36mSQL (0.7ms)[0m [1mUPDATE "openstax_accounts_accounts" SET "uuid" = gen_random_uuid() WHERE "openstax_accounts_accounts"."uuid" IS NULL[0m
|
5015
|
+
[1m[35m (7.9ms)[0m ALTER TABLE "openstax_accounts_accounts" ALTER COLUMN "uuid" TYPE uuid USING uuid::uuid
|
5016
|
+
[1m[36m (0.2ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ALTER COLUMN "uuid" SET DEFAULT gen_random_uuid()[0m
|
5017
|
+
[1m[35m (0.4ms)[0m UPDATE "openstax_accounts_accounts" SET "uuid"=gen_random_uuid() WHERE "uuid" IS NULL
|
5018
|
+
[1m[36m (0.2ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ALTER "uuid" SET NOT NULL[0m
|
5019
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "10"]]
|
5020
|
+
[1m[36m (20.1ms)[0m [1mCOMMIT[0m
|
5021
|
+
Migrating to AddSupportIdentifierToAccountsAccounts (11)
|
5022
|
+
[1m[35m (0.4ms)[0m BEGIN
|
5023
|
+
[1m[36mSQL (11.0ms)[0m [1mCREATE EXTENSION IF NOT EXISTS "citext"[0m
|
5024
|
+
[1m[35m (0.3ms)[0m ALTER TABLE "openstax_accounts_accounts" ADD "support_identifier" citext
|
5025
|
+
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "index_openstax_accounts_accounts_on_support_identifier" ON "openstax_accounts_accounts" ("support_identifier")[0m
|
5026
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "11"]]
|
5027
|
+
[1m[36m (0.9ms)[0m [1mCOMMIT[0m
|
5028
|
+
Migrating to AddIsTestToAccountsAccounts (12)
|
5029
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5030
|
+
[1m[36m (0.2ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ADD "is_test" boolean[0m
|
5031
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "12"]]
|
5032
|
+
[1m[36m (0.4ms)[0m [1mCOMMIT[0m
|
5033
|
+
Migrating to AddSchoolTypeToAccountsAccounts (13)
|
5034
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5035
|
+
[1m[36m (8.8ms)[0m [1mALTER TABLE "openstax_accounts_accounts" ADD "school_type" integer DEFAULT 0 NOT NULL[0m
|
5036
|
+
[1m[35m (0.9ms)[0m CREATE INDEX "index_openstax_accounts_accounts_on_school_type" ON "openstax_accounts_accounts" ("school_type")
|
5037
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "13"]]
|
5038
|
+
[1m[35m (2.1ms)[0m COMMIT
|
5039
|
+
Migrating to CreateUsers (1000)
|
5040
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5041
|
+
[1m[35m (1.7ms)[0m CREATE TABLE "users" ("id" serial primary key, "account_id" integer NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5042
|
+
[1m[36m (0.6ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_account_id" ON "users" ("account_id")[0m
|
5043
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "1000"]]
|
5044
|
+
[1m[36m (0.3ms)[0m [1mCOMMIT[0m
|
5045
|
+
Migrating to CreateOwnerships (1001)
|
5046
|
+
[1m[35m (0.2ms)[0m BEGIN
|
5047
|
+
[1m[36m (2.4ms)[0m [1mCREATE 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) [0m
|
5048
|
+
[1m[35m (0.7ms)[0m CREATE UNIQUE INDEX "index_ownerships_on_owner_id_and_owner_type" ON "ownerships" ("owner_id", "owner_type")
|
5049
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "1001"]]
|
5050
|
+
[1m[35m (0.4ms)[0m COMMIT
|
5051
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5052
|
+
[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
|
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
|
+
[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
|
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
|
+
[0m
|
5076
|
+
[1m[35m (1.7ms)[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
|
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
|
+
[1m[36m (1.6ms)[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
|
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
|
+
[0m
|
5100
|
+
[1m[35m (1.5ms)[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
|
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
|
+
[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
|
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
|
+
[0m
|
5124
|
+
[1m[35m (1.5ms)[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
|
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
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5137
|
+
[1m[36mOpenStax::Accounts::Account Load (1.3ms)[0m [1mSELECT "openstax_accounts_accounts".* FROM "openstax_accounts_accounts" ORDER BY "openstax_accounts_accounts"."id" ASC LIMIT 1[0m
|