canvas_sync 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 96a7ba8b65d80cf63cb5118c22dab59757344809
4
- data.tar.gz: 1b1db15a66cad100634aba19eaffa611853227b1
2
+ SHA256:
3
+ metadata.gz: 55ece5ed1241d16dd55d06555070f6ca2a7e41f83789b1ccafc86ceab5ee06ce
4
+ data.tar.gz: fb9e4094be05238a8b35b41b10e9db950bde52a46743b06085e5966373c96a44
5
5
  SHA512:
6
- metadata.gz: 290645ac18e7a49eb302654a45c21205e9c7015174c9ea2db3071efc6e3d45d02beecbbecd6a7f620fbe93350e385a7bfe37b502297ca7063cd4117653cf131f
7
- data.tar.gz: 793d07d85a67ceb4108e600bc951b0aced771014c52e910dcb81e4affca4386873b4c6ccd61efba5a7eee464c25c8d1e36bb17b0057941b126deeb6439b3a17f
6
+ metadata.gz: 90ae0bc60719b0adaed1ab4b5683ef7de5b83fd038ef699969195bae05c7978664d407870f6ffb5dbe0053e827fb68f2856af43a72e2c7fbec1c49c993c3acd6
7
+ data.tar.gz: 2e51031d84c0c21d82ac0389c19558bcf5190d4cd36711a24397c29c1d5f9433c44b2bf20f20a98ff1605f13c669b2bd6cfa957616e1c37e160538ed0c7cd19f
@@ -7,19 +7,43 @@ module CanvasSync
7
7
  # @param report_params [Hash] The Canvas report parameters
8
8
  # @param processor [String] a stringified report processor class name
9
9
  # @param options [Hash] hash of options that will be passed to the job processor
10
+ # @param allow_redownloads [Boolean] whether you want the job_chain to cache this report,
11
+ # so that any later jobs in the chain will use the same generated report
10
12
  # @return [nil]
11
- def perform(job_chain, report_name, report_params, processor, options)
13
+ def perform(job_chain, report_name, report_params, processor, options, allow_redownloads: false)
12
14
  account_id = options[:account_id] || job_chain[:global_options][:account_id] || 'self'
13
- report = CanvasSync.get_canvas_sync_client(job_chain[:global_options]).start_report(account_id, report_name, report_params)
15
+
16
+ report_id = if allow_redownloads
17
+ get_cached_report(job_chain, account_id, report_name, report_params)
18
+ else
19
+ start_report(job_chain, account_id, report_name, report_params)
20
+ end
14
21
 
15
22
  CanvasSync::Jobs::ReportChecker.set(wait: report_checker_wait_time).perform_later(
16
23
  job_chain,
17
24
  report_name,
18
- report['id'],
25
+ report_id,
19
26
  processor,
20
27
  options
21
28
  )
22
29
  end
30
+
31
+ private
32
+
33
+ def get_cached_report(job_chain, account_id, report_name, report_params)
34
+ if job_chain[:global_options][report_name].present?
35
+ job_chain[:global_options][report_name]
36
+ else
37
+ report_id = start_report(job_chain, account_id, report_name, report_params)
38
+ job_chain[:global_options][report_name] = report_id
39
+ report_id
40
+ end
41
+ end
42
+
43
+ def start_report(job_chain, account_id, report_name, report_params)
44
+ report = CanvasSync.get_canvas_sync_client(job_chain[:global_options]).start_report(account_id, report_name, report_params)
45
+ report['id']
46
+ end
23
47
  end
24
48
  end
25
49
  end
@@ -1,3 +1,3 @@
1
1
  module CanvasSync
2
- VERSION = '0.3.8'
2
+ VERSION = '0.3.9'
3
3
  end
@@ -4,6 +4,8 @@ RSpec.describe CanvasSync::Jobs::ReportStarter do
4
4
  let(:report_params) { { 'parameters[users]' => true } }
5
5
  let(:report_name) { 'provisioning_csv' }
6
6
  let(:processor) { 'CoolProcessor' }
7
+ let(:report_checker_double) { double }
8
+ let(:options) { { models: ['users'] } }
7
9
 
8
10
  describe '#perform' do
9
11
  it 'tells Canvas to start the report and then enqueues a ReportChecker with the report id' do
@@ -18,7 +20,63 @@ RSpec.describe CanvasSync::Jobs::ReportStarter do
18
20
  report_name,
19
21
  report_params,
20
22
  processor,
