From 5e8c1e69eaf7857b75534afd1da37569ee87d905 Mon Sep 17 00:00:00 2001 From: xwilson03 Date: Sun, 4 Aug 2024 14:19:21 -0500 Subject: [PATCH] adds db migration --- packages/db/drizzle/0015_orange_garia.sql | 135 +++ packages/db/drizzle/meta/0015_snapshot.json | 1022 +++++++++++++++++++ packages/db/drizzle/meta/_journal.json | 7 + 3 files changed, 1164 insertions(+) create mode 100644 packages/db/drizzle/0015_orange_garia.sql create mode 100644 packages/db/drizzle/meta/0015_snapshot.json diff --git a/packages/db/drizzle/0015_orange_garia.sql b/packages/db/drizzle/0015_orange_garia.sql new file mode 100644 index 00000000..5a3fe90d --- /dev/null +++ b/packages/db/drizzle/0015_orange_garia.sql @@ -0,0 +1,135 @@ +-- Rename Tables + +ALTER TABLE "users" RENAME TO "user_common_data"; --> statement-breakpoint +ALTER TABLE "registration_data" RENAME TO "user_hacker_data"; --> statement-breakpoint + + +-- Rename Columns + +ALTER TABLE "user_hacker_data" RENAME COLUMN "short_id" TO "schoolID"; --> statement-breakpoint +ALTER TABLE "user_hacker_data" RENAME COLUMN "accepted_mlh_code_of_conduct" TO "has_accepted_mlh_coc"; --> statement-breakpoint +ALTER TABLE "user_hacker_data" RENAME COLUMN "shared_data_with_mlh" TO "has_shared_data_with_mlh"; --> statement-breakpoint +ALTER TABLE "user_hacker_data" RENAME COLUMN "wants_to_receive_mlh_emails" TO "is_emailable"; --> statement-breakpoint +ALTER TABLE "user_common_data" RENAME COLUMN "registration_complete" TO "is_fully_registered"; --> statement-breakpoint +ALTER TABLE "user_common_data" RENAME COLUMN "created_at" TO "signup_time"; --> statement-breakpoint +ALTER TABLE "user_common_data" RENAME COLUMN "has_searchable_profile" TO "is_searchable"; --> statement-breakpoint +ALTER TABLE "user_common_data" RENAME COLUMN "rsvp" TO "is_rsvped"; --> statement-breakpoint +ALTER TABLE "user_common_data" RENAME COLUMN "approved" TO "is_approved"; --> statement-breakpoint + + +-- Add Moving Column Destinations Without Constraints + +ALTER TABLE "user_common_data" ADD COLUMN "age" integer; --> statement-breakpoint +ALTER TABLE "user_common_data" ADD COLUMN "gender" varchar(50); --> statement-breakpoint +ALTER TABLE "user_common_data" ADD COLUMN "race" varchar(75); --> statement-breakpoint +ALTER TABLE "user_common_data" ADD COLUMN "ethnicity" varchar(50); --> statement-breakpoint +ALTER TABLE "user_common_data" ADD COLUMN "shirt_size" varchar(5); --> statement-breakpoint +ALTER TABLE "user_common_data" ADD COLUMN "diet_restrictions" json; --> statement-breakpoint +ALTER TABLE "user_common_data" ADD COLUMN "accommodation_note" text; --> statement-breakpoint +ALTER TABLE "user_common_data" ADD COLUMN "discord" varchar(60); --> statement-breakpoint +ALTER TABLE "user_common_data" ADD COLUMN "pronouns" varchar(20); --> statement-breakpoint +ALTER TABLE "user_common_data" ADD COLUMN "bio" text; --> statement-breakpoint +ALTER TABLE "user_common_data" ADD COLUMN "skills" json DEFAULT '[]'::json; --> statement-breakpoint +ALTER TABLE "user_common_data" ADD COLUMN "profile_photo" varchar(255); --> statement-breakpoint + +ALTER TABLE "user_hacker_data" ADD COLUMN "group" integer; --> statement-breakpoint +ALTER TABLE "user_hacker_data" ADD COLUMN "team_id" varchar(50); --> statement-breakpoint +ALTER TABLE "user_hacker_data" ADD COLUMN "points" integer DEFAULT 0; --> statement-breakpoint + + +-- Transfer Moving Column Data + +UPDATE "user_common_data" +SET "age" = "user_hacker_data"."age", + "gender" = "user_hacker_data"."gender", + "race" = "user_hacker_data"."race", + "ethnicity" = "user_hacker_data"."ethnicity", + "shirt_size" = "user_hacker_data"."shirt_size", + "diet_restrictions" = "user_hacker_data"."diet_restrictions", + "accommodation_note" = "user_hacker_data"."accommodation_note" +FROM "user_hacker_data" +WHERE "user_common_data"."clerk_id" = "user_hacker_data"."clerk_id"; +--> statement-breakpoint + +UPDATE "user_common_data" +SET "discord" = "profile_data"."discord_username", + "pronouns" = "profile_data"."pronouns", + "bio" = "profile_data"."bio", + "skills" = "profile_data"."skills", + "profile_photo" = "profile_data"."profile_photo" +FROM "profile_data" +WHERE "user_common_data"."hacker_tag" = "profile_data"."hacker_tag"; +--> statement-breakpoint + +UPDATE "user_hacker_data" +SET "group" = "user_common_data"."group", + "team_id" = "user_common_data"."team_id", + "points" = "user_common_data"."points" +FROM "user_common_data" +WHERE "user_common_data"."clerk_id" = "user_hacker_data"."clerk_id"; +--> statement-breakpoint + + +-- Add Moving Column Constraints + +ALTER TABLE "user_common_data" ALTER COLUMN "age" SET NOT NULL; --> statement-breakpoint +ALTER TABLE "user_common_data" ALTER COLUMN "gender" SET NOT NULL; --> statement-breakpoint +ALTER TABLE "user_common_data" ALTER COLUMN "race" SET NOT NULL; --> statement-breakpoint +ALTER TABLE "user_common_data" ALTER COLUMN "ethnicity" SET NOT NULL; --> statement-breakpoint +ALTER TABLE "user_common_data" ALTER COLUMN "shirt_size" SET NOT NULL; --> statement-breakpoint +ALTER TABLE "user_common_data" ALTER COLUMN "diet_restrictions" SET NOT NULL; --> statement-breakpoint +ALTER TABLE "user_common_data" ALTER COLUMN "discord" SET NOT NULL; --> statement-breakpoint +ALTER TABLE "user_common_data" ALTER COLUMN "pronouns" SET NOT NULL; --> statement-breakpoint +ALTER TABLE "user_common_data" ALTER COLUMN "bio" SET NOT NULL; --> statement-breakpoint +ALTER TABLE "user_common_data" ALTER COLUMN "skills" SET NOT NULL; --> statement-breakpoint +ALTER TABLE "user_common_data" ALTER COLUMN "profile_photo" SET NOT NULL; --> statement-breakpoint +ALTER TABLE "user_hacker_data" ALTER COLUMN "group" SET NOT NULL; --> statement-breakpoint +ALTER TABLE "user_hacker_data" ALTER COLUMN "points" SET NOT NULL; --> statement-breakpoint + + +-- Drop Moving Column Sources + +ALTER TABLE "user_hacker_data" DROP COLUMN IF EXISTS "age"; --> statement-breakpoint +ALTER TABLE "user_hacker_data" DROP COLUMN IF EXISTS "gender"; --> statement-breakpoint +ALTER TABLE "user_hacker_data" DROP COLUMN IF EXISTS "race"; --> statement-breakpoint +ALTER TABLE "user_hacker_data" DROP COLUMN IF EXISTS "ethnicity"; --> statement-breakpoint +ALTER TABLE "user_hacker_data" DROP COLUMN IF EXISTS "shirt_size"; --> statement-breakpoint +ALTER TABLE "user_hacker_data" DROP COLUMN IF EXISTS "diet_restrictions"; --> statement-breakpoint +ALTER TABLE "user_hacker_data" DROP COLUMN IF EXISTS "accommodation_note"; --> statement-breakpoint +ALTER TABLE "user_common_data" DROP COLUMN IF EXISTS "group"; --> statement-breakpoint +ALTER TABLE "user_common_data" DROP COLUMN IF EXISTS "team_id"; --> statement-breakpoint +ALTER TABLE "user_common_data" DROP COLUMN IF EXISTS "points"; --> statement-breakpoint +DROP TABLE "profile_data"; --> statement-breakpoint + + +-- Update Constraints + +ALTER TABLE "chats_to_users" DROP CONSTRAINT "chats_to_users_user_id_users_clerk_id_fk"; +DO $$ BEGIN + ALTER TABLE "chats_to_users" ADD CONSTRAINT "chats_to_users_user_id_user_common_data_clerk_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user_common_data"("clerk_id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint + +ALTER TABLE "tickets_to_users" DROP CONSTRAINT "tickets_to_users_user_id_users_clerk_id_fk"; +DO $$ BEGIN + ALTER TABLE "tickets_to_users" ADD CONSTRAINT "tickets_to_users_user_id_user_common_data_clerk_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user_common_data"("clerk_id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint + +ALTER TABLE "user_common_data" DROP CONSTRAINT "users_email_unique"; +ALTER TABLE "user_common_data" ADD CONSTRAINT "user_common_data_email_unique" UNIQUE("email"); +--> statement-breakpoint + +ALTER TABLE "user_common_data" DROP CONSTRAINT "users_hacker_tag_unique"; +ALTER TABLE "user_common_data" ADD CONSTRAINT "user_common_data_hacker_tag_unique" UNIQUE("hacker_tag"); +--> statement-breakpoint + + +-- Drop Deleted Tables, Columns & Constraints + +ALTER TABLE "user_common_data" DROP COLUMN IF EXISTS "checked_in"; --> statement-breakpoint +ALTER TABLE "user_hacker_data" DROP CONSTRAINT "registration_data_clerk_id_unique"; --> statement-breakpoint diff --git a/packages/db/drizzle/meta/0015_snapshot.json b/packages/db/drizzle/meta/0015_snapshot.json new file mode 100644 index 00000000..1f51c682 --- /dev/null +++ b/packages/db/drizzle/meta/0015_snapshot.json @@ -0,0 +1,1022 @@ +{ + "id": "fdbe1a2d-8266-4c8c-a68d-5cb660ead4b5", + "prevId": "ad1b5139-ce4c-4c3b-9beb-56fd1f3aac91", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.chat_messages": { + "name": "chat_messages", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "chat_id": { + "name": "chat_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "author_id": { + "name": "author_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.chats": { + "name": "chats", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "chat_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "ticket_id": { + "name": "ticket_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "author": { + "name": "author", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "chats_ticket_id_tickets_id_fk": { + "name": "chats_ticket_id_tickets_id_fk", + "tableFrom": "chats", + "tableTo": "tickets", + "columnsFrom": [ + "ticket_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.chats_to_users": { + "name": "chats_to_users", + "schema": "", + "columns": { + "chat_id": { + "name": "chat_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "chats_to_users_chat_id_chats_id_fk": { + "name": "chats_to_users_chat_id_chats_id_fk", + "tableFrom": "chats_to_users", + "tableTo": "chats", + "columnsFrom": [ + "chat_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "chats_to_users_user_id_user_common_data_clerk_id_fk": { + "name": "chats_to_users_user_id_user_common_data_clerk_id_fk", + "tableFrom": "chats_to_users", + "tableTo": "user_common_data", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "clerk_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "chats_to_users_user_id_chat_id_pk": { + "name": "chats_to_users_user_id_chat_id_pk", + "columns": [ + "user_id", + "chat_id" + ] + } + }, + "uniqueConstraints": {} + }, + "public.discord_verification": { + "name": "discord_verification", + "schema": "", + "columns": { + "code": { + "name": "code", + "type": "varchar(255)", + "primaryKey": true, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "clerk_id": { + "name": "clerk_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "discord_user_id": { + "name": "discord_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "discord_user_tag": { + "name": "discord_user_tag", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "discord_profile_photo": { + "name": "discord_profile_photo", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "discord_name": { + "name": "discord_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "discord_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "guild": { + "name": "guild", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.error_log": { + "name": "error_log", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar(50)", + "primaryKey": true, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "user_id": { + "name": "user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "route": { + "name": "route", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.events": { + "name": "events", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "start_time": { + "name": "start_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "host": { + "name": "host", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "hidden": { + "name": "hidden", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "events_id_unique": { + "name": "events_id_unique", + "nullsNotDistinct": false, + "columns": [ + "id" + ] + } + } + }, + "public.files": { + "name": "files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar(255)", + "primaryKey": true, + "notNull": true + }, + "presigned_url": { + "name": "presigned_url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "varchar(500)", + "primaryKey": false, + "notNull": true + }, + "validated": { + "name": "validated", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "owner_id": { + "name": "owner_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "files_id_unique": { + "name": "files_id_unique", + "nullsNotDistinct": false, + "columns": [ + "id" + ] + }, + "files_key_unique": { + "name": "files_key_unique", + "nullsNotDistinct": false, + "columns": [ + "key" + ] + } + } + }, + "public.invites": { + "name": "invites", + "schema": "", + "columns": { + "invitee_id": { + "name": "invitee_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "status": { + "name": "status", + "type": "invite_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "invites_invitee_id_team_id_pk": { + "name": "invites_invitee_id_team_id_pk", + "columns": [ + "invitee_id", + "team_id" + ] + } + }, + "uniqueConstraints": {} + }, + "public.scans": { + "name": "scans", + "schema": "", + "columns": { + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "user_id": { + "name": "user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "event_id": { + "name": "event_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "count": { + "name": "count", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "scans_user_id_event_id_pk": { + "name": "scans_user_id_event_id_pk", + "columns": [ + "user_id", + "event_id" + ] + } + }, + "uniqueConstraints": {} + }, + "public.teams": { + "name": "teams", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "varchar(50)", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "tag": { + "name": "tag", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "bio": { + "name": "bio", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "photo": { + "name": "photo", + "type": "varchar(400)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "owner_id": { + "name": "owner_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "devpost_url": { + "name": "devpost_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "teams_id_unique": { + "name": "teams_id_unique", + "nullsNotDistinct": false, + "columns": [ + "id" + ] + }, + "teams_tag_unique": { + "name": "teams_tag_unique", + "nullsNotDistinct": false, + "columns": [ + "tag" + ] + } + } + }, + "public.tickets": { + "name": "tickets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "ticket_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'awaiting'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.tickets_to_users": { + "name": "tickets_to_users", + "schema": "", + "columns": { + "ticket_id": { + "name": "ticket_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "tickets_to_users_ticket_id_tickets_id_fk": { + "name": "tickets_to_users_ticket_id_tickets_id_fk", + "tableFrom": "tickets_to_users", + "tableTo": "tickets", + "columnsFrom": [ + "ticket_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "tickets_to_users_user_id_user_common_data_clerk_id_fk": { + "name": "tickets_to_users_user_id_user_common_data_clerk_id_fk", + "tableFrom": "tickets_to_users", + "tableTo": "user_common_data", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "clerk_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "tickets_to_users_user_id_ticket_id_pk": { + "name": "tickets_to_users_user_id_ticket_id_pk", + "columns": [ + "user_id", + "ticket_id" + ] + } + }, + "uniqueConstraints": {} + }, + "public.user_common_data": { + "name": "user_common_data", + "schema": "", + "columns": { + "clerk_id": { + "name": "clerk_id", + "type": "varchar(255)", + "primaryKey": true, + "notNull": true + }, + "first_name": { + "name": "first_name", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "last_name": { + "name": "last_name", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "hacker_tag": { + "name": "hacker_tag", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "age": { + "name": "age", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "gender": { + "name": "gender", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "race": { + "name": "race", + "type": "varchar(75)", + "primaryKey": false, + "notNull": true + }, + "ethnicity": { + "name": "ethnicity", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "shirt_size": { + "name": "shirt_size", + "type": "varchar(5)", + "primaryKey": false, + "notNull": true + }, + "diet_restrictions": { + "name": "diet_restrictions", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "accommodation_note": { + "name": "accommodation_note", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "discord": { + "name": "discord", + "type": "varchar(60)", + "primaryKey": false, + "notNull": true + }, + "pronouns": { + "name": "pronouns", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "bio": { + "name": "bio", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "skills": { + "name": "skills", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'[]'::json" + }, + "profile_photo": { + "name": "profile_photo", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "is_fully_registered": { + "name": "is_fully_registered", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "signup_time": { + "name": "signup_time", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_searchable": { + "name": "is_searchable", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'hacker'" + }, + "checkin_timestamp": { + "name": "checkin_timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "is_rsvped": { + "name": "is_rsvped", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "is_approved": { + "name": "is_approved", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_common_data_email_unique": { + "name": "user_common_data_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + }, + "user_common_data_hacker_tag_unique": { + "name": "user_common_data_hacker_tag_unique", + "nullsNotDistinct": false, + "columns": [ + "hacker_tag" + ] + } + } + }, + "public.user_hacker_data": { + "name": "user_hacker_data", + "schema": "", + "columns": { + "clerk_id": { + "name": "clerk_id", + "type": "varchar(255)", + "primaryKey": true, + "notNull": true + }, + "university": { + "name": "university", + "type": "varchar(200)", + "primaryKey": false, + "notNull": true + }, + "major": { + "name": "major", + "type": "varchar(200)", + "primaryKey": false, + "notNull": true + }, + "schoolID": { + "name": "schoolID", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "level_of_study": { + "name": "level_of_study", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "hackathons_attended": { + "name": "hackathons_attended", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "software_experience": { + "name": "software_experience", + "type": "varchar(25)", + "primaryKey": false, + "notNull": true + }, + "heard_from": { + "name": "heard_from", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "github": { + "name": "github", + "type": "varchar(100)", + "primaryKey": false, + "notNull": false + }, + "linkedin": { + "name": "linkedin", + "type": "varchar(100)", + "primaryKey": false, + "notNull": false + }, + "personal_website": { + "name": "personal_website", + "type": "varchar(100)", + "primaryKey": false, + "notNull": false + }, + "resume": { + "name": "resume", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'https://static.acmutsa.org/No%20Resume%20Provided.pdf'" + }, + "group": { + "name": "group", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "team_id": { + "name": "team_id", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "points": { + "name": "points", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "has_accepted_mlh_coc": { + "name": "has_accepted_mlh_coc", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "has_shared_data_with_mlh": { + "name": "has_shared_data_with_mlh", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_emailable": { + "name": "is_emailable", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": { + "public.chat_type": { + "name": "chat_type", + "schema": "public", + "values": [ + "ticket" + ] + }, + "public.discord_status": { + "name": "discord_status", + "schema": "public", + "values": [ + "pending", + "expired", + "accepted", + "rejected" + ] + }, + "public.type": { + "name": "type", + "schema": "public", + "values": [ + "generic", + "resume" + ] + }, + "public.invite_status": { + "name": "invite_status", + "schema": "public", + "values": [ + "pending", + "accepted", + "declined" + ] + }, + "public.role": { + "name": "role", + "schema": "public", + "values": [ + "hacker", + "volunteer", + "mentor", + "mlh", + "admin", + "super_admin" + ] + }, + "public.ticket_status": { + "name": "ticket_status", + "schema": "public", + "values": [ + "awaiting", + "in_progress", + "completed" + ] + } + }, + "schemas": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/packages/db/drizzle/meta/_journal.json b/packages/db/drizzle/meta/_journal.json index 318c2baf..80bfbd0b 100644 --- a/packages/db/drizzle/meta/_journal.json +++ b/packages/db/drizzle/meta/_journal.json @@ -106,6 +106,13 @@ "when": 1721626835938, "tag": "0014_known_norman_osborn", "breakpoints": true + }, + { + "idx": 15, + "version": "7", + "when": 1722754144081, + "tag": "0015_orange_garia", + "breakpoints": true } ] } \ No newline at end of file