canvas-lms/db/migrate
Ed Schiebel 388d995568 update the block editor data format
the legacy block editor code assumed the json format for
the block_editors.blocks column was
   blocks: [data: {editor data}, id, timestamp]
that was an artifact of the data structure emitted by editor.js.
Now we just want to put the craft.js editor's json output directly
into the blocks column.

The data migration also changes the editor_version value
from '1' to '0.1' because '1' doesn't seem right

this commit also introduces data transformations to update the data
to the latest version on the fly

closes RCX-2369
flag=block_editor

test plan:
  - before checking this branch out, have a block editor page
  - after checking this branch out
    - run bundle exec rake db:migrate RAILS_ENV=development
    - run psql canvas_development
    - select id, editor_version from block_editors;
    > expect your pages to have version 0.1
  - edit the old v0.1 page
  > expect it to work
  - save
  > expect it to have v0.2 in the block_editors table
  - from the pages index page, choose Duplicate from a
    page's kabob menu
  > expect the correct type of page (rce or block) icon
    to be displyed
  > expect to be able to view the copy of the page
  > expect to be able to edit the copy of the page
  - run:
    bundle exec rake db:migrate:down VERSION=20220228162704
  - select id, editor_version from block_editors;
  > expect the old v0.1 pages to revert to '1'
  > expect the new v0.2 pages to remain '0.2'

