canvas_sync 0.9.4 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -0
  3. data/lib/canvas_sync/api_syncable.rb +1 -0
  4. data/lib/canvas_sync/generators/install_generator.rb +3 -3
  5. data/lib/canvas_sync/generators/templates/migrations/create_accounts.rb +17 -0
  6. data/lib/canvas_sync/generators/templates/{models → migrations}/create_admins.rb +2 -2
  7. data/lib/canvas_sync/generators/templates/{models → migrations}/create_assignment_groups.rb +2 -2
  8. data/lib/canvas_sync/generators/templates/{models → migrations}/create_assignments.rb +7 -7
  9. data/lib/canvas_sync/generators/templates/{models → migrations}/create_context_module_items.rb +4 -4
  10. data/lib/canvas_sync/generators/templates/{models → migrations}/create_context_modules.rb +2 -2
  11. data/lib/canvas_sync/generators/templates/{models → migrations}/create_courses.rb +7 -8
  12. data/lib/canvas_sync/generators/templates/{models → migrations}/create_enrollments.rb +4 -6
  13. data/lib/canvas_sync/generators/templates/{models → migrations}/create_roles.rb +2 -2
  14. data/lib/canvas_sync/generators/templates/{models → migrations}/create_sections.rb +5 -5
  15. data/lib/canvas_sync/generators/templates/{models → migrations}/create_submissions.rb +2 -2
  16. data/lib/canvas_sync/generators/templates/{models → migrations}/create_terms.rb +2 -2
  17. data/lib/canvas_sync/generators/templates/{models → migrations}/create_users.rb +4 -4
  18. data/lib/canvas_sync/generators/templates/models/account.rb +4 -4
  19. data/lib/canvas_sync/generators/templates/models/admin.rb +4 -4
  20. data/lib/canvas_sync/generators/templates/models/assignment.rb +10 -9
  21. data/lib/canvas_sync/generators/templates/models/assignment_group.rb +5 -5
  22. data/lib/canvas_sync/generators/templates/models/context_module.rb +2 -2
  23. data/lib/canvas_sync/generators/templates/models/context_module_item.rb +3 -2
  24. data/lib/canvas_sync/generators/templates/models/course.rb +14 -14
  25. data/lib/canvas_sync/generators/templates/models/enrollment.rb +10 -9
  26. data/lib/canvas_sync/generators/templates/models/role.rb +3 -3
  27. data/lib/canvas_sync/generators/templates/models/section.rb +6 -6
  28. data/lib/canvas_sync/generators/templates/models/submission.rb +5 -5
  29. data/lib/canvas_sync/generators/templates/models/term.rb +4 -3
  30. data/lib/canvas_sync/generators/templates/models/user.rb +6 -6
  31. data/lib/canvas_sync/generators/templates/services/live_events/base_event.rb +4 -0
  32. data/lib/canvas_sync/generators/templates/services/live_events/course/course_event.rb +1 -1
  33. data/lib/canvas_sync/generators/templates/services/live_events/course_section/course_section_event.rb +4 -4
  34. data/lib/canvas_sync/generators/templates/services/live_events/module/module_event.rb +1 -1
  35. data/lib/canvas_sync/generators/templates/services/live_events/module_item/module_item_event.rb +3 -3
  36. data/lib/canvas_sync/generators/templates/services/live_events/user/user_event.rb +1 -1
  37. data/lib/canvas_sync/jobs/sync_provisioning_report_job.rb +7 -2
  38. data/lib/canvas_sync/jobs/sync_simple_table_job.rb +7 -2
  39. data/lib/canvas_sync/processors/model_mappings.yml +35 -41
  40. data/lib/canvas_sync/version.rb +1 -1
  41. data/spec/canvas_sync/jobs/sync_provisioning_report_job_spec.rb +4 -4
  42. data/spec/canvas_sync/jobs/sync_simple_table_job_spec.rb +3 -3
  43. data/spec/canvas_sync/models/accounts_spec.rb +2 -2
  44. data/spec/canvas_sync/models/admins_spec.rb +3 -3
  45. data/spec/canvas_sync/models/assignment_group_spec.rb +4 -4
  46. data/spec/canvas_sync/models/assignment_spec.rb +8 -8
  47. data/spec/canvas_sync/models/context_module_spec.rb +2 -2
  48. data/spec/canvas_sync/models/course_spec.rb +7 -8
  49. data/spec/canvas_sync/models/enrollment_spec.rb +5 -5
  50. data/spec/canvas_sync/models/roles_spec.rb +3 -3
  51. data/spec/canvas_sync/models/section_spec.rb +4 -4
  52. data/spec/canvas_sync/models/submission_spec.rb +5 -5
  53. data/spec/canvas_sync/models/term_spec.rb +7 -7
  54. data/spec/canvas_sync/models/user_spec.rb +4 -4
  55. data/spec/canvas_sync/processors/provisioning_report_processor_spec.rb +5 -5
  56. data/spec/canvas_sync/services/module_event_spec.rb +1 -1
  57. data/spec/canvas_sync/services/module_item_event_spec.rb +7 -7
  58. data/spec/dummy/app/models/account.rb +9 -1
  59. data/spec/dummy/app/models/admin.rb +4 -4
  60. data/spec/dummy/app/models/assignment.rb +23 -5
  61. data/spec/dummy/app/models/assignment_group.rb +15 -3
  62. data/spec/dummy/app/models/context_module.rb +2 -2
  63. data/spec/dummy/app/models/context_module_item.rb +3 -2
  64. data/spec/dummy/app/models/course.rb +20 -7
  65. data/spec/dummy/app/models/enrollment.rb +20 -4
  66. data/spec/dummy/app/models/role.rb +3 -3
  67. data/spec/dummy/app/models/section.rb +14 -3
  68. data/spec/dummy/app/models/submission.rb +16 -4
  69. data/spec/dummy/app/models/term.rb +4 -3
  70. data/spec/dummy/app/models/user.rb +15 -4
  71. data/spec/dummy/app/services/live_events/base_event.rb +4 -0
  72. data/spec/dummy/app/services/live_events/course_event.rb +1 -1
  73. data/spec/dummy/app/services/live_events/course_section_event.rb +4 -4
  74. data/spec/dummy/app/services/live_events/module_event.rb +1 -1
  75. data/spec/dummy/app/services/live_events/module_item_event.rb +3 -3
  76. data/spec/dummy/app/services/live_events/user_event.rb +1 -1
  77. data/spec/dummy/db/migrate/{20180216171618_create_submissions.rb → 20190521003447_create_submissions.rb} +4 -4
  78. data/spec/dummy/db/migrate/{20180103162102_create_roles.rb → 20190521003448_create_roles.rb} +2 -2
  79. data/spec/dummy/db/migrate/{20180109210452_create_admins.rb → 20190521003449_create_admins.rb} +2 -2
  80. data/spec/dummy/db/migrate/{20180222163506_create_assignment_groups.rb → 20190521003450_create_assignment_groups.rb} +2 -2
  81. data/spec/dummy/db/migrate/{20180411215348_create_context_modules.rb → 20190521003451_create_context_modules.rb} +2 -2
  82. data/spec/dummy/db/migrate/{20180215214227_create_assignments.rb → 20190603192310_create_assignments.rb} +11 -11
  83. data/spec/dummy/db/migrate/{20180605172338_create_context_module_items.rb → 20190603193502_create_context_module_items.rb} +4 -4
  84. data/spec/dummy/db/migrate/{20180509194201_create_users.rb → 20190603215718_create_users.rb} +4 -4
  85. data/spec/dummy/db/migrate/{20170906193506_create_terms.rb → 20190603215721_create_terms.rb} +2 -2
  86. data/spec/dummy/db/migrate/{20171107213207_create_sections.rb → 20190603215722_create_sections.rb} +5 -5
  87. data/spec/dummy/db/migrate/{20170914181345_create_courses.rb → 20190603220011_create_courses.rb} +7 -8
  88. data/spec/dummy/db/migrate/{20170905192509_create_enrollments.rb → 20190603220013_create_enrollments.rb} +4 -6
  89. data/spec/dummy/db/migrate/{20180220172559_create_accounts.rb → 20190604193942_create_accounts.rb} +6 -6
  90. data/spec/dummy/db/schema.rb +56 -58
  91. data/spec/dummy/log/test.log +1350 -0
  92. data/spec/factories/account_factory.rb +5 -5
  93. data/spec/factories/admin_factory.rb +1 -1
  94. data/spec/factories/assignment_factory.rb +1 -1
  95. data/spec/factories/assignment_group_factory.rb +1 -1
  96. data/spec/factories/context_module_factory.rb +2 -2
  97. data/spec/factories/context_module_item_factory.rb +1 -1
  98. data/spec/factories/course_factory.rb +5 -5
  99. data/spec/factories/enrollment_factory.rb +1 -1
  100. data/spec/factories/role_factory.rb +1 -1
  101. data/spec/factories/section_factory.rb +1 -1
  102. data/spec/factories/submission_factory.rb +1 -1
  103. data/spec/factories/term_factory.rb +1 -1
  104. data/spec/factories/user_factory.rb +1 -1
  105. data/spec/spec_helper.rb +1 -0
  106. metadata +41 -41
  107. data/lib/canvas_sync/generators/templates/models/create_accounts.rb +0 -17
