-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix stage deletion by removing unused tables #697
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
61adf05
Drop action_claim and action_move tables
kalilsn 817cbb3
Define some missing cascading behavior
kalilsn a550198
Generate migration/types
kalilsn 8a04df4
Merge branch 'main' into kalilsn/stage-deletion
kalilsn eefb677
Merge branch 'main' into kalilsn/stage-deletion
kalilsn c7b2be1
Merge branch 'main' into kalilsn/stage-deletion
kalilsn 7971833
Merge branch 'main' into kalilsn/stage-deletion
kalilsn fbc04b0
Merge branch 'main' into kalilsn/stage-deletion
kalilsn 7f0a85a
Merge branch 'main' into kalilsn/stage-deletion
kalilsn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
75 changes: 75 additions & 0 deletions
75
core/prisma/migrations/20241007162426_drop_history_tables_and_add_cascades/migration.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
Warnings: | ||
|
||
- You are about to drop the `action_claim` table. If the table is not empty, all the data it contains will be lost. | ||
- You are about to drop the `action_move` table. If the table is not empty, all the data it contains will be lost. | ||
|
||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "action_claim" DROP CONSTRAINT "action_claim_pubId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "action_claim" DROP CONSTRAINT "action_claim_stageId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "action_claim" DROP CONSTRAINT "action_claim_userId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "action_move" DROP CONSTRAINT "action_move_destinationStageId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "action_move" DROP CONSTRAINT "action_move_pubId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "action_move" DROP CONSTRAINT "action_move_sourceStageId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "action_move" DROP CONSTRAINT "action_move_userId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "form_elements" DROP CONSTRAINT "form_elements_fieldId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "form_elements" DROP CONSTRAINT "form_elements_formId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "forms" DROP CONSTRAINT "forms_communityId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "member_groups" DROP CONSTRAINT "member_groups_communityId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "members" DROP CONSTRAINT "members_userId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "permissions" DROP CONSTRAINT "permissions_memberGroupId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "permissions" DROP CONSTRAINT "permissions_memberId_fkey"; | ||
|
||
-- DropTable | ||
DROP TABLE "action_claim"; | ||
|
||
-- DropTable | ||
DROP TABLE "action_move"; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "members" ADD CONSTRAINT "members_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "member_groups" ADD CONSTRAINT "member_groups_communityId_fkey" FOREIGN KEY ("communityId") REFERENCES "communities"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "permissions" ADD CONSTRAINT "permissions_memberId_fkey" FOREIGN KEY ("memberId") REFERENCES "members"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "permissions" ADD CONSTRAINT "permissions_memberGroupId_fkey" FOREIGN KEY ("memberGroupId") REFERENCES "member_groups"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "forms" ADD CONSTRAINT "forms_communityId_fkey" FOREIGN KEY ("communityId") REFERENCES "communities"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "form_elements" ADD CONSTRAINT "form_elements_fieldId_fkey" FOREIGN KEY ("fieldId") REFERENCES "pub_fields"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "form_elements" ADD CONSTRAINT "form_elements_formId_fkey" FOREIGN KEY ("formId") REFERENCES "forms"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
174 changes: 174 additions & 0 deletions
174
core/prisma/migrations/20241007162428_update_comments/migration.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
-- generator-version: 1.0.0 | ||
|
||
-- Model users comments | ||
|
||
|
||
|
||
-- Model sessions comments | ||
|
||
COMMENT ON COLUMN "sessions"."type" IS 'With what type of token is this session created? Used for determining on a page-by-page basis whether to allow a certain session to access it. For instance, a verify email token/session should not allow you to access the password reset page.'; | ||
|
||
|
||
-- Model auth_tokens comments | ||
|
||
|
||
|
||
-- Model communities comments | ||
|
||
|
||
|
||
-- Model pubs comments | ||
|
||
|
||
|
||
-- Model pub_fields comments | ||
|
||
|
||
|
||
-- Model PubFieldSchema comments | ||
|
||
COMMENT ON COLUMN "PubFieldSchema"."schema" IS '@type(JSONSchemaType<any>, ''ajv'', true, false, true)'; | ||
|
||
|
||
-- Model pub_values comments | ||
|
||
|
||
|
||
-- Model pub_types comments | ||
|
||
|
||
|
||
-- Model stages comments | ||
|
||
|
||
|
||
-- Model PubsInStages comments | ||
|
||
|
||
|
||
-- Model move_constraint comments | ||
|
||
|
||
|
||
-- Model members comments | ||
|
||
|
||
|
||
-- Model member_groups comments | ||
|
||
|
||
|
||
-- Model permissions comments | ||
|
||
|
||
|
||
-- Model integrations comments | ||
|
||
|
||
|
||
-- Model integration_instances comments | ||
|
||
|
||
|
||
-- Model IntegrationInstanceState comments | ||
|
||
|
||
|
||
-- Model action_instances comments | ||
|
||
|
||
|
||
-- Model action_runs comments | ||
|
||
|
||
|
||
-- Model rules comments | ||
|
||
|
||
|
||
-- Model forms comments | ||
|
||
|
||
|
||
-- Model form_elements comments | ||
|
||
|
||
|
||
-- Model api_access_tokens comments | ||
|
||
|
||
|
||
-- Model api_access_logs comments | ||
|
||
|
||
|
||
-- Model api_access_permissions comments | ||
|
||
COMMENT ON COLUMN "api_access_permissions"."constraints" IS '@type(ApiAccessPermissionConstraints, ''../types'', true, false, true)'; | ||
|
||
|
||
-- Model form_to_permissions comments | ||
|
||
|
||
|
||
-- Enum AuthTokenType comments | ||
|
||
COMMENT ON TYPE "AuthTokenType" IS '@property generic - For most use-cases. This will just authenticate you with a regular session. | ||
@property passwordReset - For resetting your password only | ||
@property signup - For signing up, but also when you''re invited to a community | ||
@property verifyEmail - For verifying your email address'; | ||
|
||
|
||
-- Enum CoreSchemaType comments | ||
|
||
|
||
|
||
|
||
-- Enum MemberRole comments | ||
|
||
|
||
|
||
|
||
-- Enum Action comments | ||
|
||
|
||
|
||
|
||
-- Enum ActionRunStatus comments | ||
|
||
|
||
|
||
|
||
-- Enum Event comments | ||
|
||
|
||
|
||
|
||
-- Enum FormAccessType comments | ||
|
||
|
||
|
||
|
||
-- Enum StructuralFormElement comments | ||
|
||
|
||
|
||
|
||
-- Enum ElementType comments | ||
|
||
|
||
|
||
|
||
-- Enum InputComponent comments | ||
|
||
|
||
|
||
|
||
-- Enum ApiAccessType comments | ||
|
||
|
||
|
||
|
||
-- Enum ApiAccessScope comments | ||
|
||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't rendering anything on most pubs, and it's confusing when it is rendered. See the "Assigned To" section on this pub