Change-Id: I592bffc11018ab3c4f7d7cc4752202088d5700c5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/357583
Migration-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Eric Saupe <eric.saupe@instructure.com>
QA-Review: Eric Saupe <eric.saupe@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2024-09-24 20:53:16 +00:00
..
20101201000090_validate_migration_integrity.rb squash old migrations 202403 2024-08-15 20:22:04 +00:00
20101210192618_init_canvas_db.rb Remove unnecessary test table 2024-08-15 20:44:58 +00:00
20101216224513_create_delayed_jobs.rb rubocop: remove LegacyMigrations shim 2024-03-13 16:41:49 +00:00
20101217224513_set_replica_identities.rb squash old migrations 202403 2024-08-15 20:22:04 +00:00
20111111214312_load_initial_data.rb send unique notification when an access token is created on a user's behalf 2024-08-08 15:55:37 +00:00
20121010191027_add_cassandra_page_view_tables.rb RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation 2021-11-25 14:03:06 +00:00
20141109202906_create_initial_partitions.rb migrations: don't precreate historic auditor tables 2024-03-13 18:44:11 +00:00
20230901164455_add_embeddings.rb squash old migrations 202403 2024-08-15 20:22:04 +00:00
20230901164555_set_replica_identity_on_embeddings.rb squash old migrations 202403 2024-08-15 20:22:04 +00:00
20240401130400_drop_external_feed_entries_unused_author_columns.rb rubocop: enforce all migration-related Rails cops 2024-04-03 19:17:11 +00:00
20240402182047_context_external_tools_not_selectable_default_false.rb Make ContextExternalTool.not_selectable be not nullable 2024-04-05 22:01:17 +00:00
20240402185343_create_object_student_visibilities.rb Add visibilities for learning objects 2024-04-03 18:04:35 +00:00
20240403144501_drop_deprecated_group_category_columns.rb drop long-deprecated group category columns 2024-04-09 20:19:40 +00:00
20240403161630_drop_graded_at_from_enrollments.rb drop long-deprecated enrollments.graded_at 2024-04-09 20:19:22 +00:00
20240405190851_context_external_tools_not_selectable_not_null.rb Make ContextExternalTool.not_selectable be not nullable 2024-04-05 22:01:17 +00:00
20240409235414_add_automated_and_snapshot_to_conversation_message.rb Inbox OOO Auto Response - Backend 2024-06-18 18:04:44 +00:00
20240411191610_create_lti_registrations.rb Create Lti::Registration table and model 2024-04-19 17:30:13 +00:00
20240412165529_add_replica_identity_to_lti_registrations.rb Create Lti::Registration table and model 2024-04-19 17:30:13 +00:00
20240412200754_fixup_invalid_dev_key_placement_configurations.rb Validate LTI message_type for placements 2024-04-25 19:22:22 +00:00
20240415210205_add_version_to_embeddings_tables.rb smart search: index on demand 2024-04-27 00:52:52 +00:00
20240417211623_create_lti_registration_account_bindings.rb create Lti::RegistrationAccountBindings model 2024-04-23 22:28:25 +00:00
20240418190255_add_checkpoints_created_notification.rb Add Checkpoints Assignment Created notification 2024-04-29 18:26:45 +00:00
20240419173548_add_replica_identity_to_lti_registration_account_bindings.rb create Lti::RegistrationAccountBindings model 2024-04-23 22:28:25 +00:00
20240426200824_add_pronunciation_to_user_profiles.rb Allow User to Add Their Name Pronunciation to Profile 2024-05-30 18:12:16 +00:00
20240429163358_add_workflow_state_to_lti_ims_registrations.rb Remove extraneous fields from IMS Registrations 2024-05-02 22:15:17 +00:00
20240429191100_add_pseudonym_login_attributes.rb add new pseudonyms check constraint in a concurrent-friendly way 2024-05-02 21:04:08 +00:00
20240429194145_make_extraneous_ims_registration_fields_nullable.rb bundle update rubocop 2024-07-05 18:54:07 +00:00
20240429194501_remove_extraneous_ims_registration_fields.rb Remove extraneous fields from IMS Registrations 2024-05-02 22:15:17 +00:00
20240430151233_backfill_pseudonyms_login_attribute.rb start keeping track of _all_ possible login attributes for Microsoft auth 2024-05-01 18:00:20 +00:00
20240502124108_add_summary_enabled_to_discussion_topics.rb add migrations and models for discussion summary prototype 2024-05-06 15:46:51 +00:00
20240502124109_add_summary_to_discussion_topics.rb add migrations and models for discussion summary prototype 2024-05-06 15:46:51 +00:00
20240502124110_add_replica_identity_to_discussion_summaries.rb add migrations and models for discussion summary prototype 2024-05-06 15:46:51 +00:00
20240502221856_add_account_verification_notification.rb pseudonym login attribute migration 2024-05-07 03:50:58 +00:00
20240503114543_update_indexes_on_assignment_override_students.rb Update indexes on assignment_override_students 2024-05-06 19:01:17 +00:00
20240503221247_add_verification_token_to_pseudonyms.rb pseudonym login attribute migration 2024-05-07 03:50:58 +00:00
20240514092440_add_index_to_asset_user_accesses.rb add index for Group context on updated_at 2024-05-15 19:06:24 +00:00
20240514224014_update_lti_registration_created_by_null.rb sync DeveloperKey and Lti::Registration on save 2024-05-28 22:05:02 +00:00
20240524142000_add_index_to_enrollments.rb Add index to enrollments query 2024-05-28 15:44:30 +00:00
20240604155656_migrate_cassandra_data_to_postgres.rb remove Cassandra support for page views 2024-06-05 15:15:34 +00:00
20240606124108_add_parent_and_locale_to_discussion_summaries.rb refine and localize summaries in an additional step 2024-06-10 14:31:17 +00:00
20240606153424_add_auto_caption_status_to_media_objects.rb reduce locking from adding media_objects.chk_auto_caption_status_enum 2024-06-24 21:16:17 +00:00
20240610201627_remove_registration_binding_foreign_key.rb remove LTI Registration-Binding foreign key 2024-06-12 16:46:54 +00:00
20240612065118_add_unified_tool_id_to_context_external_tools.rb add unified_tool_id to CET 2024-06-14 08:59:28 +00:00
20240613083005_add_unified_tool_id_to_lti_tool_configuration.rb add unified_tool_id to lti_tool_configurations 2024-06-14 09:03:28 +00:00
20240617124613_add_root_account_id_for_collaborations.rb feat: add root account reference to collaborations table 2024-06-21 16:59:40 +00:00
20240617124759_populate_root_account_id_for_collaborations.rb feat: add root account reference to collaborations table 2024-06-21 16:59:40 +00:00
20240620184959_update_auto_caption_status_constraint.rb null out auto caption status before changing check constraint 2024-06-25 15:08:37 +00:00
20240626165624_add_inbox_settings_ooo_hash.rb Add 'inbox_settings_column_hash' 2024-07-08 17:19:43 +00:00
20240626170449_remove_inbox_settings_ooo_snapshot.rb Remove 'inbox_settings_ooo_snapshot' 2024-07-22 22:00:37 +00:00
20240627203549_add_unified_tool_id_to_lti_ims_registrations.rb save unified_tool_id on new LTI Apps Manage page 2024-07-05 16:03:54 +00:00
20240709153926_create_rubric_imports.rb build rubric import backend 2024-07-24 19:06:13 +00:00
20240713195640_backfill_lti_registrations_and_account_bindings.rb backfill Lti::RegistrationAccountBindings 2024-07-25 14:45:48 +00:00
20240715144749_add_registration_url_to_lti_ims_registrations.rb Store Dynamic Registration URL 2024-07-17 18:25:04 +00:00
20240716122630_re_subscribe_conversation_participant.rb chore: resubscirbe archived conversations 2024-07-23 14:08:28 +00:00
20240717133836_rename_get_page_content_scope.rb fixup usages of deprecated getPageContent scope 2024-07-30 16:36:21 +00:00
20240717212952_regrade_points_based_scheme_assignments.rb datafix for points based scheme grades 2024-07-30 21:07:01 +00:00
20240718231322_make_user_id_nullable_in_web_conferences.rb make user_id nullable in web_conferences 2024-07-23 16:57:19 +00:00
20240722160756_add_replica_identity_to_rubric_imports.rb build rubric import backend 2024-07-24 19:06:13 +00:00
20240723073019_set_default_rce_favorites.rb Always_on RCE favorite tools can be removed from favorites 2024-08-21 15:37:41 +00:00
20240724171311_update_pages_date_details_api.rb Fix pagination in pages assign to tray 2024-07-24 20:10:50 +00:00
20240729132352_discussion_type_updater.rb Fix discussion_type on Discussion Topics 2024-08-01 14:24:02 +00:00
20240731133159_add_edited_at_to_discussion_topic.rb Discussion Edited At 2024-08-13 08:19:44 +00:00
20240807193101_add_access_token_created_on_behalf_of_user_notification.rb send unique notification when an access token is created on a user's behalf 2024-08-08 15:55:37 +00:00
20240813175345_regrade_versions_for_points_based_scheme_assignments.rb update version grades on points scheme assignments 2024-08-29 18:15:16 +00:00
20240817212250_add_tool_configuration_lti_registration_id.rb Create a column linking a tool config to an lti registration 2024-08-21 17:38:19 +00:00
20240817234153_fill_tool_configuration_lti_registration_ids.rb Create a column linking a tool config to an lti registration 2024-08-21 17:38:19 +00:00
20240821093219_drop_user_note_entities.rb Drop UserNote entities 2024-08-27 16:40:32 +00:00
20240821222029_rerun_backfill_lti_registrations_and_account_bindings.rb Rerun fixups to backfill lti registrations and acc bindings 2024-08-27 15:32:44 +00:00
20240828230829_replace_broken_media_object_links.rb Ensure BP children can fix media 2024-09-06 21:49:02 +00:00
20240903192950_create_lti_overlays.rb create Lti::Overlay model 2024-09-09 20:39:38 +00:00
20240903210428_add_replica_identity_to_lti_overlays.rb create Lti::Overlay model 2024-09-09 20:39:38 +00:00
20240904222150_add_index_to_account_report_runners_created_at.rb add index to account_report_runners created_at 2024-09-10 19:38:03 +00:00
20240905220638_remove_visibility_tables.rb Remove old visibility views 2024-09-06 21:19:12 +00:00
20240906151644_module_override_date_updater.rb create data fixup for module override data values 2024-09-10 00:12:53 +00:00
20240909194855_add_parent_override_id_to_assignment_overrides.rb Add new parent relationship to assignment_override 2024-09-13 15:48:52 +00:00
20240918222622_delete_covid_help_links.rb Unilaterally remove "Covid-19 Canvas Resources" help link 2024-09-19 16:09:37 +00:00
20240923223031_fix_block_editor_version1.rb update the block editor data format 2024-09-24 20:53:16 +00:00
202406011124108_add_user_and_user_input_to_discussion_summaries.rb add user input to discussion summary prototype 2024-06-17 09:13:26 +00:00
202406011134108_delete_regenerated_from_discussion_summary_feedback.rb add user input to discussion summary prototype 2024-06-17 09:13:26 +00:00
99999999999999999999_ensure_test_db_empty.rb migrations: ensure that no extraneous test data was created 2024-03-14 14:50:00 +00:00
748091800218022945873_regenerate_brand_files_based_on_new_defaults_predeploy.rb migrations: avoid creating extraneous data in the test env 2024-03-13 19:37:02 +00:00
748091800218022945874_regenerate_brand_files_based_on_new_defaults_postdeploy.rb migrations: avoid creating extraneous data in the test env 2024-03-13 19:37:02 +00:00