Add scrapbook_entries table migration#73373
Open
Erin007 wants to merge 1 commit into
Open
Conversation
Extracted from #72964 (Student Scrapbook V1) so the schema change can land independently of the feature code. Creates the scrapbook_entries table that backs per-user scrapbook entries, keyed either by (script_id, level_id) for in-curriculum levels or by channel_id for standalone projects. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracts the database migration from #72964 (Student Scrapbook V1) into its own PR so the schema change can land independently of the feature code.
What's here
dashboard/db/migrate/20260513120000_create_scrapbook_entries.rb— creates thescrapbook_entriestabledashboard/db/schema.rb— correspondingcreate_table/add_foreign_keyentriesThe table
Backs per-user scrapbook entries. An entry is keyed either by
(script_id, level_id)for in-curriculum levels or bychannel_idfor standalone projects; both keyings are nullable and the model (landing with the feature PR) enforces that exactly one is present. Image bytes live in S3 — the*_asset_urlcolumns hold only the bare filename reference.Two unique indexes guard against duplicate entries per user. MySQL treats NULL as distinct, so each index only constrains rows whose key columns are non-NULL.
Notes
20260513120000) is back-dated relative to staging's current schema version, so thedefine(version:)line is unchanged.🤖 Generated with Claude Code