@@ -9,7 +9,7 @@
9
9
  class CreateRoles < ActiveRecord::Migration[5.1]
10
10
  def change
11
11
  create_table :roles do |t|
12
- t.integer :canvas_role_id, null: false
12
+ t.integer :canvas_id, null: false
13
13
  t.string :label, null: false
14
14
  t.string :base_role_type, null: false
15
15
  t.json :account
@@ -18,6 +18,6 @@ class CreateRoles < ActiveRecord::Migration[5.1]
18
18
 
19
19
  t.timestamps
20
20
  end
21
- add_index :roles, :canvas_role_id, unique: true
21
+ add_index :roles, :canvas_id, unique: true
22
22
  end
23
23
  end
@@ -9,7 +9,7 @@
9
9
  class CreateAdmins < ActiveRecord::Migration[5.1]
10
10
  def change
11
11
  create_table :admins do |t|
12
- t.bigint :canvas_admin_id, null: false
12
+ t.bigint :canvas_id, null: false
13
13
  t.string :role_name
14
14
  t.bigint :canvas_role_id, null: false
15
15
  t.json :user_data
@@ -18,6 +18,6 @@ class CreateAdmins < ActiveRecord::Migration[5.1]
18
18
 
19
19
  t.timestamps
20
20
  end
21
- add_index :admins, :canvas_admin_id, unique: true
21
+ add_index :admins, :canvas_id, unique: true
22
22
  end
