- change email to varchar instead of text

This commit is contained in:
Markus Brueckner 2024-12-17 10:53:59 +01:00
parent 4e32589ce6
commit 7a39a8474c

View file

@ -38,7 +38,7 @@ CREATE TABLE `surveys_table` (
--> statement-breakpoint
CREATE TABLE `users_table` (
`id` int AUTO_INCREMENT NOT NULL,
`email` text NOT NULL,
`email` varchar(255) NOT NULL,
`password_hash` text NOT NULL,
CONSTRAINT `users_table_id` PRIMARY KEY(`id`),
CONSTRAINT `users_table_email_unique` UNIQUE(`email`)
@ -50,4 +50,4 @@ ALTER TABLE `survey_answers_table` ADD CONSTRAINT `survey_answers_table_particip
ALTER TABLE `survey_answers_table` ADD CONSTRAINT `survey_answers_table_skillId_survey_skills_table_id_fk` FOREIGN KEY (`skillId`) REFERENCES `survey_skills_table`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE `survey_skills_table` ADD CONSTRAINT `survey_skills_table_surveyId_surveys_table_id_fk` FOREIGN KEY (`surveyId`) REFERENCES `surveys_table`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE `surveys_table` ADD CONSTRAINT `surveys_table_owner_users_table_id_fk` FOREIGN KEY (`owner`) REFERENCES `users_table`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX `token_index` ON `survey_access_table` (`accessToken`);
CREATE INDEX `token_index` ON `survey_access_table` (`accessToken`);