-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix stage deletion by removing unused tables (#697)
* Drop action_claim and action_move tables These tables aren't used by our code anymore and were originally intended to keep a history of claims and moves on a pub. Since we're not doing that currently I have removed both tables to avoid any confusion * Define some missing cascading behavior * Generate migration/types
- Loading branch information
Showing
11 changed files
with
265 additions
and
646 deletions.
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.