23
23
  end
@@ -9,7 +9,7 @@
9
9
  class CreateAssignmentGroups < ActiveRecord::Migration[5.1]
10
10
  def change
11
11
  create_table :assignment_groups do |t|
12
- t.bigint :canvas_assignment_group_id, null: false
12
+ t.bigint :canvas_id, null: false
13
13
  t.bigint :canvas_course_id
14
14
  t.string :name
15
15
  t.text :rules
@@ -22,7 +22,7 @@ class CreateAssignmentGroups < ActiveRecord::Migration[5.1]
22
22
  t.timestamps
23
23
  end
24
24
 
25
- add_index :assignment_groups, :canvas_assignment_group_id, unique: true
25
+ add_index :assignment_groups, :canvas_id, unique: true
26
26
  add_index :assignment_groups, :canvas_course_id
27
27
  end
28
28
  end
@@ -9,7 +9,7 @@
9
9
  class CreateContextModules < ActiveRecord::Migration[5.1]
10
10
  def change
11
11
  create_table :context_modules do |t|
12
- t.bigint :canvas_context_module_id
12
+ t.bigint :canvas_id
13
13
  t.bigint :canvas_context_id
14
14
  t.string :canvas_context_type
15
15
  t.integer :position
@@ -20,7 +20,7 @@ class CreateContextModules < ActiveRecord::Migration[5.1]
20
20
  t.timestamps
21
21
  end
22
22
 
23
- add_index :context_modules, :canvas_context_module_id, unique: true
23
+ add_index :context_modules, :canvas_id, unique: true
24
24
  add_index :context_modules, [:canvas_context_id, :canvas_context_type], name: "index_context_modules_on_context"
25
25
  end
26
26
  end
@@ -9,29 +9,29 @@
9
9
  class CreateAssignments < ActiveRecord::Migration[5.1]