21
- { models: ['users'] })
23
+ options)
24
+ end
25
+
26
+ context 'allow_redownloads is true' do
27
+ context 'the report has already been cached' do
28
+ it 'runs the report checker for the already started report' do
29
+ expect_any_instance_of(Bearcat::Client).to_not receive(:start_report)
30
+ job_chain = { jobs: [], global_options: { report_name => 1 } }
31
+
32
+ expect(CanvasSync::Jobs::ReportChecker).to receive(:set).and_return(report_checker_double)
33
+ expect(report_checker_double).to receive(:perform_later).with(
34
+ job_chain,
35
+ report_name,
36
+ 1,
37
+ processor,
38
+ options
39
+ )
40
+
41
+ CanvasSync::Jobs::ReportStarter.perform_now(
42
+ job_chain,
43
+ report_name,
44
+ report_params,
45
+ processor,
46
+ options,
47
+ allow_redownloads: true
48
+ )
49
+ end
50
+ end
51
+
52
+ context 'the report has not been started before' do
53
+ it 'starts a new report and caches the report id' do
54
+ expect_any_instance_of(Bearcat::Client).to receive(:start_report)
55
+ .with('self', report_name, report_params)
56
+ .and_return({ 'id' => 1 })
57
+
58
+ orig_job_chain = { jobs: [], global_options: {} }
59
+ new_job_chain = { jobs: [], global_options: { report_name => 1 } }
60
+
61
+ expect(CanvasSync::Jobs::ReportChecker).to receive(:set).and_return(report_checker_double)
62
+ expect(report_checker_double).to receive(:perform_later).with(
63
+ new_job_chain,
64
+ report_name,
65
+ 1,
66
+ processor,
67
+ options
68
+ )
69
+
70
+ CanvasSync::Jobs::ReportStarter.perform_now(
71
+ orig_job_chain,
72
+ report_name,
73
+ report_params,
74
+ processor,
75
+ options,
76
+ allow_redownloads: true
77
+ )
78
+ end
79
+ end
22
80
  end
23
81
  end
24
82
  end
