canvas_sync 0.16.4 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +235 -151
- data/app/controllers/{api → canvas_sync/api}/v1/health_check_controller.rb +1 -1
- data/app/controllers/canvas_sync/api/v1/live_events_controller.rb +122 -0
- data/app/models/canvas_sync/sync_batch.rb +5 -0
- data/config/initializers/apartment.rb +10 -1
- data/config/routes.rb +7 -0
- data/db/migrate/20170915210836_create_canvas_sync_job_log.rb +12 -31
- data/db/migrate/20180725155729_add_job_id_to_canvas_sync_job_logs.rb +4 -13
- data/db/migrate/20190916154829_add_fork_count_to_canvas_sync_job_logs.rb +3 -11
- data/db/migrate/20201018210836_create_canvas_sync_sync_batches.rb +11 -0
- data/db/migrate/20201030210836_add_full_sync_to_canvas_sync_sync_batch.rb +7 -0
- data/lib/canvas_sync/batch_processor.rb +41 -0
- data/lib/canvas_sync/concerns/ability_helper.rb +72 -0
- data/lib/canvas_sync/concerns/account/ancestry.rb +2 -0
- data/lib/canvas_sync/concerns/account/base.rb +15 -0
- data/lib/canvas_sync/concerns/api_syncable.rb +17 -10
- data/lib/canvas_sync/concerns/live_event_sync.rb +46 -0
- data/lib/canvas_sync/concerns/role/base.rb +57 -0
- data/lib/canvas_sync/concerns/sync_mapping.rb +120 -0
- data/lib/canvas_sync/engine.rb +80 -0
- data/lib/canvas_sync/generators/install_generator.rb +1 -0
- data/lib/canvas_sync/generators/install_live_events_generator.rb +0 -1
- data/lib/canvas_sync/generators/templates/migrations/create_content_migrations.rb +24 -0
- data/lib/canvas_sync/generators/templates/migrations/create_course_nicknames.rb +17 -0
- data/lib/canvas_sync/generators/templates/migrations/create_grading_period_groups.rb +18 -0
- data/lib/canvas_sync/generators/templates/migrations/create_grading_periods.rb +22 -0
- data/lib/canvas_sync/generators/templates/migrations/create_learning_outcome_results.rb +46 -0
- data/lib/canvas_sync/generators/templates/migrations/create_learning_outcomes.rb +30 -0
- data/lib/canvas_sync/generators/templates/migrations/create_rubric_assessments.rb +31 -0
- data/lib/canvas_sync/generators/templates/migrations/create_rubric_associations.rb +36 -0
- data/lib/canvas_sync/generators/templates/migrations/create_rubrics.rb +38 -0
- data/lib/canvas_sync/generators/templates/migrations/create_user_observers.rb +17 -0
- data/lib/canvas_sync/generators/templates/migrations/create_users.rb +0 -1
- data/lib/canvas_sync/generators/templates/models/account.rb +3 -0
- data/lib/canvas_sync/generators/templates/models/admin.rb +2 -0
- data/lib/canvas_sync/generators/templates/models/assignment.rb +3 -0
- data/lib/canvas_sync/generators/templates/models/assignment_group.rb +3 -0
- data/lib/canvas_sync/generators/templates/models/content_migration.rb +12 -0
- data/lib/canvas_sync/generators/templates/models/context_module.rb +3 -0
- data/lib/canvas_sync/generators/templates/models/context_module_item.rb +3 -0
- data/lib/canvas_sync/generators/templates/models/course.rb +11 -0
- data/lib/canvas_sync/generators/templates/models/course_nickname.rb +13 -0
- data/lib/canvas_sync/generators/templates/models/enrollment.rb +14 -0
- data/lib/canvas_sync/generators/templates/models/grading_period.rb +10 -0
- data/lib/canvas_sync/generators/templates/models/grading_period_group.rb +9 -0
- data/lib/canvas_sync/generators/templates/models/group.rb +2 -0
- data/lib/canvas_sync/generators/templates/models/group_membership.rb +2 -0
- data/lib/canvas_sync/generators/templates/models/learning_outcome.rb +24 -0
- data/lib/canvas_sync/generators/templates/models/learning_outcome_result.rb +48 -0
- data/lib/canvas_sync/generators/templates/models/pseudonym.rb +2 -0
- data/lib/canvas_sync/generators/templates/models/role.rb +2 -0
- data/lib/canvas_sync/generators/templates/models/rubric.rb +29 -0
- data/lib/canvas_sync/generators/templates/models/rubric_assessment.rb +17 -0
- data/lib/canvas_sync/generators/templates/models/rubric_association.rb +14 -0
- data/lib/canvas_sync/generators/templates/models/section.rb +9 -0
- data/lib/canvas_sync/generators/templates/models/submission.rb +3 -0
- data/lib/canvas_sync/generators/templates/models/term.rb +3 -0
- data/lib/canvas_sync/generators/templates/models/user.rb +11 -0
- data/lib/canvas_sync/generators/templates/models/user_observer.rb +13 -0
- data/lib/canvas_sync/generators/templates/services/live_events/assignment_event.rb +1 -1
- data/lib/canvas_sync/generators/templates/services/live_events/assignment_group_event.rb +1 -1
- data/lib/canvas_sync/generators/templates/services/live_events/course_event.rb +1 -3
- data/lib/canvas_sync/generators/templates/services/live_events/course_section_event.rb +1 -1
- data/lib/canvas_sync/generators/templates/services/live_events/enrollment_event.rb +1 -1
- data/lib/canvas_sync/generators/templates/services/live_events/grade_event.rb +1 -1
- data/lib/canvas_sync/generators/templates/services/live_events/module_event.rb +1 -1
- data/lib/canvas_sync/generators/templates/services/live_events/module_item_event.rb +1 -1
- data/lib/canvas_sync/generators/templates/services/live_events/submission_event.rb +1 -1
- data/lib/canvas_sync/generators/templates/services/live_events/syllabus_event.rb +1 -1
- data/lib/canvas_sync/generators/templates/services/live_events/user_event.rb +1 -3
- data/lib/canvas_sync/importers/bulk_importer.rb +138 -31
- data/lib/canvas_sync/job.rb +7 -5
- data/lib/canvas_sync/job_batches/active_job.rb +108 -0
- data/lib/canvas_sync/job_batches/batch.rb +543 -0
- data/lib/canvas_sync/job_batches/callback.rb +149 -0
- data/lib/canvas_sync/job_batches/chain_builder.rb +249 -0
- data/lib/canvas_sync/job_batches/context_hash.rb +159 -0
- data/lib/canvas_sync/job_batches/hier_batch_ids.lua +25 -0
- data/lib/canvas_sync/job_batches/jobs/base_job.rb +7 -0
- data/lib/canvas_sync/job_batches/jobs/concurrent_batch_job.rb +22 -0
- data/lib/canvas_sync/job_batches/jobs/managed_batch_job.rb +170 -0
- data/lib/canvas_sync/job_batches/jobs/serial_batch_job.rb +22 -0
- data/lib/canvas_sync/job_batches/pool.rb +245 -0
- data/lib/canvas_sync/job_batches/pool_refill.lua +47 -0
- data/lib/canvas_sync/job_batches/redis_model.rb +69 -0
- data/lib/canvas_sync/job_batches/redis_script.rb +163 -0
- data/lib/canvas_sync/job_batches/schedule_callback.lua +14 -0
- data/lib/canvas_sync/job_batches/sidekiq/web/batches_assets/css/styles.less +182 -0
- data/lib/canvas_sync/job_batches/sidekiq/web/batches_assets/js/batch_tree.js +108 -0
- data/lib/canvas_sync/job_batches/sidekiq/web/batches_assets/js/util.js +2 -0
- data/lib/canvas_sync/job_batches/sidekiq/web/helpers.rb +41 -0
- data/lib/canvas_sync/job_batches/sidekiq/web/views/_batch_tree.erb +6 -0
- data/lib/canvas_sync/job_batches/sidekiq/web/views/_batches_table.erb +44 -0
- data/lib/canvas_sync/job_batches/sidekiq/web/views/_common.erb +13 -0
- data/lib/canvas_sync/job_batches/sidekiq/web/views/_jobs_table.erb +21 -0
- data/lib/canvas_sync/job_batches/sidekiq/web/views/_pagination.erb +26 -0
- data/lib/canvas_sync/job_batches/sidekiq/web/views/batch.erb +81 -0
- data/lib/canvas_sync/job_batches/sidekiq/web/views/batches.erb +23 -0
- data/lib/canvas_sync/job_batches/sidekiq/web/views/pool.erb +137 -0
- data/lib/canvas_sync/job_batches/sidekiq/web/views/pools.erb +47 -0
- data/lib/canvas_sync/job_batches/sidekiq/web.rb +218 -0
- data/lib/canvas_sync/job_batches/sidekiq.rb +136 -0
- data/lib/canvas_sync/job_batches/status.rb +91 -0
- data/lib/canvas_sync/jobs/begin_sync_chain_job.rb +99 -0
- data/lib/canvas_sync/jobs/canvas_process_waiter.rb +41 -0
- data/lib/canvas_sync/jobs/report_checker.rb +70 -8
- data/lib/canvas_sync/jobs/report_processor_job.rb +4 -7
- data/lib/canvas_sync/jobs/report_starter.rb +34 -20
- data/lib/canvas_sync/jobs/sync_accounts_job.rb +3 -5
- data/lib/canvas_sync/jobs/sync_admins_job.rb +2 -4
- data/lib/canvas_sync/jobs/sync_assignment_groups_job.rb +2 -4
- data/lib/canvas_sync/jobs/sync_assignments_job.rb +2 -4
- data/lib/canvas_sync/jobs/sync_content_migrations_job.rb +20 -0
- data/lib/canvas_sync/jobs/sync_context_module_items_job.rb +2 -4
- data/lib/canvas_sync/jobs/sync_context_modules_job.rb +2 -4
- data/lib/canvas_sync/jobs/sync_provisioning_report_job.rb +16 -50
- data/lib/canvas_sync/jobs/sync_roles_job.rb +2 -5
- data/lib/canvas_sync/jobs/sync_rubric_assessments_job.rb +15 -0
- data/lib/canvas_sync/jobs/sync_rubric_associations_job.rb +15 -0
- data/lib/canvas_sync/jobs/sync_rubrics_job.rb +15 -0
- data/lib/canvas_sync/jobs/sync_simple_table_job.rb +11 -32
- data/lib/canvas_sync/jobs/sync_submissions_job.rb +6 -4
- data/lib/canvas_sync/jobs/sync_terms_job.rb +9 -8
- data/lib/canvas_sync/jobs/term_batches_job.rb +50 -0
- data/lib/canvas_sync/{generators/templates/services/live_events/base_event.rb → live_events/base_handler.rb} +6 -10
- data/lib/canvas_sync/live_events/process_event_job.rb +26 -0
- data/lib/canvas_sync/live_events.rb +38 -0
- data/lib/canvas_sync/misc_helper.rb +63 -0
- data/lib/canvas_sync/processors/assignment_groups_processor.rb +3 -8
- data/lib/canvas_sync/processors/assignments_processor.rb +3 -8
- data/lib/canvas_sync/processors/content_migrations_processor.rb +19 -0
- data/lib/canvas_sync/processors/context_module_items_processor.rb +3 -8
- data/lib/canvas_sync/processors/context_modules_processor.rb +3 -8
- data/lib/canvas_sync/processors/model_mappings.yml +420 -0
- data/lib/canvas_sync/processors/normal_processor.rb +3 -3
- data/lib/canvas_sync/processors/provisioning_report_processor.rb +42 -55
- data/lib/canvas_sync/processors/report_processor.rb +15 -9
- data/lib/canvas_sync/processors/rubric_assessments_processor.rb +19 -0
- data/lib/canvas_sync/processors/rubric_associations_processor.rb +19 -0
- data/lib/canvas_sync/processors/rubrics_processor.rb +19 -0
- data/lib/canvas_sync/processors/submissions_processor.rb +3 -8
- data/lib/canvas_sync/record.rb +103 -0
- data/lib/canvas_sync/version.rb +1 -1
- data/lib/canvas_sync.rb +124 -125
- data/spec/canvas_sync/canvas_sync_spec.rb +224 -155
- data/spec/canvas_sync/jobs/canvas_process_waiter_spec.rb +34 -0
- data/spec/canvas_sync/jobs/job_spec.rb +9 -17
- data/spec/canvas_sync/jobs/report_checker_spec.rb +1 -3
- data/spec/canvas_sync/jobs/report_processor_job_spec.rb +0 -3
- data/spec/canvas_sync/jobs/report_starter_spec.rb +19 -28
- data/spec/canvas_sync/jobs/sync_admins_job_spec.rb +1 -4
- data/spec/canvas_sync/jobs/sync_assignment_groups_job_spec.rb +2 -1
- data/spec/canvas_sync/jobs/sync_assignments_job_spec.rb +3 -2
- data/spec/canvas_sync/jobs/sync_content_migrations_job_spec.rb +30 -0
- data/spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb +3 -2
- data/spec/canvas_sync/jobs/sync_context_modules_job_spec.rb +3 -2
- data/spec/canvas_sync/jobs/sync_provisioning_report_job_spec.rb +7 -41
- data/spec/canvas_sync/jobs/sync_roles_job_spec.rb +1 -4
- data/spec/canvas_sync/jobs/sync_simple_table_job_spec.rb +5 -12
- data/spec/canvas_sync/jobs/sync_submissions_job_spec.rb +8 -2
- data/spec/canvas_sync/jobs/sync_terms_job_spec.rb +1 -4
- data/spec/canvas_sync/live_events/live_event_sync_spec.rb +27 -0
- data/spec/canvas_sync/live_events/live_events_controller_spec.rb +54 -0
- data/spec/canvas_sync/live_events/process_event_job_spec.rb +38 -0
- data/spec/canvas_sync/misc_helper_spec.rb +58 -0
- data/spec/canvas_sync/models/assignment_spec.rb +1 -1
- data/spec/canvas_sync/processors/content_migrations_processor_spec.rb +13 -0
- data/spec/canvas_sync/processors/provisioning_report_processor_spec.rb +101 -1
- data/spec/canvas_sync/processors/rubric_assessments_spec.rb +16 -0
- data/spec/canvas_sync/processors/rubric_associations_spec.rb +16 -0
- data/spec/canvas_sync/processors/rubrics_processor_spec.rb +17 -0
- data/spec/dummy/app/models/account.rb +6 -0
- data/spec/dummy/app/models/admin.rb +2 -0
- data/spec/dummy/app/models/assignment.rb +3 -0
- data/spec/dummy/app/models/assignment_group.rb +3 -0
- data/spec/dummy/app/models/content_migration.rb +18 -0
- data/spec/dummy/app/models/context_module.rb +3 -0
- data/spec/dummy/app/models/context_module_item.rb +3 -0
- data/spec/dummy/app/models/course.rb +11 -0
- data/spec/dummy/app/models/course_nickname.rb +19 -0
- data/spec/dummy/app/models/enrollment.rb +14 -0
- data/spec/dummy/app/models/grading_period.rb +16 -0
- data/spec/dummy/app/models/grading_period_group.rb +15 -0
- data/spec/dummy/app/models/group.rb +2 -0
- data/spec/dummy/app/models/group_membership.rb +2 -0
- data/spec/dummy/app/models/learning_outcome.rb +30 -0
- data/spec/dummy/app/models/learning_outcome_result.rb +54 -0
- data/spec/dummy/app/models/pseudonym.rb +16 -0
- data/spec/dummy/app/models/role.rb +2 -0
- data/spec/dummy/app/models/rubric.rb +35 -0
- data/spec/dummy/app/models/rubric_assessment.rb +22 -0
- data/spec/dummy/app/models/rubric_association.rb +20 -0
- data/spec/dummy/app/models/section.rb +9 -0
- data/spec/dummy/app/models/submission.rb +4 -0
- data/spec/dummy/app/models/term.rb +3 -0
- data/spec/dummy/app/models/user.rb +11 -0
- data/spec/dummy/app/models/user_observer.rb +19 -0
- data/spec/dummy/app/services/live_events/assignment_event.rb +1 -1
- data/spec/dummy/app/services/live_events/course_event.rb +1 -3
- data/spec/dummy/app/services/live_events/course_section_event.rb +1 -1
- data/spec/dummy/app/services/live_events/enrollment_event.rb +1 -1
- data/spec/dummy/app/services/live_events/grade_event.rb +1 -1
- data/spec/dummy/app/services/live_events/module_event.rb +1 -1
- data/spec/dummy/app/services/live_events/module_item_event.rb +1 -1
- data/spec/dummy/app/services/live_events/submission_event.rb +1 -1
- data/spec/dummy/app/services/live_events/syllabus_event.rb +1 -1
- data/spec/dummy/app/services/live_events/user_event.rb +1 -3
- data/spec/dummy/config/environments/test.rb +2 -0
- data/spec/dummy/config/routes.rb +1 -0
- data/spec/dummy/db/migrate/20201016181346_create_pseudonyms.rb +24 -0
- data/spec/dummy/db/migrate/20210907233329_create_user_observers.rb +23 -0
- data/spec/dummy/db/migrate/20210907233330_create_grading_periods.rb +28 -0
- data/spec/dummy/db/migrate/20211001184920_create_grading_period_groups.rb +24 -0
- data/spec/dummy/db/migrate/20220308072643_create_content_migrations.rb +30 -0
- data/spec/dummy/db/migrate/20220712210559_create_learning_outcomes.rb +36 -0
- data/spec/dummy/db/migrate/{20190702203620_create_users.rb → 20220926221926_create_users.rb} +0 -1
- data/spec/dummy/db/migrate/20240408223326_create_course_nicknames.rb +23 -0
- data/spec/dummy/db/migrate/20240509105100_create_rubrics.rb +44 -0
- data/spec/dummy/db/migrate/20240510094100_create_rubric_associations.rb +42 -0
- data/spec/dummy/db/migrate/20240510101100_create_rubric_assessments.rb +37 -0
- data/spec/dummy/db/migrate/20240523101010_create_learning_outcome_results.rb +52 -0
- data/spec/dummy/db/schema.rb +244 -5
- data/spec/factories/user_factory.rb +0 -1
- data/spec/job_batching/active_job_spec.rb +107 -0
- data/spec/job_batching/batch_spec.rb +489 -0
- data/spec/job_batching/callback_spec.rb +38 -0
- data/spec/job_batching/context_hash_spec.rb +54 -0
- data/spec/job_batching/flow_spec.rb +82 -0
- data/spec/job_batching/integration/fail_then_succeed.rb +42 -0
- data/spec/job_batching/integration/integration.rb +57 -0
- data/spec/job_batching/integration/nested.rb +88 -0
- data/spec/job_batching/integration/simple.rb +47 -0
- data/spec/job_batching/integration/workflow.rb +134 -0
- data/spec/job_batching/integration_helper.rb +50 -0
- data/spec/job_batching/pool_spec.rb +161 -0
- data/spec/job_batching/sidekiq_spec.rb +125 -0
- data/spec/job_batching/status_spec.rb +76 -0
- data/spec/job_batching/support/base_job.rb +14 -0
- data/spec/job_batching/support/sample_callback.rb +2 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/support/fixtures/reports/content_migrations.csv +3 -0
- data/spec/support/fixtures/reports/course_nicknames.csv +3 -0
- data/spec/support/fixtures/reports/grading_period_groups.csv +2 -0
- data/spec/support/fixtures/reports/grading_periods.csv +3 -0
- data/spec/support/fixtures/reports/learning_outcome_results.csv +3 -0
- data/spec/support/fixtures/reports/learning_outcomes.csv +3 -0
- data/spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv +3 -0
- data/spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv +4 -0
- data/spec/support/fixtures/reports/rubric_assessments.csv +3 -0
- data/spec/support/fixtures/reports/rubric_associations.csv +3 -0
- data/spec/support/fixtures/reports/rubrics.csv +3 -0
- data/spec/support/fixtures/reports/user_observers.csv +3 -0
- data/spec/support/fixtures/reports/users.csv +3 -2
- data/spec/support/fixtures/reports/xlist.csv +1 -1
- metadata +329 -27
- data/app/controllers/api/v1/live_events_controller.rb +0 -18
- data/lib/canvas_sync/job_chain.rb +0 -57
- data/lib/canvas_sync/jobs/fork_gather.rb +0 -59
- data/spec/canvas_sync/jobs/fork_gather_spec.rb +0 -73
@@ -0,0 +1,19 @@
|
|
1
|
+
# #
|
2
|
+
# AUTO GENERATED MODEL
|
3
|
+
# This model was auto generated by the CanvasSync Gem.
|
4
|
+
# You can customize it as needed, but make sure you test
|
5
|
+
# any changes you make to the auto generated methods.
|
6
|
+
#
|
7
|
+
|
8
|
+
|
9
|
+
class UserObserver < ApplicationRecord
|
10
|
+
include CanvasSync::Record
|
11
|
+
include CanvasSync::Concerns::ApiSyncable
|
12
|
+
|
13
|
+
canvas_sync_features :defaults
|
14
|
+
|
15
|
+
validates :canvas_id, uniqueness: true, presence: true
|
16
|
+
|
17
|
+
belongs_to :observing_user, primary_key: :canvas_id, foreign_key: :observing_user_id, class_name: 'User', optional: true
|
18
|
+
belongs_to :observed_user, primary_key: :canvas_id, foreign_key: :observed_user_id, class_name: 'User', optional: true
|
19
|
+
end
|
@@ -11,8 +11,7 @@
|
|
11
11
|
|
12
12
|
|
13
13
|
module LiveEvents
|
14
|
-
class CourseEvent < LiveEvents::
|
15
|
-
|
14
|
+
class CourseEvent < CanvasSync::LiveEvents::BaseHandler
|
16
15
|
def process
|
17
16
|
course = Course.where(canvas_id: local_canvas_id(payload[:course_id])).first_or_initialize
|
18
17
|
course.canvas_account_id = local_canvas_id(payload[:account_id])
|
@@ -22,7 +21,6 @@ module LiveEvents
|
|
22
21
|
end
|
23
22
|
course.sync_from_api
|
24
23
|
end
|
25
|
-
|
26
24
|
end
|
27
25
|
|
28
26
|
class CourseCreatedEvent < LiveEvents::CourseEvent; end
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
|
13
13
|
module LiveEvents
|
14
|
-
class CourseSectionEvent < LiveEvents::
|
14
|
+
class CourseSectionEvent < CanvasSync::LiveEvents::BaseHandler
|
15
15
|
|
16
16
|
def process
|
17
17
|
section = Section.where(canvas_id: local_canvas_id(payload[:course_section_id])).first_or_initialize
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
|
13
13
|
module LiveEvents
|
14
|
-
class SubmissionEvent < LiveEvents::
|
14
|
+
class SubmissionEvent < CanvasSync::LiveEvents::BaseHandler
|
15
15
|
|
16
16
|
def process
|
17
17
|
submission = Submission.where(canvas_id: local_canvas_id(payload["submission_id"])).first_or_initialize
|
@@ -11,8 +11,7 @@
|
|
11
11
|
|
12
12
|
|
13
13
|
module LiveEvents
|
14
|
-
class UserEvent < LiveEvents::
|
15
|
-
|
14
|
+
class UserEvent < CanvasSync::LiveEvents::BaseHandler
|
16
15
|
def process
|
17
16
|
canvas_user_id = local_canvas_id(payload[:user_id])
|
18
17
|
user = User.where(canvas_id: canvas_user_id).first_or_initialize
|
@@ -21,7 +20,6 @@ module LiveEvents
|
|
21
20
|
# This can happen when a new user is created, but hasn't setup a login on Canvas yet.
|
22
21
|
Rails.logger.info("Failed to fetch user #{canvas_user_id}: #{e.backtrace}")
|
23
22
|
end
|
24
|
-
|
25
23
|
end
|
26
24
|
|
27
25
|
class UserCreatedEvent < LiveEvents::UserEvent; end
|
@@ -37,6 +37,8 @@ Rails.application.configure do
|
|
37
37
|
# Print deprecation notices to the stderr.
|
38
38
|
config.active_support.deprecation = :stderr
|
39
39
|
|
40
|
+
config.active_job.queue_adapter = :test
|
41
|
+
|
40
42
|
# Raises error for missing translations
|
41
43
|
# config.action_view.raise_on_missing_translations = true
|
42
44
|
end
|
data/spec/dummy/config/routes.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
# #
|
2
|
+
# AUTO GENERATED MIGRATION
|
3
|
+
# This migration was auto generated by the CanvasSync Gem.
|
4
|
+
# You can add new columns to this table, but removing or
|
5
|
+
# re-naming ones created here may break Canvas Syncing.
|
6
|
+
#
|
7
|
+
|
8
|
+
|
9
|
+
class CreatePseudonyms < ActiveRecord::Migration[5.1]
|
10
|
+
def change
|
11
|
+
create_table :pseudonyms do |t|
|
12
|
+
t.bigint :canvas_id, null: false
|
13
|
+
t.bigint :canvas_user_id
|
14
|
+
t.string :sis_id
|
15
|
+
t.string :unique_id
|
16
|
+
t.string :workflow_state
|
17
|
+
|
18
|
+
t.timestamps
|
19
|
+
end
|
20
|
+
|
21
|
+
add_index :pseudonyms, :canvas_id, unique: true
|
22
|
+
add_index :pseudonyms, :canvas_user_id
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# #
|
2
|
+
# AUTO GENERATED MIGRATION
|
3
|
+
# This migration was auto generated by the CanvasSync Gem.
|
4
|
+
# You can add new columns to this table, but removing or
|
5
|
+
# re-naming ones created here may break Canvas Syncing.
|
6
|
+
#
|
7
|
+
|
8
|
+
|
9
|
+
class CreateUserObservers < ActiveRecord::Migration[5.1]
|
10
|
+
def change
|
11
|
+
create_table :user_observers do |t|
|
12
|
+
t.bigint :observing_user_id
|
13
|
+
t.bigint :observed_user_id
|
14
|
+
t.string :workflow_state
|
15
|
+
|
16
|
+
t.timestamps
|
17
|
+
end
|
18
|
+
|
19
|
+
add_index :user_observers, [:observed_user_id, :observing_user_id], unique: true
|
20
|
+
add_index :user_observers, :observing_user_id
|
21
|
+
add_index :user_observers, :observed_user_id
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# #
|
2
|
+
# AUTO GENERATED MIGRATION
|
3
|
+
# This migration was auto generated by the CanvasSync Gem.
|
4
|
+
# You can add new columns to this table, but removing or
|
5
|
+
# re-naming ones created here may break Canvas Syncing.
|
6
|
+
#
|
7
|
+
|
8
|
+
|
9
|
+
class CreateGradingPeriods < ActiveRecord::Migration[5.1]
|
10
|
+
def change
|
11
|
+
create_table :grading_periods do |t|
|
12
|
+
t.bigint :canvas_id, null: false
|
13
|
+
t.string :title
|
14
|
+
t.float :weight
|
15
|
+
t.datetime :start_date
|
16
|
+
t.datetime :end_date
|
17
|
+
t.datetime :close_date
|
18
|
+
t.bigint :canvas_grading_period_group_id
|
19
|
+
|
20
|
+
t.string :workflow_state
|
21
|
+
|
22
|
+
t.timestamps
|
23
|
+
end
|
24
|
+
|
25
|
+
add_index :grading_periods, :canvas_id, unique: true
|
26
|
+
add_index :grading_periods, :canvas_grading_period_group_id
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# #
|
2
|
+
# AUTO GENERATED MIGRATION
|
3
|
+
# This migration was auto generated by the CanvasSync Gem.
|
4
|
+
# You can add new columns to this table, but removing or
|
5
|
+
# re-naming ones created here may break Canvas Syncing.
|
6
|
+
#
|
7
|
+
|
8
|
+
|
9
|
+
class CreateGradingPeriodGroups < ActiveRecord::Migration[5.1]
|
10
|
+
def change
|
11
|
+
create_table :grading_period_groups do |t|
|
12
|
+
t.bigint :canvas_id, null: false
|
13
|
+
t.string :title
|
14
|
+
t.boolean :weighted
|
15
|
+
t.boolean :display_totals_for_all_grading_periods
|
16
|
+
|
17
|
+
t.string :workflow_state
|
18
|
+
|
19
|
+
t.timestamps
|
20
|
+
end
|
21
|
+
|
22
|
+
add_index :grading_period_groups, :canvas_id, unique: true
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# #
|
2
|
+
# AUTO GENERATED MIGRATION
|
3
|
+
# This migration was auto generated by the CanvasSync Gem.
|
4
|
+
# You can add new columns to this table, but removing or
|
5
|
+
# re-naming ones created here may break Canvas Syncing.
|
6
|
+
#
|
7
|
+
|
8
|
+
|
9
|
+
class CreateContentMigrations < ActiveRecord::Migration[5.1]
|
10
|
+
def change
|
11
|
+
create_table :content_migrations do |t|
|
12
|
+
t.bigint :canvas_id
|
13
|
+
t.bigint :canvas_context_id
|
14
|
+
t.string :canvas_context_type
|
15
|
+
t.string :workflow_state
|
16
|
+
t.text :migration_settings
|
17
|
+
t.datetime :started_at
|
18
|
+
t.datetime :finished_at
|
19
|
+
t.float :progress
|
20
|
+
t.bigint :canvas_source_course_id
|
21
|
+
t.string :migration_type
|
22
|
+
t.bigint :canvas_child_subscription_id
|
23
|
+
t.bigint :canvas_root_account_id
|
24
|
+
|
25
|
+
t.timestamps
|
26
|
+
end
|
27
|
+
|
28
|
+
add_index :content_migrations, :canvas_id, unique: true
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# #
|
2
|
+
# AUTO GENERATED MIGRATION
|
3
|
+
# This migration was auto generated by the CanvasSync Gem.
|
4
|
+
# You can add new columns to this table, but removing or
|
5
|
+
# re-naming ones created here may break Canvas Syncing.
|
6
|
+
#
|
7
|
+
|
8
|
+
|
9
|
+
class CreateLearningOutcomes < ActiveRecord::Migration[5.1]
|
10
|
+
def change
|
11
|
+
create_table :learning_outcomes do |t|
|
12
|
+
t.bigint :canvas_id, null: false
|
13
|
+
t.integer :canvas_context_id
|
14
|
+
t.string :canvas_context_type
|
15
|
+
t.string :name
|
16
|
+
t.string :friendly_name
|
17
|
+
t.string :workflow_state
|
18
|
+
t.datetime :canvas_created_at
|
19
|
+
t.datetime :canvas_updated_at
|
20
|
+
t.string :migration_id
|
21
|
+
t.string :vendor_guid
|
22
|
+
t.string :low_grade
|
23
|
+
t.string :high_grade
|
24
|
+
t.string :calculation_method
|
25
|
+
t.string :calculation_int
|
26
|
+
t.integer :outcome_import_id
|
27
|
+
t.integer :root_account_ids, array: true, default: []
|
28
|
+
t.text :description
|
29
|
+
|
30
|
+
t.timestamps
|
31
|
+
end
|
32
|
+
|
33
|
+
add_index :learning_outcomes, :canvas_id, unique: true
|
34
|
+
add_index :learning_outcomes, [:canvas_context_id, :canvas_context_type], name: "index_learning_outcomes_on_context"
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# #
|
2
|
+
# AUTO GENERATED MIGRATION
|
3
|
+
# This migration was auto generated by the CanvasSync Gem.
|
4
|
+
# You can add new columns to this table, but removing or
|
5
|
+
# re-naming ones created here may break Canvas Syncing.
|
6
|
+
#
|
7
|
+
|
8
|
+
|
9
|
+
class CreateCourseNicknames < ActiveRecord::Migration[5.1]
|
10
|
+
def change
|
11
|
+
create_table :course_nicknames do |t|
|
12
|
+
t.bigint :canvas_user_preference_value_id, null: false
|
13
|
+
t.integer :canvas_user_id
|
14
|
+
t.integer :canvas_course_id
|
15
|
+
t.string :nickname
|
16
|
+
|
17
|
+
t.timestamps
|
18
|
+
end
|
19
|
+
|
20
|
+
add_index :course_nicknames, :canvas_user_preference_value_id, unique: true
|
21
|
+
add_index :course_nicknames, [:canvas_course_id, :canvas_user_id], unique: true
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# #
|
2
|
+
# AUTO GENERATED MIGRATION
|
3
|
+
# This migration was auto generated by the CanvasSync Gem.
|
4
|
+
# You can add new columns to this table, but removing or
|
5
|
+
# re-naming ones created here may break Canvas Syncing.
|
6
|
+
#
|
7
|
+
|
8
|
+
|
9
|
+
class CreateRubrics < ActiveRecord::Migration[5.1]
|
10
|
+
def change
|
11
|
+
create_table :rubrics do |t|
|
12
|
+
t.bigint :canvas_id, null: false
|
13
|
+
t.bigint :canvas_user_id
|
14
|
+
t.bigint :canvas_rubric_id
|
15
|
+
t.bigint :canvas_context_id
|
16
|
+
t.string :canvas_context_type
|
17
|
+
t.text :data
|
18
|
+
t.float :points_possible
|
19
|
+
t.string :title
|
20
|
+
t.text :description
|
21
|
+
t.boolean :reusable
|
22
|
+
t.boolean :public
|
23
|
+
t.boolean :read_only
|
24
|
+
t.integer :association_count
|
25
|
+
t.boolean :free_form_criterion_comments
|
26
|
+
t.string :context_code
|
27
|
+
t.string :migration_id
|
28
|
+
t.boolean :hide_score_total
|
29
|
+
t.string :workflow_state
|
30
|
+
t.bigint :canvas_root_account_id
|
31
|
+
t.boolean :hide_points
|
32
|
+
t.string :rating_order
|
33
|
+
t.string :button_display
|
34
|
+
|
35
|
+
t.timestamps
|
36
|
+
end
|
37
|
+
|
38
|
+
add_index :rubrics, [:canvas_id], unique: true
|
39
|
+
add_index :rubrics, [:canvas_context_id, :canvas_context_type]
|
40
|
+
add_index :rubrics, [:canvas_rubric_id]
|
41
|
+
add_index :rubrics, [:canvas_user_id]
|
42
|
+
add_index :rubrics, [:canvas_root_account_id]
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# #
|
2
|
+
# AUTO GENERATED MIGRATION
|
3
|
+
# This migration was auto generated by the CanvasSync Gem.
|
4
|
+
# You can add new columns to this table, but removing or
|
5
|
+
# re-naming ones created here may break Canvas Syncing.
|
6
|
+
#
|
7
|
+
|
8
|
+
|
9
|
+
class CreateRubricAssociations < ActiveRecord::Migration[5.1]
|
10
|
+
def change
|
11
|
+
create_table :rubric_associations do |t|
|
12
|
+
t.bigint :canvas_id, null: false
|
13
|
+
t.bigint :canvas_rubric_id
|
14
|
+
t.bigint :canvas_association_id
|
15
|
+
t.string :canvas_association_type
|
16
|
+
t.boolean :use_for_grading
|
17
|
+
t.string :title
|
18
|
+
t.text :description
|
19
|
+
t.text :summary_data
|
20
|
+
t.string :purpose
|
21
|
+
t.string :url
|
22
|
+
t.bigint :canvas_context_id
|
23
|
+
t.string :canvas_context_type
|
24
|
+
t.boolean :hide_score_total
|
25
|
+
t.boolean :bookmarked
|
26
|
+
t.string :context_code
|
27
|
+
t.boolean :hide_points
|
28
|
+
t.boolean :hide_outcome_results
|
29
|
+
t.bigint :canvas_root_account_id
|
30
|
+
t.string :workflow_state
|
31
|
+
|
32
|
+
t.timestamps
|
33
|
+
end
|
34
|
+
|
35
|
+
add_index :rubric_associations, [:canvas_id], :name => :index_rubric_associations_on_canvas_id, unique: true
|
36
|
+
add_index :rubric_associations, [:canvas_association_id, :canvas_association_type], :name => :index_rubric_associations_on_canvas_aid_and_canvas_atype
|
37
|
+
add_index :rubric_associations, [:context_code], :name => :index_rubric_associations_on_context_code
|
38
|
+
add_index :rubric_associations, [:canvas_context_id, :canvas_context_type], :name => :index_rubric_associations_on_canvas_cid_and_canvas_ctype
|
39
|
+
add_index :rubric_associations, [:canvas_rubric_id], :name => :index_rubric_associations_on_canvas_rubric_id
|
40
|
+
add_index :rubric_associations, [:canvas_root_account_id], :name => :index_rubric_associations_on_canvas_root_account_id
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# #
|
2
|
+
# AUTO GENERATED MIGRATION
|
3
|
+
# This migration was auto generated by the CanvasSync Gem.
|
4
|
+
# You can add new columns to this table, but removing or
|
5
|
+
# re-naming ones created here may break Canvas Syncing.
|
6
|
+
#
|
7
|
+
|
8
|
+
|
9
|
+
class CreateRubricAssessments < ActiveRecord::Migration[5.1]
|
10
|
+
def change
|
11
|
+
create_table :rubric_assessments do |t|
|
12
|
+
t.bigint :canvas_id
|
13
|
+
t.bigint :canvas_user_id
|
14
|
+
t.bigint :canvas_rubric_id
|
15
|
+
t.bigint :canvas_rubric_association_id
|
16
|
+
t.float :score
|
17
|
+
t.text :data
|
18
|
+
t.bigint :canvas_artifact_id
|
19
|
+
t.string :canvas_artifact_type
|
20
|
+
t.string :assessment_type
|
21
|
+
t.bigint :canvas_assessor_id
|
22
|
+
t.integer :artifact_attempt
|
23
|
+
t.boolean :hide_points
|
24
|
+
t.bigint :canvas_root_account_id
|
25
|
+
|
26
|
+
t.timestamps
|
27
|
+
end
|
28
|
+
|
29
|
+
add_index :rubric_assessments, [:canvas_id], name: :index_rubric_assessments_on_canvas_id, unique: true
|
30
|
+
add_index :rubric_assessments, [:canvas_artifact_id, :canvas_artifact_type], name: :index_rubric_assessments_on_canvas_aid_and_canvas_atype
|
31
|
+
add_index :rubric_assessments, [:canvas_assessor_id], name: :index_rubric_assessments_on_canvas_assessor_id
|
32
|
+
add_index :rubric_assessments, [:canvas_rubric_association_id], name: :index_rubric_assessments_on_canvas_rubric_association_id
|
33
|
+
add_index :rubric_assessments, [:canvas_rubric_id], name: :index_rubric_assessments_on_canvas_rubric_id
|
34
|
+
add_index :rubric_assessments, [:canvas_user_id], name: :index_rubric_assessments_on_canvas_user_id
|
35
|
+
add_index :rubric_assessments, [:canvas_root_account_id], name: :index_rubric_assessments_on_canvas_root_account_id
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# #
|
2
|
+
# AUTO GENERATED MIGRATION
|
3
|
+
# This migration was auto generated by the CanvasSync Gem.
|
4
|
+
# You can add new columns to this table, but removing or
|
5
|
+
# re-naming ones created here may break Canvas Syncing.
|
6
|
+
#
|
7
|
+
|
8
|
+
|
9
|
+
class CreateLearningOutcomeResults < ActiveRecord::Migration[5.1]
|
10
|
+
def change
|
11
|
+
create_table :learning_outcome_results do |t|
|
12
|
+
t.bigint :canvas_id, null: false
|
13
|
+
t.bigint :canvas_context_id
|
14
|
+
t.string :canvas_context_type
|
15
|
+
t.bigint :canvas_association_id
|
16
|
+
t.string :canvas_association_type
|
17
|
+
t.bigint :canvas_content_tag_id
|
18
|
+
t.bigint :canvas_learning_outcome_id
|
19
|
+
t.bigint :canvas_user_id
|
20
|
+
t.boolean :mastery
|
21
|
+
t.boolean :original_mastery
|
22
|
+
t.bigint :canvas_artifact_id
|
23
|
+
t.string :canvas_artifact_type
|
24
|
+
t.datetime :assessed_at
|
25
|
+
t.string :title
|
26
|
+
t.float :percent
|
27
|
+
t.bigint :canvas_associated_asset_id
|
28
|
+
t.string :canvas_associated_asset_type
|
29
|
+
t.integer :attempt
|
30
|
+
t.float :score
|
31
|
+
t.float :possible
|
32
|
+
t.float :original_score
|
33
|
+
t.float :original_possible
|
34
|
+
t.string :workflow_state
|
35
|
+
|
36
|
+
t.timestamps
|
37
|
+
end
|
38
|
+
|
39
|
+
add_index :learning_outcome_results, :canvas_id, unique: true
|
40
|
+
add_index :learning_outcome_results, %i[
|
41
|
+
canvas_user_id
|
42
|
+
canvas_content_tag_id
|
43
|
+
canvas_association_id
|
44
|
+
canvas_association_type
|
45
|
+
canvas_associated_asset_id
|
46
|
+
canvas_associated_asset_type
|
47
|
+
], unique: true, name: :index_learning_outcome_results_association
|
48
|
+
add_index :learning_outcome_results, :canvas_content_tag_id
|
49
|
+
add_index :learning_outcome_results, :canvas_learning_outcome_id
|
50
|
+
add_index :learning_outcome_results, %i[canvas_artifact_id canvas_artifact_type], name: :index_learning_outcome_results_on_canvas_arid_and_artype
|
51
|
+
end
|
52
|
+
end
|