10
10
  def change
11
11
  create_table :assignments do |t|
12
- t.bigint :canvas_assignment_id, null: false
12
+ t.bigint :canvas_id, null: false
13
13
  t.string :title
14
14
  t.text :description
15
15
  t.datetime :due_at
16
16
  t.datetime :unlock_at
17
17
  t.datetime :lock_at
18
- t.integer :points_possible
19
- t.integer :min_score
20
- t.integer :max_score
21
- t.integer :mastery_score
18
+ t.float :points_possible
19
+ t.float :min_score
20
+ t.float :max_score
21
+ t.float :mastery_score
22
22
  t.string :grading_type
23
23
  t.string :submission_types
24
24
  t.string :workflow_state
25
- t.integer :context_id
26
- t.string :context_type
25
+ t.integer :canvas_context_id
26
+ t.string :canvas_context_type
27
27
  t.integer :canvas_assignment_group_id
28
- t.integer :grading_scheme_id
29
- t.integer :grading_standard_id
28
+ t.integer :canvas_grading_scheme_id
29
+ t.integer :canvas_grading_standard_id
30
30
 
31
31
  t.timestamps
32
32
  end
33
33
 
34
- add_index :assignments, :canvas_assignment_id, unique: true
35
- add_index :assignments, [:context_id, :context_type]
34
+ add_index :assignments, :canvas_id, unique: true
35
+ add_index :assignments, [:canvas_context_id, :canvas_context_type]
36
36
  end
37
37
  end
@@ -9,18 +9,18 @@
9
9
  class CreateContextModuleItems < ActiveRecord::Migration[5.1]
10
10
  def change
11
11
  create_table :context_module_items do |t|
12
- t.bigint :canvas_context_module_item_id
12
+ t.bigint :canvas_id
13
13
  t.bigint :canvas_context_module_id
14
14
  t.integer :position
15
- t.string :content_type
16
- t.bigint :content_id
15
+ t.bigint :canvas_content_id
16
+ t.string :canvas_content_type
17
17
  t.bigint :canvas_assignment_id
18
18
  t.string :workflow_state
19
19
 
20
20
  t.timestamps
21
21
  end
22
22
 
23
- add_index :context_module_items, :canvas_context_module_item_id, unique: true
23
+ add_index :context_module_items, :canvas_id, unique: true
24
24
  add_index :context_module_items, :canvas_context_module_id
25
25
  end
26
26
  end
@@ -9,19 +9,19 @@
9
9
  class CreateUsers < ActiveRecord::Migration[5.1]
10
10
  def change
11
11
  create_table :users do |t|
12
- t.bigint :canvas_user_id, null: false
12
+ t.bigint :canvas_id, null: false
13
13
  t.string :sis_id
14
14
  t.string :email
15
15
  t.string :first_name
16
16
  t.string :last_name
17
- t.string :status
17
+ t.string :workflow_state
18
18
  t.string :login_id
19
- t.string :full_name
19
+ t.string :name
20
20
  t.string :sortable_name
21
21
 
22
22
  t.timestamps
23
23
  end
24
24
 
25
- add_index :users, :canvas_user_id, unique: true
25
+ add_index :users, :canvas_id, unique: true
26
26
  end
27
27
  end
@@ -9,7 +9,7 @@
9
9
  class CreateTerms < ActiveRecord::Migration[5.1]
10
10
  def change
11
11
  create_table :terms do |t|
12
- t.integer :canvas_term_id, null: false
12
+ t.integer :canvas_id, null: false
13
13
  t.string :name
14
14
  t.datetime :start_at
15
15
  t.datetime :end_at
@@ -19,6 +19,6 @@ class CreateTerms < ActiveRecord::Migration[5.1]
19
19
 
20
20
  t.timestamps
21
21
  end
22
- add_index :terms, :canvas_term_id, unique: true
22
+ add_index :terms, :canvas_id, unique: true
23
23
  end
24
24
  end
@@ -9,19 +9,19 @@
9
9
  class CreateSections < ActiveRecord::Migration[5.1]
10
10
  def change
11
11
  create_table :sections do |t|
12
- t.bigint :canvas_section_id, null: false
12
+ t.bigint :canvas_id, null: false
13
13
  t.string :sis_id