Binary file
@@ -1,129 +1,431 @@
1
-  (16.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
2
-  (19.8ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
3
-  (0.2ms) SELECT pg_try_advisory_lock(1438354376499275445)
4
-  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
1
+  (0.1ms) SELECT sqlite_version(*)
2
+  (7.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
3
+  (1.6ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
4
+  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
5
5
  Migrating to CreateEnrollments (20170905192509)
6
-  (0.3ms) BEGIN
7
-  (25.6ms) CREATE TABLE "enrollments" ("id" bigserial primary key, "canvas_enrollment_id" bigint NOT NULL, "canvas_course_id" bigint, "course_sis_id" character varying, "canvas_user_id" bigint, "user_sis_id" character varying, "role" character varying, "role_id" integer, "canvas_section_id" bigint, "section_sis_id" character varying, "status" character varying, "base_role_type" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
8
-  (1.8ms) CREATE UNIQUE INDEX "index_enrollments_on_canvas_enrollment_id" ON "enrollments" ("canvas_enrollment_id")
9
-  (4.2ms) CREATE INDEX "index_enrollments_on_canvas_course_id" ON "enrollments" ("canvas_course_id")
10
-  (2.0ms) CREATE INDEX "index_enrollments_on_canvas_user_id" ON "enrollments" ("canvas_user_id")
11
- SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20170905192509"]]
12
-  (0.3ms) COMMIT
6
+  (0.1ms) begin transaction
7
+  (0.4ms) CREATE TABLE "enrollments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_enrollment_id" bigint NOT NULL, "canvas_course_id" bigint, "course_sis_id" varchar, "canvas_user_id" bigint, "user_sis_id" varchar, "role" varchar, "role_id" integer, "canvas_section_id" bigint, "section_sis_id" varchar, "status" varchar, "base_role_type" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
8
+  (0.1ms) CREATE UNIQUE INDEX "index_enrollments_on_canvas_enrollment_id" ON "enrollments" ("canvas_enrollment_id")
9
+  (0.1ms)  SELECT sql
10
+ FROM sqlite_master
11
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
12
+ UNION ALL
13
+ SELECT sql
14
+ FROM sqlite_temp_master
15
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
16
+ 
17
+  (0.1ms) CREATE INDEX "index_enrollments_on_canvas_course_id" ON "enrollments" ("canvas_course_id")
18
+  (0.1ms)  SELECT sql
19
+ FROM sqlite_master
20
+ WHERE name='index_enrollments_on_canvas_course_id' AND type='index'
21
+ UNION ALL
22
+ SELECT sql
23
+ FROM sqlite_temp_master
24
+ WHERE name='index_enrollments_on_canvas_course_id' AND type='index'
25
+ 
26
+  (0.0ms)  SELECT sql
27
+ FROM sqlite_master
28
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
29
+ UNION ALL
30
+ SELECT sql
31
+ FROM sqlite_temp_master
32
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
33
+ 
34
+  (0.1ms) CREATE INDEX "index_enrollments_on_canvas_user_id" ON "enrollments" ("canvas_user_id")
35
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170905192509"]]
36
+  (0.9ms) commit transaction
13
37
  Migrating to CreateTerms (20170906193506)
14
-  (0.3ms) BEGIN
15
-  (4.3ms) CREATE TABLE "terms" ("id" bigserial primary key, "canvas_term_id" integer NOT NULL, "name" character varying, "start_at" timestamp, "end_at" timestamp, "workflow_state" character varying, "grading_period_group_id" integer, "sis_id" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
16
-  (1.4ms) CREATE UNIQUE INDEX "index_terms_on_canvas_term_id" ON "terms" ("canvas_term_id")
17
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20170906193506"]]
18
-  (0.7ms) COMMIT
38
+  (0.1ms) begin transaction
39
+  (0.4ms) CREATE TABLE "terms" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_term_id" integer NOT NULL, "name" varchar, "start_at" datetime, "end_at" datetime, "workflow_state" varchar, "grading_period_group_id" integer, "sis_id" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
40
+  (0.2ms) CREATE UNIQUE INDEX "index_terms_on_canvas_term_id" ON "terms" ("canvas_term_id")
41
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170906193506"]]
42
+  (1.6ms) commit transaction
43
+ Migrating to CreateSections (20170906203438)
44
+  (0.1ms) begin transaction
45
+  (0.4ms) CREATE TABLE "sections" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_section_id" bigint NOT NULL, "sis_id" varchar, "canvas_course_id" bigint, "name" varchar, "status" varchar, "start_date" datetime, "end_date" datetime, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
46
+  (0.2ms) CREATE UNIQUE INDEX "index_sections_on_canvas_section_id" ON "sections" ("canvas_section_id")
47
+  (0.1ms)  SELECT sql
48
+ FROM sqlite_master
49
+ WHERE name='index_sections_on_canvas_section_id' AND type='index'
50
+ UNION ALL
51
+ SELECT sql
52
+ FROM sqlite_temp_master
53
+ WHERE name='index_sections_on_canvas_section_id' AND type='index'
54
+ 
55
+  (0.1ms) CREATE INDEX "index_sections_on_canvas_course_id" ON "sections" ("canvas_course_id")
56
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170906203438"]]
57
+  (1.2ms) commit transaction
19
58
  Migrating to CreateCourses (20170914181345)
20
-  (0.1ms) BEGIN
21
-  (4.1ms) CREATE TABLE "courses" ("id" bigserial primary key, "canvas_course_id" bigint NOT NULL, "sis_id" character varying, "short_name" character varying, "long_name" character varying, "status" character varying, "canvas_account_id" integer, "canvas_term_id" integer, "term_sis_id" integer, "start_date" timestamp, "end_date" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
22
-  (1.3ms) CREATE UNIQUE INDEX "index_courses_on_canvas_course_id" ON "courses" ("canvas_course_id")
23
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20170914181345"]]
24
-  (0.2ms) COMMIT
25
- Migrating to CreateCanvasSyncJobLog (20170915210836)
26
-  (8.2ms) BEGIN
27
-  (41.4ms) CREATE TABLE "canvas_sync_job_logs" ("id" bigserial primary key, "started_at" timestamp, "completed_at" timestamp, "exception" character varying, "backtrace" text, "job_class" character varying, "status" character varying, "metadata" text, "job_arguments" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
28
- SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20170915210836"]]
29
-  (0.4ms) COMMIT
59
+  (0.0ms) begin transaction
60
+  (0.3ms) CREATE TABLE "courses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_course_id" bigint NOT NULL, "sis_id" varchar, "short_name" varchar, "long_name" varchar, "status" varchar, "canvas_account_id" integer, "canvas_term_id" integer, "term_sis_id" integer, "start_date" datetime, "end_date" datetime, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
61
+  (0.1ms) CREATE UNIQUE INDEX "index_courses_on_canvas_course_id" ON "courses" ("canvas_course_id")
62
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170914181345"]]
63
+  (1.4ms) commit transaction
30
64
  Migrating to CreateUsers (20170918221413)
31
-  (0.2ms) BEGIN
32
-  (4.6ms) CREATE TABLE "users" ("id" bigserial primary key, "canvas_user_id" bigint NOT NULL, "sis_id" character varying, "email" character varying, "first_name" character varying, "last_name" character varying, "status" character varying, "login_id" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
33
-  (1.3ms) CREATE UNIQUE INDEX "index_users_on_canvas_user_id" ON "users" ("canvas_user_id")
34
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20170918221413"]]
35
-  (1.2ms) COMMIT
36
- Migrating to CreateSections (20171107213207)
37
-  (0.1ms) BEGIN
38
-  (4.1ms) CREATE TABLE "sections" ("id" bigserial primary key, "canvas_section_id" bigint NOT NULL, "sis_id" character varying, "canvas_course_id" bigint, "canvas_nonxlist_course_id" bigint, "name" character varying, "status" character varying, "start_date" timestamp, "end_date" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
39
-  (1.8ms) CREATE UNIQUE INDEX "index_sections_on_canvas_section_id" ON "sections" ("canvas_section_id")
40
-  (1.4ms) CREATE INDEX "index_sections_on_canvas_course_id" ON "sections" ("canvas_course_id")
41
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171107213207"]]
42
-  (0.3ms) COMMIT
43
- Migrating to CreateRoles (20180103162102)
44
-  (10.7ms) BEGIN
45
-  (16.2ms) CREATE TABLE "roles" ("id" bigserial primary key, "canvas_role_id" integer NOT NULL, "label" character varying NOT NULL, "base_role_type" character varying NOT NULL, "account" json, "workflow_state" character varying NOT NULL, "permissions" json, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
46
-  (1.4ms) CREATE UNIQUE INDEX "index_roles_on_canvas_role_id" ON "roles" ("canvas_role_id")
47
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20180103162102"]]
48
-  (0.3ms) COMMIT
49
- ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
50
-  (0.1ms) BEGIN
51
- SQL (0.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-01-03 16:29:37.282741"], ["updated_at", "2018-01-03 16:29:37.282741"]]
52
-  (0.2ms) COMMIT
53
-  (0.2ms) SELECT pg_advisory_unlock(1438354376499275445)
54
-  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
55
-  (0.8ms) SELECT pg_try_advisory_lock(1438354376499275445)
56
-  (11.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
57
- Migrating to CreateAdmins (20180109210452)
58
-  (0.2ms) BEGIN
59
-  (23.4ms) CREATE TABLE "admins" ("id" bigserial primary key, "canvas_admin_id" bigint NOT NULL, "role" character varying, "canvas_role_id" bigint NOT NULL, "user" json, "canvas_user_id" bigint NOT NULL, "workflow_state" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
60
-  (1.1ms) CREATE UNIQUE INDEX "index_admins_on_canvas_admin_id" ON "admins" ("canvas_admin_id")
61
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20180109210452"]]
62
-  (1.7ms) COMMIT
63
- ActiveRecord::InternalMetadata Load (2.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
64
-  (0.1ms) BEGIN
65
-  (0.1ms) COMMIT
66
-  (0.2ms) SELECT pg_advisory_unlock(1438354376499275445)
67
-  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
68
-  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
69
-  (0.2ms) SELECT pg_try_advisory_lock(1438354376499275445)
65
+  (0.1ms) begin transaction
66
+  (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_user_id" bigint NOT NULL, "sis_id" varchar, "email" varchar, "first_name" varchar, "last_name" varchar, "status" varchar, "login_id" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
67
+  (0.1ms) CREATE UNIQUE INDEX "index_users_on_canvas_user_id" ON "users" ("canvas_user_id")
68
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170918221413"]]
69
+  (1.0ms) commit transaction
70
+ ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
71
+  (0.0ms) begin transaction
72
+ SQL (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", "2017-11-02 21:22:48.791273"], ["updated_at", "2017-11-02 21:22:48.791273"]]
73
+  (0.6ms) commit transaction
74
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
75
+  (0.1ms)  SELECT sql
76
+ FROM sqlite_master
77
+ WHERE name='index_courses_on_canvas_course_id' AND type='index'
78
+ UNION ALL
79
+ SELECT sql
80
+ FROM sqlite_temp_master
81
+ WHERE name='index_courses_on_canvas_course_id' AND type='index'
82
+ 
83
+  (0.1ms)  SELECT sql
84
+ FROM sqlite_master
85
+ WHERE name='index_enrollments_on_canvas_user_id' AND type='index'
86
+ UNION ALL
87
+ SELECT sql
88
+ FROM sqlite_temp_master
89
+ WHERE name='index_enrollments_on_canvas_user_id' AND type='index'
90
+ 
91
+  (0.1ms)  SELECT sql
92
+ FROM sqlite_master
93
+ WHERE name='index_enrollments_on_canvas_course_id' AND type='index'
94
+ UNION ALL
95
+ SELECT sql
96
+ FROM sqlite_temp_master
97
+ WHERE name='index_enrollments_on_canvas_course_id' AND type='index'
98
+ 
99
+  (0.1ms)  SELECT sql
100
+ FROM sqlite_master
101
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
102
+ UNION ALL
103
+ SELECT sql
104
+ FROM sqlite_temp_master
105
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
106
+ 
107
+  (0.1ms)  SELECT sql
108
+ FROM sqlite_master
109
+ WHERE name='index_sections_on_canvas_course_id' AND type='index'
110
+ UNION ALL
111
+ SELECT sql
112
+ FROM sqlite_temp_master
113
+ WHERE name='index_sections_on_canvas_course_id' AND type='index'
114
+ 
115
+  (0.1ms)  SELECT sql
116
+ FROM sqlite_master
117
+ WHERE name='index_sections_on_canvas_section_id' AND type='index'
118
+ UNION ALL
119
+ SELECT sql
120
+ FROM sqlite_temp_master
121
+ WHERE name='index_sections_on_canvas_section_id' AND type='index'
122
+ 
123
+  (0.1ms)  SELECT sql
124
+ FROM sqlite_master
125
+ WHERE name='index_terms_on_canvas_term_id' AND type='index'
126
+ UNION ALL
127
+ SELECT sql
128
+ FROM sqlite_temp_master
129
+ WHERE name='index_terms_on_canvas_term_id' AND type='index'
130
+ 
131
+  (0.1ms)  SELECT sql
132
+ FROM sqlite_master
133
+ WHERE name='index_users_on_canvas_user_id' AND type='index'
134
+ UNION ALL
135
+ SELECT sql
136
+ FROM sqlite_temp_master
137
+ WHERE name='index_users_on_canvas_user_id' AND type='index'
138
+ 
139
+  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
140
+  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", "environment"]]
141
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
142
+  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", "environment"]]
143
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
144
+  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", "environment"]]
145
+  (0.1ms) SELECT sqlite_version(*)
146
+  (4.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
147
+  (1.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
148
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
149
+ Migrating to CreateEnrollments (20170905192509)
150
+  (0.1ms) begin transaction
151
+  (0.4ms) CREATE TABLE "enrollments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_enrollment_id" bigint NOT NULL, "canvas_course_id" bigint, "course_sis_id" varchar, "canvas_user_id" bigint, "user_sis_id" varchar, "role" varchar, "role_id" integer, "canvas_section_id" bigint, "section_sis_id" varchar, "status" varchar, "base_role_type" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
152
+  (0.1ms) CREATE UNIQUE INDEX "index_enrollments_on_canvas_enrollment_id" ON "enrollments" ("canvas_enrollment_id")
153
+  (0.1ms)  SELECT sql
154
+ FROM sqlite_master
155
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
156
+ UNION ALL
157
+ SELECT sql
158
+ FROM sqlite_temp_master
159
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
160
+ 
161
+  (0.1ms) CREATE INDEX "index_enrollments_on_canvas_course_id" ON "enrollments" ("canvas_course_id")
162
+  (0.1ms)  SELECT sql
163
+ FROM sqlite_master
164
+ WHERE name='index_enrollments_on_canvas_course_id' AND type='index'
165
+ UNION ALL
166
+ SELECT sql
167
+ FROM sqlite_temp_master
168
+ WHERE name='index_enrollments_on_canvas_course_id' AND type='index'
169
+ 
170
+  (0.1ms)  SELECT sql
171
+ FROM sqlite_master
172
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
173
+ UNION ALL
174
+ SELECT sql
175
+ FROM sqlite_temp_master
176
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
177
+ 
178
+  (0.1ms) CREATE INDEX "index_enrollments_on_canvas_user_id" ON "enrollments" ("canvas_user_id")
179
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170905192509"]]
180
+  (0.7ms) commit transaction
181
+ Migrating to CreateTerms (20170906193506)
182
+  (0.0ms) begin transaction
183
+  (0.3ms) CREATE TABLE "terms" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_term_id" integer NOT NULL, "name" varchar, "start_at" datetime, "end_at" datetime, "workflow_state" varchar, "grading_period_group_id" integer, "sis_id" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
184
+  (0.1ms) CREATE UNIQUE INDEX "index_terms_on_canvas_term_id" ON "terms" ("canvas_term_id")
185
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170906193506"]]
186
+  (0.5ms) commit transaction
187
+ Migrating to CreateSections (20170906203438)
188
+  (0.0ms) begin transaction
189
+  (0.3ms) CREATE TABLE "sections" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_section_id" bigint NOT NULL, "sis_id" varchar, "canvas_course_id" bigint, "name" varchar, "status" varchar, "start_date" datetime, "end_date" datetime, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
190
+  (0.1ms) CREATE UNIQUE INDEX "index_sections_on_canvas_section_id" ON "sections" ("canvas_section_id")
191
+  (0.1ms)  SELECT sql
192
+ FROM sqlite_master
193
+ WHERE name='index_sections_on_canvas_section_id' AND type='index'
194
+ UNION ALL
195
+ SELECT sql
196
+ FROM sqlite_temp_master
197
+ WHERE name='index_sections_on_canvas_section_id' AND type='index'
198
+ 
199
+  (0.1ms) CREATE INDEX "index_sections_on_canvas_course_id" ON "sections" ("canvas_course_id")
200
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170906203438"]]
201
+  (1.3ms) commit transaction
202
+ Migrating to CreateCourses (20170914181345)
203
+  (0.1ms) begin transaction
204
+  (0.4ms) CREATE TABLE "courses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_course_id" bigint NOT NULL, "sis_id" varchar, "short_name" varchar, "long_name" varchar, "status" varchar, "canvas_account_id" integer, "canvas_term_id" integer, "term_sis_id" integer, "start_date" datetime, "end_date" datetime, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
205
+  (0.1ms) CREATE UNIQUE INDEX "index_courses_on_canvas_course_id" ON "courses" ("canvas_course_id")
206
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170914181345"]]
207
+  (1.0ms) commit transaction
208
+ Migrating to CreateUsers (20170918221413)
209
+  (0.1ms) begin transaction
210
+  (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_user_id" bigint NOT NULL, "sis_id" varchar, "email" varchar, "first_name" varchar, "last_name" varchar, "status" varchar, "login_id" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
211
+  (0.1ms) CREATE UNIQUE INDEX "index_users_on_canvas_user_id" ON "users" ("canvas_user_id")
212
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170918221413"]]
213
+  (0.7ms) commit transaction
214
+ ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
215
+  (0.0ms) begin transaction
216
+ SQL (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", "2017-11-02 21:23:44.534031"], ["updated_at", "2017-11-02 21:23:44.534031"]]
217
+  (0.6ms) commit transaction
218
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
219
+  (0.1ms)  SELECT sql
220
+ FROM sqlite_master
221
+ WHERE name='index_courses_on_canvas_course_id' AND type='index'
222
+ UNION ALL
223
+ SELECT sql
224
+ FROM sqlite_temp_master
225
+ WHERE name='index_courses_on_canvas_course_id' AND type='index'
226
+ 
227
+  (0.1ms)  SELECT sql
228
+ FROM sqlite_master
229
+ WHERE name='index_enrollments_on_canvas_user_id' AND type='index'
230
+ UNION ALL
231
+ SELECT sql
232
+ FROM sqlite_temp_master
233
+ WHERE name='index_enrollments_on_canvas_user_id' AND type='index'
234
+ 
235
+  (0.1ms)  SELECT sql
236
+ FROM sqlite_master
237
+ WHERE name='index_enrollments_on_canvas_course_id' AND type='index'
238
+ UNION ALL
239
+ SELECT sql
240
+ FROM sqlite_temp_master
241
+ WHERE name='index_enrollments_on_canvas_course_id' AND type='index'
242
+ 
243
+  (0.1ms)  SELECT sql
244
+ FROM sqlite_master
245
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
246
+ UNION ALL
247
+ SELECT sql
248
+ FROM sqlite_temp_master
249
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
250
+ 
251
+  (0.1ms)  SELECT sql
252
+ FROM sqlite_master
253
+ WHERE name='index_sections_on_canvas_course_id' AND type='index'
254
+ UNION ALL
255
+ SELECT sql
256
+ FROM sqlite_temp_master
257
+ WHERE name='index_sections_on_canvas_course_id' AND type='index'
258
+ 
259
+  (0.1ms)  SELECT sql
260
+ FROM sqlite_master
261
+ WHERE name='index_sections_on_canvas_section_id' AND type='index'
262
+ UNION ALL
263
+ SELECT sql
264
+ FROM sqlite_temp_master
265
+ WHERE name='index_sections_on_canvas_section_id' AND type='index'
266
+ 
267
+  (0.1ms)  SELECT sql
268
+ FROM sqlite_master
269
+ WHERE name='index_terms_on_canvas_term_id' AND type='index'
270
+ UNION ALL
271
+ SELECT sql
272
+ FROM sqlite_temp_master
273
+ WHERE name='index_terms_on_canvas_term_id' AND type='index'
274
+ 
275
+  (0.1ms)  SELECT sql
276
+ FROM sqlite_master
277
+ WHERE name='index_users_on_canvas_user_id' AND type='index'
278
+ UNION ALL
279
+ SELECT sql
280
+ FROM sqlite_temp_master
281
+ WHERE name='index_users_on_canvas_user_id' AND type='index'
282
+ 
283
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
284
+  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", "environment"]]
70
285
   (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
71
- Migrating to CreateAdmins (20180109210452)
72
-  (0.2ms) BEGIN
73
-  (3.1ms) DROP INDEX "index_admins_on_canvas_admin_id"
74
-  (3.3ms) DROP TABLE "admins"
75
- SQL (0.4ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20180109210452"]]
76
-  (6.0ms) COMMIT
77
-  (0.2ms) SELECT pg_advisory_unlock(1438354376499275445)
286
+  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", "environment"]]
287
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
288
+  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", "environment"]]
289
+  (0.1ms) SELECT sqlite_version(*)
290
+  (6.8ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
291
+  (1.4ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
292
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
293
+ Migrating to CreateEnrollments (20170905192509)
294
+  (0.0ms) begin transaction
295
+  (0.4ms) CREATE TABLE "enrollments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_enrollment_id" bigint NOT NULL, "canvas_course_id" bigint, "course_sis_id" varchar, "canvas_user_id" bigint, "user_sis_id" varchar, "role" varchar, "role_id" integer, "canvas_section_id" bigint, "section_sis_id" varchar, "status" varchar, "base_role_type" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
296
+  (0.1ms) CREATE UNIQUE INDEX "index_enrollments_on_canvas_enrollment_id" ON "enrollments" ("canvas_enrollment_id")
297
+  (0.1ms)  SELECT sql
298
+ FROM sqlite_master
299
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
300
+ UNION ALL
301
+ SELECT sql
302
+ FROM sqlite_temp_master
303
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
304
+ 
305
+  (0.1ms) CREATE INDEX "index_enrollments_on_canvas_course_id" ON "enrollments" ("canvas_course_id")
306
+  (0.1ms)  SELECT sql
307
+ FROM sqlite_master
308
+ WHERE name='index_enrollments_on_canvas_course_id' AND type='index'
309
+ UNION ALL
310
+ SELECT sql
311
+ FROM sqlite_temp_master
312
+ WHERE name='index_enrollments_on_canvas_course_id' AND type='index'
313
+ 
314
+  (0.1ms)  SELECT sql
315
+ FROM sqlite_master
316
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
317
+ UNION ALL
318
+ SELECT sql
319
+ FROM sqlite_temp_master
320
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
321
+ 
322
+  (0.1ms) CREATE INDEX "index_enrollments_on_canvas_user_id" ON "enrollments" ("canvas_user_id")
323
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170905192509"]]
324
+  (1.3ms) commit transaction
325
+ Migrating to CreateTerms (20170906193506)
326
+  (0.0ms) begin transaction
327
+  (0.3ms) CREATE TABLE "terms" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_term_id" integer NOT NULL, "name" varchar, "start_at" datetime, "end_at" datetime, "workflow_state" varchar, "grading_period_group_id" integer, "sis_id" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
328
+  (0.1ms) CREATE UNIQUE INDEX "index_terms_on_canvas_term_id" ON "terms" ("canvas_term_id")
329
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170906193506"]]
330
+  (1.5ms) commit transaction
331
+ Migrating to CreateSections (20170906203438)
332
+  (0.1ms) begin transaction
333
+  (0.3ms) CREATE TABLE "sections" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_section_id" bigint NOT NULL, "sis_id" varchar, "canvas_course_id" bigint, "name" varchar, "status" varchar, "start_date" datetime, "end_date" datetime, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
334
+  (0.1ms) CREATE UNIQUE INDEX "index_sections_on_canvas_section_id" ON "sections" ("canvas_section_id")
335
+  (0.1ms)  SELECT sql
336
+ FROM sqlite_master
337
+ WHERE name='index_sections_on_canvas_section_id' AND type='index'
338
+ UNION ALL
339
+ SELECT sql
340
+ FROM sqlite_temp_master
341
+ WHERE name='index_sections_on_canvas_section_id' AND type='index'
342
+ 
343
+  (0.1ms) CREATE INDEX "index_sections_on_canvas_course_id" ON "sections" ("canvas_course_id")
344
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170906203438"]]
345
+  (1.3ms) commit transaction
346
+ Migrating to CreateCourses (20170914181345)
347
+  (0.1ms) begin transaction
348
+  (0.4ms) CREATE TABLE "courses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_course_id" bigint NOT NULL, "sis_id" varchar, "short_name" varchar, "long_name" varchar, "status" varchar, "canvas_account_id" integer, "canvas_term_id" integer, "term_sis_id" integer, "start_date" datetime, "end_date" datetime, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
349
+  (0.1ms) CREATE UNIQUE INDEX "index_courses_on_canvas_course_id" ON "courses" ("canvas_course_id")
350
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170914181345"]]
351
+  (1.1ms) commit transaction
352
+ Migrating to CreateCanvasSyncJobLog (20170915210836)
353
+  (0.1ms) begin transaction
354
+  (0.4ms) CREATE TABLE "canvas_sync_job_logs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "started_at" datetime, "completed_at" datetime, "exception" varchar, "backtrace" text, "job_class" varchar, "status" varchar, "metadata" text, "job_arguments" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
355
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170915210836"]]
356
+  (1.0ms) commit transaction
357
+ Migrating to CreateUsers (20170918221413)
358
+  (0.1ms) begin transaction
359
+  (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "canvas_user_id" bigint NOT NULL, "sis_id" varchar, "email" varchar, "first_name" varchar, "last_name" varchar, "status" varchar, "login_id" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
360
+  (0.1ms) CREATE UNIQUE INDEX "index_users_on_canvas_user_id" ON "users" ("canvas_user_id")
361
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170918221413"]]
362
+  (0.9ms) commit transaction
363
+ ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
364
+  (0.0ms) begin transaction
365
+ SQL (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", "2017-11-02 21:24:18.830692"], ["updated_at", "2017-11-02 21:24:18.830692"]]
366
+  (0.8ms) commit transaction
78
367
   (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
79
-  (0.1ms) SELECT pg_try_advisory_lock(1438354376499275445)
80
-  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
81
- Migrating to CreateAdmins (20180109210452)
82
-  (0.1ms) BEGIN
83
-  (10.8ms) CREATE TABLE "admins" ("id" bigserial primary key, "canvas_admin_id" bigint NOT NULL, "role" character varying, "canvas_role_id" bigint NOT NULL, "user" json, "canvas_user_id" bigint NOT NULL, "workflow_state" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
84
-  (1.2ms) CREATE UNIQUE INDEX "index_admins_on_canvas_admin_id" ON "admins" ("canvas_admin_id")
85
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20180109210452"]]
86
-  (1.0ms) COMMIT
87
- ActiveRecord::InternalMetadata Load (1.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
88
-  (0.1ms) BEGIN
89
-  (0.1ms) COMMIT
90
-  (0.2ms) SELECT pg_advisory_unlock(1438354376499275445)
91
-  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
92
-  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
93
-  (0.1ms) SELECT pg_try_advisory_lock(1438354376499275445)
94
-  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
95
- Migrating to CreateAdmins (20180109210452)
96
-  (0.1ms) BEGIN
97
-  (0.5ms) DROP INDEX "index_admins_on_canvas_admin_id"
98
-  (0.7ms) DROP TABLE "admins"
99
- SQL (0.3ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20180109210452"]]
100
-  (22.8ms) COMMIT
101
-  (0.3ms) SELECT pg_advisory_unlock(1438354376499275445)
102
-  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
103
-  (0.1ms) SELECT pg_try_advisory_lock(1438354376499275445)
104
-  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
105
- Migrating to CreateAdmins (20180109210452)
106
-  (0.1ms) BEGIN
107
-  (9.0ms) CREATE TABLE "admins" ("id" bigserial primary key, "canvas_admin_id" bigint NOT NULL, "role_name" character varying, "canvas_role_id" bigint NOT NULL, "user_data" json, "canvas_user_id" bigint NOT NULL, "workflow_state" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
108
-  (1.3ms) CREATE UNIQUE INDEX "index_admins_on_canvas_admin_id" ON "admins" ("canvas_admin_id")
109
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20180109210452"]]
110
-  (1.0ms) COMMIT
111
- ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
112
-  (0.1ms) BEGIN
113
-  (0.1ms) COMMIT
114
-  (0.1ms) SELECT pg_advisory_unlock(1438354376499275445)
115
-  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
116
-  (0.2ms) SELECT pg_try_advisory_lock(1438354376499275445)
117
-  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
118
- ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
119
-  (0.1ms) BEGIN
120
-  (0.1ms) COMMIT
121
-  (0.1ms) SELECT pg_advisory_unlock(1438354376499275445)
122
-  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
123
-  (0.2ms) SELECT pg_try_advisory_lock(1438354376499275445)
124
-  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
125
- ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
126
-  (0.1ms) BEGIN
127
-  (0.1ms) COMMIT
128
-  (0.2ms) SELECT pg_advisory_unlock(1438354376499275445)
129
-  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
368
+  (0.1ms)  SELECT sql
369
+ FROM sqlite_master
370
+ WHERE name='index_courses_on_canvas_course_id' AND type='index'
371
+ UNION ALL
372
+ SELECT sql
373
+ FROM sqlite_temp_master
374
+ WHERE name='index_courses_on_canvas_course_id' AND type='index'
375
+ 
376
+  (0.5ms)  SELECT sql
377
+ FROM sqlite_master
378
+ WHERE name='index_enrollments_on_canvas_user_id' AND type='index'
379
+ UNION ALL
380
+ SELECT sql
381
+ FROM sqlite_temp_master
382
+ WHERE name='index_enrollments_on_canvas_user_id' AND type='index'
383
+ 
384
+  (0.1ms)  SELECT sql
385
+ FROM sqlite_master
386
+ WHERE name='index_enrollments_on_canvas_course_id' AND type='index'
387
+ UNION ALL
388
+ SELECT sql
389
+ FROM sqlite_temp_master
390
+ WHERE name='index_enrollments_on_canvas_course_id' AND type='index'
391
+ 
392
+  (0.1ms)  SELECT sql
393
+ FROM sqlite_master
394
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
395
+ UNION ALL
396
+ SELECT sql
397
+ FROM sqlite_temp_master
398
+ WHERE name='index_enrollments_on_canvas_enrollment_id' AND type='index'
399
+ 
400
+  (0.1ms)  SELECT sql
401
+ FROM sqlite_master
402
+ WHERE name='index_sections_on_canvas_course_id' AND type='index'
403
+ UNION ALL
404
+ SELECT sql
405
+ FROM sqlite_temp_master
406
+ WHERE name='index_sections_on_canvas_course_id' AND type='index'
407
+ 
408
+  (0.1ms)  SELECT sql
409
+ FROM sqlite_master
410
+ WHERE name='index_sections_on_canvas_section_id' AND type='index'
411
+ UNION ALL
412
+ SELECT sql
413
+ FROM sqlite_temp_master
414
+ WHERE name='index_sections_on_canvas_section_id' AND type='index'
415
+ 
416
+  (0.1ms)  SELECT sql
417
+ FROM sqlite_master
418
+ WHERE name='index_terms_on_canvas_term_id' AND type='index'
419
+ UNION ALL
420
+ SELECT sql
421
+ FROM sqlite_temp_master
422
+ WHERE name='index_terms_on_canvas_term_id' AND type='index'
423
+ 
424
+  (0.1ms)  SELECT sql
425
+ FROM sqlite_master
426
+ WHERE name='index_users_on_canvas_user_id' AND type='index'
427
+ UNION ALL
428
+ SELECT sql
429
+ FROM sqlite_temp_master
430
+ WHERE name='index_users_on_canvas_user_id' AND type='index'
431
+