Skip to content

Add scrapbook_entries table migration#73373

Open
Erin007 wants to merge 1 commit into
stagingfrom
erin-scrapbook-entries-migration
Open

Add scrapbook_entries table migration#73373
Erin007 wants to merge 1 commit into
stagingfrom
erin-scrapbook-entries-migration

Conversation

@Erin007

@Erin007 Erin007 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

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 the scrapbook_entries table
  • dashboard/db/schema.rb — corresponding create_table / add_foreign_key entries

The table

Backs per-user scrapbook entries. An entry is keyed either by (script_id, level_id) for in-curriculum levels or by channel_id for 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_url columns 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

  • No schema version bump: the migration timestamp (20260513120000) is back-dated relative to staging's current schema version, so the define(version:) line is unchanged.
  • The feature code (controllers, models, React UI, routes) remains in Student Scrapbook V1  #72964 and will build on this table.

🤖 Generated with Claude Code

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>
@Erin007 Erin007 requested a review from bethanyaconnor June 22, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant