-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename db tables to have more consistency (#434)
* rename db tables to have more consistency * fix renaming variables * fix tests * update property names * drop db changes * create new migration starting from vote model changes * update github actions pnpm setup to v4 to stop breaking actions issue * fix tests --------- Co-authored-by: Martin Benedikt Busch <[email protected]>
- Loading branch information
1 parent
e8aa5fc
commit 7f9c676
Showing
35 changed files
with
1,873 additions
and
151 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 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
ALTER TABLE "forum_questions" RENAME TO "questions";--> statement-breakpoint | ||
ALTER TABLE "question_options" RENAME TO "options";--> statement-breakpoint | ||
ALTER TABLE "comments" RENAME COLUMN "question_option_id" TO "option_id";--> statement-breakpoint | ||
ALTER TABLE "questions" RENAME COLUMN "question_title" TO "title";--> statement-breakpoint | ||
ALTER TABLE "questions" RENAME COLUMN "question_sub_title" TO "sub_title";--> statement-breakpoint | ||
ALTER TABLE "options" RENAME COLUMN "option_title" TO "title";--> statement-breakpoint | ||
ALTER TABLE "options" RENAME COLUMN "option_sub_title" TO "sub_title";--> statement-breakpoint | ||
ALTER TABLE "comments" DROP CONSTRAINT "comments_question_option_id_question_options_id_fk"; | ||
--> statement-breakpoint | ||
ALTER TABLE "questions" DROP CONSTRAINT "forum_questions_cycle_id_cycles_id_fk"; | ||
--> statement-breakpoint | ||
ALTER TABLE "options" DROP CONSTRAINT "question_options_user_id_users_id_fk"; | ||
--> statement-breakpoint | ||
ALTER TABLE "options" DROP CONSTRAINT "question_options_registration_id_registrations_id_fk"; | ||
--> statement-breakpoint | ||
ALTER TABLE "options" DROP CONSTRAINT "question_options_question_id_forum_questions_id_fk"; | ||
--> statement-breakpoint | ||
ALTER TABLE "votes" DROP CONSTRAINT "votes_option_id_question_options_id_fk"; | ||
--> statement-breakpoint | ||
ALTER TABLE "votes" DROP CONSTRAINT "votes_question_id_forum_questions_id_fk"; | ||
--> statement-breakpoint | ||
ALTER TABLE "questions_to_group_categories" DROP CONSTRAINT "questions_to_group_categories_question_id_forum_questions_id_fk"; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "comments" ADD CONSTRAINT "comments_option_id_options_id_fk" FOREIGN KEY ("option_id") REFERENCES "public"."options"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "questions" ADD CONSTRAINT "questions_cycle_id_cycles_id_fk" FOREIGN KEY ("cycle_id") REFERENCES "public"."cycles"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "options" ADD CONSTRAINT "options_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "options" ADD CONSTRAINT "options_registration_id_registrations_id_fk" FOREIGN KEY ("registration_id") REFERENCES "public"."registrations"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "options" ADD CONSTRAINT "options_question_id_questions_id_fk" FOREIGN KEY ("question_id") REFERENCES "public"."questions"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "votes" ADD CONSTRAINT "votes_option_id_options_id_fk" FOREIGN KEY ("option_id") REFERENCES "public"."options"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "votes" ADD CONSTRAINT "votes_question_id_questions_id_fk" FOREIGN KEY ("question_id") REFERENCES "public"."questions"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "questions_to_group_categories" ADD CONSTRAINT "questions_to_group_categories_question_id_questions_id_fk" FOREIGN KEY ("question_id") REFERENCES "public"."questions"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; |
Oops, something went wrong.