14
14
  t.bigint :canvas_course_id
15
15
  t.bigint :canvas_nonxlist_course_id
16
16
  t.string :name
17
- t.string :status
18
- t.datetime :start_date
19
- t.datetime :end_date
17
+ t.string :workflow_state
18
+ t.datetime :start_at
19
+ t.datetime :end_at
20
20
 
21
21
  t.timestamps
22
22
  end
23
23
 
24
- add_index :sections, :canvas_section_id, unique: true
24
+ add_index :sections, :canvas_id, unique: true
25
25
  add_index :sections, :canvas_course_id
26
26
  end
27
27
  end
@@ -9,20 +9,19 @@
9
9
  class CreateCourses < ActiveRecord::Migration[5.1]
10
10
  def change
11
11
  create_table :courses do |t|
12
- t.bigint :canvas_course_id, null: false
12
+ t.bigint :canvas_id, null: false
13
13
  t.string :sis_id
14
- t.string :short_name
15
- t.string :long_name
16
- t.string :status
14
+ t.string :course_code
15
+ t.string :name
16
+ t.string :workflow_state
17
17
  t.integer :canvas_account_id
18
18
  t.integer :canvas_term_id
19
- t.integer :term_sis_id
20
- t.datetime :start_date
21
- t.datetime :end_date
19
+ t.datetime :start_at
20
+ t.datetime :end_at
22
21
 
23
22
  t.timestamps
24
23
  end
25
24
 
26
- add_index :courses, :canvas_course_id, unique: true
25
+ add_index :courses, :canvas_id, unique: true
27
26
  end
28
27
  end
@@ -9,23 +9,21 @@
9
9
  class CreateEnrollments < ActiveRecord::Migration[5.1]
10
10
  def change
11
11
  create_table :enrollments do |t|
12
- t.bigint :canvas_enrollment_id, null: false
12
+ t.bigint :canvas_id, null: false
13
13
  t.bigint :canvas_course_id
14
14
  t.string :course_sis_id
15
15
  t.bigint :canvas_user_id
16
16
  t.string :user_sis_id
17
17
  t.string :role
18
- t.integer :role_id
18
+ t.integer :canvas_role_id
19
19
  t.bigint :canvas_section_id
20
- t.string :section_sis_id
21
- t.string :status
20
+ t.string :workflow_state
22
21
  t.string :base_role_type
23
22
 
24
-
25
23
  t.timestamps
26
24
  end
27
25
 
28
- add_index :enrollments, :canvas_enrollment_id, unique: true
26
+ add_index :enrollments, :canvas_id, unique: true
29
27
  add_index :enrollments, :canvas_course_id
30
28
  add_index :enrollments, :canvas_user_id
31
29
  end
@@ -9,15 +9,15 @@
9
9
  class CreateAccounts < ActiveRecord::Migration[5.1]
10
10
  def change
11
11
  create_table :accounts do |t|
12
- t.bigint :canvas_account_id, null: false
13
- t.string :account_id
14
- t.bigint :canvas_parent_id
15
- t.string :parent_account_id
12
+ t.bigint :canvas_id, null: false
13
+ t.string :sis_id
14
+ t.bigint :canvas_parent_account_id
15
+ t.string :sis_parent_account_id
16
16
  t.string :name
17
- t.string :status
17
+ t.string :workflow_state
18
18
 
19
19
  t.timestamps
20
20
  end
21
- add_index :accounts, :canvas_account_id, unique: true
21
+ add_index :accounts, :canvas_id, unique: true
22
22
  end
23
23
  end
@@ -10,25 +10,25 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 20180725155729) do
13
+ ActiveRecord::Schema.define(version: 20190604193942) do
14
14
 
15
15
  # These are extensions that must be enabled in order to support this database
16
16
  enable_extension "plpgsql"
17
17
 
18
18
  create_table "accounts", force: :cascade do |t|
19
- t.bigint "canvas_account_id", null: false
20
- t.string "account_id"
21
- t.bigint "canvas_parent_id"
22
- t.string "parent_account_id"
19
+ t.bigint "canvas_id", null: false
20
+ t.string "sis_id"
21
+ t.bigint "canvas_parent_account_id"
22
+ t.string "sis_parent_account_id"
23
23
  t.string "name"
24
- t.string "status"
24
+ t.string "workflow_state"
25
25
  t.datetime "created_at", null: false
26
26
  t.datetime "updated_at", null: false
27
- t.index ["canvas_account_id"], name: "index_accounts_on_canvas_account_id", unique: true
27
+ t.index ["canvas_id"], name: "index_accounts_on_canvas_id", unique: true
28
28
  end
29
29
 
30
30
  create_table "admins", force: :cascade do |t|
31
- t.bigint "canvas_admin_id", null: false
31
+ t.bigint "canvas_id", null: false
32
32
  t.string "role_name"
33
33
  t.bigint "canvas_role_id", null: false
34
34
  t.json "user_data"
@@ -36,11 +36,11 @@ ActiveRecord::Schema.define(version: 20180725155729) do
36
36
  t.string "workflow_state", null: false
37
37
  t.datetime "created_at", null: false
38
38
  t.datetime "updated_at", null: false
39
- t.index ["canvas_admin_id"], name: "index_admins_on_canvas_admin_id", unique: true
39
+ t.index ["canvas_id"], name: "index_admins_on_canvas_id", unique: true
40
40
  end
41
41
 
42
42
  create_table "assignment_groups", force: :cascade do |t|
43
- t.bigint "canvas_assignment_group_id", null: false
43
+ t.bigint "canvas_id", null: false
44
44
  t.bigint "canvas_course_id"
45
45
  t.string "name"
46
46
  t.text "rules"
@@ -51,33 +51,33 @@ ActiveRecord::Schema.define(version: 20180725155729) do
51
51
  t.datetime "canvas_updated_at"
52
52
  t.datetime "created_at", null: false
53
53
  t.datetime "updated_at", null: false
54
- t.index ["canvas_assignment_group_id"], name: "index_assignment_groups_on_canvas_assignment_group_id", unique: true
55
54
  t.index ["canvas_course_id"], name: "index_assignment_groups_on_canvas_course_id"
55
+ t.index ["canvas_id"], name: "index_assignment_groups_on_canvas_id", unique: true
56
56
  end
57
57
 
58
58
  create_table "assignments", force: :cascade do |t|
59
- t.bigint "canvas_assignment_id", null: false
59
+ t.bigint "canvas_id", null: false
60
60
  t.string "title"
61
61
  t.text "description"
62
62
  t.datetime "due_at"
63
63
  t.datetime "unlock_at"
64
64
  t.datetime "lock_at"
65
- t.integer "points_possible"
66
- t.integer "min_score"
67
- t.integer "max_score"
68
- t.integer "mastery_score"
65
+ t.float "points_possible"
66
+ t.float "min_score"
67
+ t.float "max_score"
68
+ t.float "mastery_score"
69
69
  t.string "grading_type"
70
70
  t.string "submission_types"
71
71
  t.string "workflow_state"
72
- t.integer "context_id"
73
- t.string "context_type"
72
+ t.integer "canvas_context_id"
73
+ t.string "canvas_context_type"
74
74
  t.integer "canvas_assignment_group_id"
75
- t.integer "grading_scheme_id"
76
- t.integer "grading_standard_id"
75
+ t.integer "canvas_grading_scheme_id"
76
+ t.integer "canvas_grading_standard_id"
77
77
  t.datetime "created_at", null: false
78
78
  t.datetime "updated_at", null: false
79
- t.index ["canvas_assignment_id"], name: "index_assignments_on_canvas_assignment_id", unique: true
80
- t.index ["context_id", "context_type"], name: "index_assignments_on_context_id_and_context_type"
79
+ t.index ["canvas_context_id", "canvas_context_type"], name: "index_assignments_on_canvas_context_id_and_canvas_context_type"
80
+ t.index ["canvas_id"], name: "index_assignments_on_canvas_id", unique: true
81
81
  end
82
82
 
83
83
  create_table "canvas_sync_job_logs", force: :cascade do |t|
@@ -96,21 +96,21 @@ ActiveRecord::Schema.define(version: 20180725155729) do
96
96
  end
97
97
 
98
98
  create_table "context_module_items", force: :cascade do |t|
