Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add migration for versions #369

Merged
merged 7 commits into from
Jul 31, 2024
Merged

add migration for versions #369

merged 7 commits into from
Jul 31, 2024

Conversation

harishv7
Copy link
Contributor

@harishv7 harishv7 commented Jul 25, 2024

TL;DR

Replace mainBlobId with versionId and introduce version table with the associated fields: id, versionNum, resourceId, blobId, publishedAt. This change includes updates to Prisma schema, generated types, and related service files.

What changed?

  • Removed mainBlobId, added versionId to Resource
  • Created Version model and table
  • Updated Prisma schema and migration files
  • Adjusted code to handle new versionId logic instead of mainBlobId
  • Replaced all instances of mainBlobId with versionId
  • Modified tests to reflect changes

How to test?

  1. Run Prisma migrations
  2. Verify changes in the database structure
  3. Update seed files and run seeding script
  4. Check the application for any errors related to resource handling

Why make this change?

To streamline resource versioning and make the resource model more maintainable by separating version tracking into a distinct table.

Relationships established:

  • Resource have a 1 to many relation with Version
  • Version has a 1-1 mapping to both a resource and a blob

Copy link

vercel bot commented Jul 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
isomer-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 31, 2024 8:18am

Copy link
Contributor Author

harishv7 commented Jul 25, 2024

@harishv7 harishv7 requested a review from a team July 25, 2024 15:21
@harishv7 harishv7 marked this pull request as ready for review July 25, 2024 15:21
@harishv7 harishv7 force-pushed the 07-25-update_to_use_bigint_for_resourceid_and_blobid branch from eb38f89 to c73b6e7 Compare July 28, 2024 08:26
@harishv7 harishv7 force-pushed the 07-25-add_migration_for_versions branch from 9f470d6 to 01d7dcb Compare July 28, 2024 08:26
Base automatically changed from 07-25-update_to_use_bigint_for_resourceid_and_blobid to main July 29, 2024 05:20
@harishv7 harishv7 force-pushed the 07-25-add_migration_for_versions branch from 839db7a to 724aeb1 Compare July 29, 2024 05:20
apps/studio/prisma/schema.prisma Outdated Show resolved Hide resolved
apps/studio/prisma/schema.prisma Show resolved Hide resolved
apps/studio/prisma/schema.prisma Outdated Show resolved Hide resolved
apps/studio/prisma/schema.prisma Outdated Show resolved Hide resolved
apps/studio/prisma/schema.prisma Show resolved Hide resolved
apps/studio/prisma/schema.prisma Outdated Show resolved Hide resolved
apps/studio/prisma/schema.prisma Outdated Show resolved Hide resolved
apps/studio/prisma/schema.prisma Outdated Show resolved Hide resolved
apps/studio/src/server/modules/folder/folder.router.ts Outdated Show resolved Hide resolved
apps/studio/src/server/modules/page/page.router.ts Outdated Show resolved Hide resolved
apps/studio/src/server/modules/resource/resource.types.ts Outdated Show resolved Hide resolved
@harishv7 harishv7 merged commit afe208c into main Jul 31, 2024
16 checks passed
Copy link
Contributor Author

Merge activity

@harishv7 harishv7 deleted the 07-25-add_migration_for_versions branch July 31, 2024 08:15
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.

2 participants