99
- t.bigint "canvas_context_module_item_id"
99
+ t.bigint "canvas_id"
100
100
  t.bigint "canvas_context_module_id"
101
101
  t.integer "position"
102
- t.string "content_type"
103
- t.bigint "content_id"
102
+ t.bigint "canvas_content_id"
103
+ t.string "canvas_content_type"
104
104
  t.bigint "canvas_assignment_id"
105
105
  t.string "workflow_state"
106
106
  t.datetime "created_at", null: false
107
107
  t.datetime "updated_at", null: false
108
108
  t.index ["canvas_context_module_id"], name: "index_context_module_items_on_canvas_context_module_id"
109
- t.index ["canvas_context_module_item_id"], name: "index_context_module_items_on_canvas_context_module_item_id", unique: true
109
+ t.index ["canvas_id"], name: "index_context_module_items_on_canvas_id", unique: true
110
110
  end
111
111
 
112
112
  create_table "context_modules", force: :cascade do |t|
113
- t.bigint "canvas_context_module_id"
113
+ t.bigint "canvas_id"
114
114
  t.bigint "canvas_context_id"
115
115
  t.string "canvas_context_type"
116
116
  t.integer "position"
@@ -121,46 +121,44 @@ ActiveRecord::Schema.define(version: 20180725155729) do
121
121
  t.datetime "created_at", null: false
122
122
  t.datetime "updated_at", null: false
123
123
  t.index ["canvas_context_id", "canvas_context_type"], name: "index_context_modules_on_context"
124
- t.index ["canvas_context_module_id"], name: "index_context_modules_on_canvas_context_module_id", unique: true
124
+ t.index ["canvas_id"], name: "index_context_modules_on_canvas_id", unique: true
125
125
  end
126
126
 
127
127
  create_table "courses", force: :cascade do |t|
128
- t.bigint "canvas_course_id", null: false
128
+ t.bigint "canvas_id", null: false
129
129
  t.string "sis_id"
130
- t.string "short_name"
131
- t.string "long_name"
132
- t.string "status"
130
+ t.string "course_code"
131
+ t.string "name"
132
+ t.string "workflow_state"
133
133
  t.integer "canvas_account_id"
134
134
  t.integer "canvas_term_id"
135
- t.integer "term_sis_id"
136
- t.datetime "start_date"
137
- t.datetime "end_date"
135
+ t.datetime "start_at"
136
+ t.datetime "end_at"
138
137
  t.datetime "created_at", null: false
139
138
  t.datetime "updated_at", null: false
140
- t.index ["canvas_course_id"], name: "index_courses_on_canvas_course_id", unique: true
139
+ t.index ["canvas_id"], name: "index_courses_on_canvas_id", unique: true
141
140
  end
142
141
 
143
142
  create_table "enrollments", force: :cascade do |t|
144
- t.bigint "canvas_enrollment_id", null: false
143
+ t.bigint "canvas_id", null: false
145
144
  t.bigint "canvas_course_id"
146
145
  t.string "course_sis_id"
147
146
  t.bigint "canvas_user_id"
148
147
  t.string "user_sis_id"
149
148
  t.string "role"
150
- t.integer "role_id"
149
+ t.integer "canvas_role_id"
151
150
  t.bigint "canvas_section_id"
152
- t.string "section_sis_id"
153
- t.string "status"
151
+ t.string "workflow_state"
154
152
  t.string "base_role_type"
155
153
  t.datetime "created_at", null: false
156
154
  t.datetime "updated_at", null: false
157
155
  t.index ["canvas_course_id"], name: "index_enrollments_on_canvas_course_id"
158
- t.index ["canvas_enrollment_id"], name: "index_enrollments_on_canvas_enrollment_id", unique: true
156
+ t.index ["canvas_id"], name: "index_enrollments_on_canvas_id", unique: true
159
157
  t.index ["canvas_user_id"], name: "index_enrollments_on_canvas_user_id"
160
158
  end
161
159
 
162
160
  create_table "roles", force: :cascade do |t|
163
- t.integer "canvas_role_id", null: false
161
+ t.integer "canvas_id", null: false
164
162
  t.string "label", null: false
165
163
  t.string "base_role_type", null: false
166
164
  t.json "account"
@@ -168,45 +166,45 @@ ActiveRecord::Schema.define(version: 20180725155729) do
168
166
  t.json "permissions"
169
167
  t.datetime "created_at", null: false
170
168
  t.datetime "updated_at", null: false
171
- t.index ["canvas_role_id"], name: "index_roles_on_canvas_role_id", unique: true
169
+ t.index ["canvas_id"], name: "index_roles_on_canvas_id", unique: true
172
170
  end
173
171
 
174
172
  create_table "sections", force: :cascade do |t|
175
- t.bigint "canvas_section_id", null: false
173
+ t.bigint "canvas_id", null: false
176
174
  t.string "sis_id"
177
175
  t.bigint "canvas_course_id"
178
176
  t.bigint "canvas_nonxlist_course_id"
179
177
  t.string "name"
180
- t.string "status"
181
- t.datetime "start_date"
182
- t.datetime "end_date"
178
+ t.string "workflow_state"
179
+ t.datetime "start_at"
180
+ t.datetime "end_at"
183
181
  t.datetime "created_at", null: false
184
182
  t.datetime "updated_at", null: false
185
183
  t.index ["canvas_course_id"], name: "index_sections_on_canvas_course_id"
186
- t.index ["canvas_section_id"], name: "index_sections_on_canvas_section_id", unique: true
184
+ t.index ["canvas_id"], name: "index_sections_on_canvas_id", unique: true
187
185
  end
188
186
 
189
187
  create_table "submissions", force: :cascade do |t|
190
- t.bigint "canvas_submission_id", null: false
188
+ t.bigint "canvas_id", null: false
191
189
  t.bigint "canvas_course_id"
192
190
  t.bigint "canvas_assignment_id"
193
191
  t.bigint "canvas_user_id"
194
192
  t.datetime "submitted_at"
195
193
  t.datetime "graded_at"
196
- t.integer "score"
197
- t.integer "points_possible"
194
+ t.float "score"
195
+ t.float "points_possible"
198
196
  t.boolean "excused"
199
197
  t.string "workflow_state"
200
198
  t.datetime "created_at", null: false
201
199
  t.datetime "updated_at", null: false
202
200
  t.index ["canvas_assignment_id"], name: "index_submissions_on_canvas_assignment_id"
203
201
  t.index ["canvas_course_id"], name: "index_submissions_on_canvas_course_id"
204
- t.index ["canvas_submission_id"], name: "index_submissions_on_canvas_submission_id", unique: true
202
+ t.index ["canvas_id"], name: "index_submissions_on_canvas_id", unique: true
205
203
  t.index ["canvas_user_id"], name: "index_submissions_on_canvas_user_id"
206
204
  end
207
205
 
208
206
  create_table "terms", force: :cascade do |t|
209
- t.integer "canvas_term_id", null: false
207
+ t.integer "canvas_id", null: false
210
208
  t.string "name"
211
209
  t.datetime "start_at"
212
210
  t.datetime "end_at"
@@ -215,22 +213,22 @@ ActiveRecord::Schema.define(version: 20180725155729) do
215
213
  t.string "sis_id"
216
214
  t.datetime "created_at", null: false
217
215
  t.datetime "updated_at", null: false
218
- t.index ["canvas_term_id"], name: "index_terms_on_canvas_term_id", unique: true
216
+ t.index ["canvas_id"], name: "index_terms_on_canvas_id", unique: true
219
217
  end
220
218
 
221
219
  create_table "users", force: :cascade do |t|
222
- t.bigint "canvas_user_id", null: false
220
+ t.bigint "canvas_id", null: false
223
221
  t.string "sis_id"
224
222
  t.string "email"
225
223
  t.string "first_name"
226
224
  t.string "last_name"
227
- t.string "status"
225
+ t.string "workflow_state"
228
226
  t.string "login_id"
229
- t.string "full_name"
227
+ t.string "name"
230
228
  t.string "sortable_name"
231
229
  t.datetime "created_at", null: false
232
230
  t.datetime "updated_at", null: false
233
- t.index ["canvas_user_id"], name: "index_users_on_canvas_user_id", unique: true
231
+ t.index ["canvas_id"], name: "index_users_on_canvas_id", unique: true
234
232
  end
235
233
 
236
234
  end