From 6fe45a0e670c0c60536983b5d4760dc9f4e8ed75 Mon Sep 17 00:00:00 2001 From: Ole Magnus Fon Johnsen Date: Fri, 2 Feb 2024 10:48:50 +0100 Subject: [PATCH] convert to sqlite --- .github/workflows/ci.yaml | 13 +- .github/workflows/staging.yaml | 25 + .gitignore | 1 + apps/web/next.config.mjs | 4 + .../admin/whitelist/_actions/grant-access.ts | 7 +- .../tilgang/[id]/_actions/request-access.ts | 7 +- package.json | 5 - packages/auth/src/drizzle-adapter.ts | 4 +- packages/db/drizzle.config.ts | 7 +- packages/db/drizzle/migrate.ts | 2 +- .../migrations/0000_curved_jazinda.sql | 223 +++ .../migrations/0000_parallel_onslaught.sql | 253 --- .../drizzle/migrations/0001_lame_iron_lad.sql | 22 - .../drizzle/migrations/0002_normal_famine.sql | 1 - .../drizzle/migrations/0003_known_shaman.sql | 11 - .../migrations/0004_soft_monster_badoon.sql | 3 - .../drizzle/migrations/0005_typical_ego.sql | 7 - .../drizzle/migrations/0006_messy_gravity.sql | 2 - .../migrations/0007_wild_silver_fox.sql | 8 - .../drizzle/migrations/0008_known_trauma.sql | 1 - .../migrations/0009_burly_wind_dancer.sql | 71 - .../migrations/0010_lucky_karen_page.sql | 31 - .../0011_luxuriant_carmella_unuscione.sql | 13 - .../migrations/0012_wide_vance_astro.sql | 41 - .../migrations/0013_tough_smiling_tiger.sql | 1 - .../migrations/0014_low_rafael_vega.sql | 1 - .../0015_chilly_william_stryker.sql | 9 - .../drizzle/migrations/0016_thin_wolfpack.sql | 6 - .../drizzle/migrations/0017_light_elektra.sql | 1 - .../migrations/0018_wakeful_blue_marvel.sql | 4 - .../0019_young_valeria_richards.sql | 6 - .../migrations/0020_fixed_fabian_cortez.sql | 13 - .../migrations/0021_daily_moon_knight.sql | 2 - .../migrations/0022_powerful_outlaw_kid.sql | 60 - .../migrations/meta/0000_snapshot.json | 1374 +++++++++------ .../migrations/meta/0001_snapshot.json | 1101 ------------ .../migrations/meta/0002_snapshot.json | 1102 ------------ .../migrations/meta/0003_snapshot.json | 1131 ------------ .../migrations/meta/0004_snapshot.json | 1110 ------------ .../migrations/meta/0005_snapshot.json | 1110 ------------ .../migrations/meta/0006_snapshot.json | 1139 ------------ .../migrations/meta/0007_snapshot.json | 1003 ----------- .../migrations/meta/0008_snapshot.json | 1011 ----------- .../migrations/meta/0009_snapshot.json | 997 ----------- .../migrations/meta/0010_snapshot.json | 1111 ------------ .../migrations/meta/0011_snapshot.json | 1169 ------------ .../migrations/meta/0012_snapshot.json | 1334 -------------- .../migrations/meta/0013_snapshot.json | 1340 -------------- .../migrations/meta/0014_snapshot.json | 1355 -------------- .../migrations/meta/0015_snapshot.json | 1413 --------------- .../migrations/meta/0016_snapshot.json | 1427 --------------- .../migrations/meta/0017_snapshot.json | 1442 --------------- .../migrations/meta/0018_snapshot.json | 1455 --------------- .../migrations/meta/0019_snapshot.json | 1458 --------------- .../migrations/meta/0020_snapshot.json | 1530 ---------------- .../migrations/meta/0021_snapshot.json | 1530 ---------------- .../migrations/meta/0022_snapshot.json | 1565 ----------------- .../db/drizzle/migrations/meta/_journal.json | 162 +- packages/db/package.json | 12 +- packages/db/src/error.ts | 7 + packages/db/src/index.ts | 61 +- packages/db/src/schemas/access-request.ts | 10 +- packages/db/src/schemas/accounts.ts | 4 +- packages/db/src/schemas/answers.ts | 10 +- packages/db/src/schemas/comments.ts | 11 +- packages/db/src/schemas/degrees.ts | 8 +- packages/db/src/schemas/enums.ts | 33 +- packages/db/src/schemas/groups.ts | 11 +- .../db/src/schemas/happenings-to-groups.ts | 8 +- packages/db/src/schemas/happenings.ts | 22 +- packages/db/src/schemas/kv.ts | 13 +- packages/db/src/schemas/questions.ts | 16 +- packages/db/src/schemas/reactions.ts | 7 +- packages/db/src/schemas/registrations.ts | 13 +- packages/db/src/schemas/sessions.ts | 6 +- .../db/src/schemas/shopping-list-items.ts | 11 +- packages/db/src/schemas/site-feedback.ts | 20 +- packages/db/src/schemas/spot-ranges.ts | 10 +- packages/db/src/schemas/strike-infos.ts | 12 +- packages/db/src/schemas/strikes.ts | 10 +- packages/db/src/schemas/users-to-groups.ts | 8 +- .../schemas/users-to-shopping-list-items.ts | 10 +- packages/db/src/schemas/users.ts | 31 +- .../db/src/schemas/verification-tokens.ts | 6 +- packages/db/src/schemas/whitelist.ts | 6 +- playwright/package.json | 4 +- playwright/web/register.spec.ts | 9 +- playwright/web/strikes.spec.ts | 10 +- pnpm-lock.yaml | 459 ++++- turbo.json | 2 +- 90 files changed, 1763 insertions(+), 29331 deletions(-) create mode 100644 .github/workflows/staging.yaml create mode 100644 packages/db/drizzle/migrations/0000_curved_jazinda.sql delete mode 100644 packages/db/drizzle/migrations/0000_parallel_onslaught.sql delete mode 100644 packages/db/drizzle/migrations/0001_lame_iron_lad.sql delete mode 100644 packages/db/drizzle/migrations/0002_normal_famine.sql delete mode 100644 packages/db/drizzle/migrations/0003_known_shaman.sql delete mode 100644 packages/db/drizzle/migrations/0004_soft_monster_badoon.sql delete mode 100644 packages/db/drizzle/migrations/0005_typical_ego.sql delete mode 100644 packages/db/drizzle/migrations/0006_messy_gravity.sql delete mode 100644 packages/db/drizzle/migrations/0007_wild_silver_fox.sql delete mode 100644 packages/db/drizzle/migrations/0008_known_trauma.sql delete mode 100644 packages/db/drizzle/migrations/0009_burly_wind_dancer.sql delete mode 100644 packages/db/drizzle/migrations/0010_lucky_karen_page.sql delete mode 100644 packages/db/drizzle/migrations/0011_luxuriant_carmella_unuscione.sql delete mode 100644 packages/db/drizzle/migrations/0012_wide_vance_astro.sql delete mode 100644 packages/db/drizzle/migrations/0013_tough_smiling_tiger.sql delete mode 100644 packages/db/drizzle/migrations/0014_low_rafael_vega.sql delete mode 100644 packages/db/drizzle/migrations/0015_chilly_william_stryker.sql delete mode 100644 packages/db/drizzle/migrations/0016_thin_wolfpack.sql delete mode 100644 packages/db/drizzle/migrations/0017_light_elektra.sql delete mode 100644 packages/db/drizzle/migrations/0018_wakeful_blue_marvel.sql delete mode 100644 packages/db/drizzle/migrations/0019_young_valeria_richards.sql delete mode 100644 packages/db/drizzle/migrations/0020_fixed_fabian_cortez.sql delete mode 100644 packages/db/drizzle/migrations/0021_daily_moon_knight.sql delete mode 100644 packages/db/drizzle/migrations/0022_powerful_outlaw_kid.sql delete mode 100644 packages/db/drizzle/migrations/meta/0001_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0002_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0003_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0004_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0005_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0006_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0007_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0008_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0009_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0010_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0011_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0012_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0013_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0014_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0015_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0016_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0017_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0018_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0019_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0020_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0021_snapshot.json delete mode 100644 packages/db/drizzle/migrations/meta/0022_snapshot.json create mode 100644 packages/db/src/error.ts diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5572a6e19f..3f4aac3b6f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,7 +6,7 @@ on: env: ADMIN_KEY: foobar - DATABASE_URL: postgres://postgres:postgres@localhost:5432/echo-web + DATABASE_URL: file:./dev.db NEXT_PUBLIC_SANITY_DATASET: "testing" FEIDE_CLIENT_ID: ${{ secrets.FEIDE_CLIENT_ID }} FEIDE_CLIENT_SECRET: ${{ secrets.FEIDE_CLIENT_SECRET }} @@ -18,17 +18,6 @@ jobs: ci: runs-on: ubuntu-latest - services: - postgres: - image: postgres:15.7 - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: echo-web - ports: - - 5432:5432 - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - steps: - uses: actions/checkout@v4 - uses: ./.github/actions/pnpm-install diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml new file mode 100644 index 0000000000..8a355c1673 --- /dev/null +++ b/.github/workflows/staging.yaml @@ -0,0 +1,25 @@ +name: Staging environment + +on: + pull_request: + types: [opened, synchronize, closed] + +jobs: + setup-db: + if: !always() + runs-on: ubuntu-latest + + steps: + - name: Checkout branch + uses: actions/checkout@v4 + + - name: Setup node + uses: ./.github/actions/pnpm-install + + - name: Create Database + uses: tursodatabase/create-database-action@v1 + with: + organization_name: ${{ secrets.TURSO_ORGANIZATION_NAME }} + api_token: ${{ secrets.TURSO_API_TOKEN }} + existing_database_name: ${{ secrets.TURSO_DATABASE_NAME }} + new_database_name: ${{ github.ref_name }} diff --git a/.gitignore b/.gitignore index fd4ee2265b..8172d2c702 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ package-lock.json # db postgres-data/ +*.db # email .react-email/ diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 137d9a5480..021fffe2ae 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -15,6 +15,10 @@ const config = { }, }, + experimental: { + esmExternals: false, + }, + images: { remotePatterns: [ { diff --git a/apps/web/src/app/(default)/admin/whitelist/_actions/grant-access.ts b/apps/web/src/app/(default)/admin/whitelist/_actions/grant-access.ts index 437c69e343..9229175972 100644 --- a/apps/web/src/app/(default)/admin/whitelist/_actions/grant-access.ts +++ b/apps/web/src/app/(default)/admin/whitelist/_actions/grant-access.ts @@ -2,7 +2,8 @@ import { eq } from "drizzle-orm"; -import { db, isPostgresIshError } from "@echo-webkom/db"; +import { db } from "@echo-webkom/db"; +import { isDatabaseError, SQLITE_CONSTRAINT_UNIQUE } from "@echo-webkom/db/error"; import { accessRequests, whitelist } from "@echo-webkom/db/schemas"; import { AccessGrantedEmail } from "@echo-webkom/email"; import { emailClient } from "@echo-webkom/email/client"; @@ -42,8 +43,8 @@ export const grantAccessAction = async (accessRequestId: string) => { await db.delete(accessRequests).where(eq(accessRequests.id, accessRequestId)); } catch (e) { - if (isPostgresIshError(e)) { - if (e.code === "23505") { + if (isDatabaseError(e)) { + if (e.code === SQLITE_CONSTRAINT_UNIQUE) { return { success: false, message: "E-posten er allerede i whitelist", diff --git a/apps/web/src/app/(default)/auth/tilgang/[id]/_actions/request-access.ts b/apps/web/src/app/(default)/auth/tilgang/[id]/_actions/request-access.ts index f22737042f..0c6efcc611 100644 --- a/apps/web/src/app/(default)/auth/tilgang/[id]/_actions/request-access.ts +++ b/apps/web/src/app/(default)/auth/tilgang/[id]/_actions/request-access.ts @@ -3,7 +3,8 @@ import { nanoid } from "nanoid"; import { z } from "zod"; -import { db, isPostgresIshError } from "@echo-webkom/db"; +import { db } from "@echo-webkom/db"; +import { isDatabaseError, SQLITE_CONSTRAINT_UNIQUE } from "@echo-webkom/db/error"; import { accessRequests } from "@echo-webkom/db/schemas"; import { AccessRequestNotificationEmail } from "@echo-webkom/email"; import { emailClient } from "@echo-webkom/email/client"; @@ -59,8 +60,8 @@ export const requestAccess = async (data: IRequestAccessForm): Promise process.exit(0), 2000)\"", "email:preview": "pnpm --filter=email preview", "lint": "turbo run lint", "lint:fix": "turbo run lint -- --fix", diff --git a/packages/auth/src/drizzle-adapter.ts b/packages/auth/src/drizzle-adapter.ts index b625161180..114b1ce26d 100644 --- a/packages/auth/src/drizzle-adapter.ts +++ b/packages/auth/src/drizzle-adapter.ts @@ -1,11 +1,11 @@ import crypto from "node:crypto"; import { and, eq } from "drizzle-orm"; -import { type PgDatabase } from "drizzle-orm/pg-core"; +import { type BaseSQLiteDatabase } from "drizzle-orm/sqlite-core"; import { type Adapter } from "next-auth/adapters"; import { accounts, sessions, users, verificationTokens } from "@echo-webkom/db/schemas"; -export const DrizzleAdapter = (client: InstanceType): Adapter => { +export const DrizzleAdapter = (client: InstanceType): Adapter => { return { async createUser(data) { return await client diff --git a/packages/db/drizzle.config.ts b/packages/db/drizzle.config.ts index a6b1dbe955..ebc93a6e6e 100644 --- a/packages/db/drizzle.config.ts +++ b/packages/db/drizzle.config.ts @@ -1,10 +1,13 @@ import { defineConfig } from "drizzle-kit"; export default defineConfig({ - dialect: "postgresql", out: "./drizzle/migrations", - schema: "./src/schemas", + schema: "./src/schemas/index.ts", + dialect: "sqlite", + driver: "turso", dbCredentials: { url: process.env.DATABASE_URL!, + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + authToken: process.env.DATABASE_AUTH_TOKEN || undefined, }, }); diff --git a/packages/db/drizzle/migrate.ts b/packages/db/drizzle/migrate.ts index cb490c0dfd..25a7b0da85 100644 --- a/packages/db/drizzle/migrate.ts +++ b/packages/db/drizzle/migrate.ts @@ -1,6 +1,6 @@ /* eslint-disable no-console */ import process from "node:process"; -import { migrate } from "drizzle-orm/postgres-js/migrator"; +import { migrate } from "drizzle-orm/libsql/migrator"; import { db } from "../src"; diff --git a/packages/db/drizzle/migrations/0000_curved_jazinda.sql b/packages/db/drizzle/migrations/0000_curved_jazinda.sql new file mode 100644 index 0000000000..873641fc99 --- /dev/null +++ b/packages/db/drizzle/migrations/0000_curved_jazinda.sql @@ -0,0 +1,223 @@ +CREATE TABLE `access_request` ( + `id` text PRIMARY KEY NOT NULL, + `email` text NOT NULL, + `reason` text NOT NULL, + `created_at` integer NOT NULL +); +--> statement-breakpoint +CREATE TABLE `account` ( + `user_id` text NOT NULL, + `type` text NOT NULL, + `provider` text NOT NULL, + `provider_account_id` text NOT NULL, + `refresh_token` text, + `access_token` text, + `expires_at` integer, + `token_type` text, + `scope` text, + `id_token` text, + `session_state` text, + PRIMARY KEY(`provider`, `provider_account_id`), + FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade +); +--> statement-breakpoint +CREATE TABLE `answer` ( + `user_id` text NOT NULL, + `happening_id` text NOT NULL, + `question_id` text NOT NULL, + `answer` blob, + PRIMARY KEY(`happening_id`, `question_id`, `user_id`), + FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade, + FOREIGN KEY (`happening_id`) REFERENCES `happening`(`id`) ON UPDATE no action ON DELETE cascade, + FOREIGN KEY (`question_id`) REFERENCES `question`(`id`) ON UPDATE no action ON DELETE cascade +); +--> statement-breakpoint +CREATE TABLE `comment` ( + `id` text PRIMARY KEY NOT NULL, + `post_id` text NOT NULL, + `parent_comment_id` text, + `user_id` text, + `content` text NOT NULL, + `created_at` integer NOT NULL, + `updated_at` integer NOT NULL, + FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE set null +); +--> statement-breakpoint +CREATE TABLE `degree` ( + `id` text PRIMARY KEY NOT NULL, + `name` text NOT NULL +); +--> statement-breakpoint +CREATE TABLE `group` ( + `id` text(255) PRIMARY KEY NOT NULL, + `name` text(255) NOT NULL +); +--> statement-breakpoint +CREATE TABLE `happenings_to_groups` ( + `happening_id` text NOT NULL, + `group_id` text NOT NULL, + PRIMARY KEY(`group_id`, `happening_id`), + FOREIGN KEY (`happening_id`) REFERENCES `happening`(`id`) ON UPDATE no action ON DELETE cascade, + FOREIGN KEY (`group_id`) REFERENCES `group`(`id`) ON UPDATE no action ON DELETE cascade +); +--> statement-breakpoint +CREATE TABLE `happening` ( + `id` text PRIMARY KEY NOT NULL, + `slug` text NOT NULL, + `title` text NOT NULL, + `type` text DEFAULT 'event' NOT NULL, + `date` integer, + `registration_groups` blob, + `registration_start_groups` integer, + `registration_start` integer, + `registration_end` integer +); +--> statement-breakpoint +CREATE TABLE `kv` ( + `key` text PRIMARY KEY NOT NULL, + `value` blob, + `ttl` integer +); +--> statement-breakpoint +CREATE TABLE `question` ( + `id` text PRIMARY KEY NOT NULL, + `title` text NOT NULL, + `required` integer DEFAULT false NOT NULL, + `type` text DEFAULT 'text' NOT NULL, + `is_sensitive` integer DEFAULT false NOT NULL, + `options` blob, + `happening_id` text NOT NULL, + FOREIGN KEY (`happening_id`) REFERENCES `happening`(`id`) ON UPDATE no action ON DELETE cascade +); +--> statement-breakpoint +CREATE TABLE `reaction` ( + `react_to_key` text NOT NULL, + `emoji_id` integer NOT NULL, + `user_id` text NOT NULL, + `created_at` integer NOT NULL, + PRIMARY KEY(`emoji_id`, `react_to_key`, `user_id`), + FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action +); +--> statement-breakpoint +CREATE TABLE `registration` ( + `user_id` text NOT NULL, + `happening_id` text NOT NULL, + `status` text DEFAULT 'waiting' NOT NULL, + `unregister_reason` text, + `created_at` integer NOT NULL, + `prev_status` text, + `changed_at` integer, + `changed_by` text, + PRIMARY KEY(`happening_id`, `user_id`), + FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action, + FOREIGN KEY (`happening_id`) REFERENCES `happening`(`id`) ON UPDATE no action ON DELETE cascade +); +--> statement-breakpoint +CREATE TABLE `session` ( + `session_token` text PRIMARY KEY NOT NULL, + `user_id` text NOT NULL, + `expires` integer NOT NULL, + FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade +); +--> statement-breakpoint +CREATE TABLE `site_feedback` ( + `id` text PRIMARY KEY NOT NULL, + `name` text, + `email` text, + `message` text NOT NULL, + `category` text NOT NULL, + `is_read` integer DEFAULT false NOT NULL, + `created_at` integer NOT NULL +); +--> statement-breakpoint +CREATE TABLE `spot_range` ( + `id` text PRIMARY KEY NOT NULL, + `happening_id` text NOT NULL, + `spots` integer NOT NULL, + `min_year` integer NOT NULL, + `max_year` integer NOT NULL, + FOREIGN KEY (`happening_id`) REFERENCES `happening`(`id`) ON UPDATE no action ON DELETE cascade +); +--> statement-breakpoint +CREATE TABLE `users_to_groups` ( + `user_id` text NOT NULL, + `group_id` text NOT NULL, + `is_leader` integer DEFAULT false NOT NULL, + PRIMARY KEY(`group_id`, `user_id`), + FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade, + FOREIGN KEY (`group_id`) REFERENCES `group`(`id`) ON UPDATE no action ON DELETE cascade +); +--> statement-breakpoint +CREATE TABLE `user` ( + `id` text PRIMARY KEY NOT NULL, + `name` text, + `email` text NOT NULL, + `email_verified` integer, + `image` text, + `alternative_email` text, + `degree_id` text, + `year` integer, + `type` text DEFAULT 'student' NOT NULL, + `is_banned` integer DEFAULT false NOT NULL, + `banned_from_strike` integer, + `last_sign_in_at` integer, + `updated_at` integer, + `created_at` integer, + FOREIGN KEY (`degree_id`) REFERENCES `degree`(`id`) ON UPDATE no action ON DELETE no action +); +--> statement-breakpoint +CREATE TABLE `verification_token` ( + `identifier` text NOT NULL, + `token` text NOT NULL, + `expires` integer NOT NULL, + PRIMARY KEY(`identifier`, `token`) +); +--> statement-breakpoint +CREATE TABLE `shopping_list_item` ( + `id` text PRIMARY KEY NOT NULL, + `user_id` text NOT NULL, + `name` text NOT NULL, + `created_at` integer NOT NULL, + FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade +); +--> statement-breakpoint +CREATE TABLE `users_to_shopping_list_items` ( + `user_id` text NOT NULL, + `item_id` text NOT NULL, + `created_at` integer NOT NULL, + PRIMARY KEY(`item_id`, `user_id`), + FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade, + FOREIGN KEY (`item_id`) REFERENCES `shopping_list_item`(`id`) ON UPDATE no action ON DELETE cascade +); +--> statement-breakpoint +CREATE TABLE `whitelist` ( + `email` text PRIMARY KEY NOT NULL, + `expires_at` integer NOT NULL, + `reason` text NOT NULL +); +--> statement-breakpoint +CREATE TABLE `strike` ( + `id` integer PRIMARY KEY NOT NULL, + `user_id` text NOT NULL, + `strike_info_id` text NOT NULL, + `is_deleted` integer DEFAULT false NOT NULL, + FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade, + FOREIGN KEY (`strike_info_id`) REFERENCES `strike_info`(`id`) ON UPDATE no action ON DELETE cascade +); +--> statement-breakpoint +CREATE TABLE `strike_info` ( + `id` text PRIMARY KEY NOT NULL, + `happening_id` text NOT NULL, + `issuer_id` text NOT NULL, + `reason` text NOT NULL, + `created_at` integer NOT NULL, + FOREIGN KEY (`happening_id`) REFERENCES `happening`(`id`) ON UPDATE no action ON DELETE no action, + FOREIGN KEY (`issuer_id`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE no action +); +--> statement-breakpoint +CREATE UNIQUE INDEX `access_request_email_unique` ON `access_request` (`email`);--> statement-breakpoint +CREATE INDEX `post_idx` ON `comment` (`post_id`);--> statement-breakpoint +CREATE UNIQUE INDEX `happening_slug_unique` ON `happening` (`slug`);--> statement-breakpoint +CREATE INDEX `slug_idx` ON `happening` (`slug`);--> statement-breakpoint +CREATE INDEX `email_idx` ON `user` (`email`);--> statement-breakpoint +CREATE INDEX `user_idx` ON `strike` (`user_id`,`id`); \ No newline at end of file diff --git a/packages/db/drizzle/migrations/0000_parallel_onslaught.sql b/packages/db/drizzle/migrations/0000_parallel_onslaught.sql deleted file mode 100644 index d65e607ed0..0000000000 --- a/packages/db/drizzle/migrations/0000_parallel_onslaught.sql +++ /dev/null @@ -1,253 +0,0 @@ -DO $$ BEGIN - CREATE TYPE "degree_type" AS ENUM('bachelors', 'masters', 'integrated', 'year'); -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - CREATE TYPE "feedback_category" AS ENUM('bug', 'feature', 'login', 'other'); -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - CREATE TYPE "happening_type" AS ENUM('bedpres', 'event', 'external'); -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - CREATE TYPE "question_type" AS ENUM('text', 'textarea', 'radio', 'checkbox'); -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - CREATE TYPE "registration_status" AS ENUM('registered', 'unregistered', 'removed', 'waiting'); -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - CREATE TYPE "user_type" AS ENUM('student', 'company', 'guest', 'alum'); -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "account" ( - "user_id" text NOT NULL, - "type" text NOT NULL, - "provider" text NOT NULL, - "provider_account_id" text NOT NULL, - "refresh_token" text, - "access_token" text, - "expires_at" integer, - "token_type" text, - "scope" text, - "id_token" text, - "session_state" text, - CONSTRAINT account_provider_provider_account_id_pk PRIMARY KEY("provider","provider_account_id") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "answer" ( - "user_id" text NOT NULL, - "happening_id" varchar NOT NULL, - "question_id" varchar NOT NULL, - "answer" json, - CONSTRAINT answer_user_id_happening_id_question_id_pk PRIMARY KEY("user_id","happening_id","question_id") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "degree" ( - "id" varchar NOT NULL, - "name" varchar NOT NULL, - CONSTRAINT degree_id_pk PRIMARY KEY("id") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "group" ( - "id" varchar NOT NULL, - "name" varchar NOT NULL, - "leader" text, - CONSTRAINT group_id_pk PRIMARY KEY("id") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "happenings_to_groups" ( - "happening_id" varchar NOT NULL, - "group_id" varchar NOT NULL, - CONSTRAINT happenings_to_groups_happening_id_group_id_pk PRIMARY KEY("happening_id","group_id") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "happening" ( - "id" varchar NOT NULL, - "slug" varchar NOT NULL, - "title" varchar NOT NULL, - "type" "happening_type" DEFAULT 'event' NOT NULL, - "date" timestamp, - "registration_start" timestamp, - "registration_end" timestamp, - CONSTRAINT happening_id_pk PRIMARY KEY("id") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "question" ( - "id" varchar NOT NULL, - "title" text NOT NULL, - "required" boolean DEFAULT false NOT NULL, - "type" "question_type" DEFAULT 'text' NOT NULL, - "is_sensitive" boolean DEFAULT false NOT NULL, - "options" json, - "happening_id" varchar NOT NULL, - CONSTRAINT question_id_pk PRIMARY KEY("id") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "registration" ( - "user_id" text NOT NULL, - "happening_id" text NOT NULL, - "status" "registration_status" DEFAULT 'waiting' NOT NULL, - "unregister_reason" text, - "created_at" timestamp DEFAULT now() NOT NULL, - CONSTRAINT registration_user_id_happening_id_pk PRIMARY KEY("user_id","happening_id") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "session" ( - "session_token" text NOT NULL, - "user_id" text NOT NULL, - "expires" timestamp NOT NULL, - CONSTRAINT session_session_token_pk PRIMARY KEY("session_token") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "site_feedback" ( - "id" varchar NOT NULL, - "name" varchar, - "email" varchar, - "message" text NOT NULL, - "category" "feedback_category" NOT NULL, - "is_read" boolean DEFAULT false NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - CONSTRAINT site_feedback_id_pk PRIMARY KEY("id") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "spot_range" ( - "id" varchar NOT NULL, - "happening_id" varchar NOT NULL, - "spots" integer NOT NULL, - "min_year" integer NOT NULL, - "max_year" integer NOT NULL, - CONSTRAINT spot_range_id_pk PRIMARY KEY("id") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "users_to_groups" ( - "user_id" text NOT NULL, - "group_id" varchar NOT NULL, - "is_leader" boolean DEFAULT false NOT NULL, - CONSTRAINT users_to_groups_user_id_group_id_pk PRIMARY KEY("user_id","group_id") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "user" ( - "id" text NOT NULL, - "name" text, - "email" text NOT NULL, - "email_verified" timestamp, - "image" text, - "alternative_email" varchar, - "degree_id" varchar, - "year" integer, - "type" "user_type" DEFAULT 'student' NOT NULL, - CONSTRAINT user_id_pk PRIMARY KEY("id") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "verification_token" ( - "identifier" text NOT NULL, - "token" text NOT NULL, - "expires" timestamp NOT NULL, - CONSTRAINT verification_token_identifier_token_pk PRIMARY KEY("identifier","token") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "whitelist" ( - "email" text NOT NULL, - "expires_at" timestamp NOT NULL, - "reason" text NOT NULL, - CONSTRAINT whitelist_email_pk PRIMARY KEY("email") -); ---> statement-breakpoint -CREATE INDEX IF NOT EXISTS "question_idx" ON "answer" ("question_id");--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "type_idx" ON "happening" ("type");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "slug_idx" ON "happening" ("slug");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "happening_id_title" ON "question" ("title","happening_id");--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "status_idx" ON "registration" ("status");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "happening_id_min_year_max_year" ON "spot_range" ("happening_id","min_year","max_year");--> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "account" ADD CONSTRAINT "account_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "answer" ADD CONSTRAINT "answer_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "answer" ADD CONSTRAINT "answer_happening_id_happening_id_fk" FOREIGN KEY ("happening_id") REFERENCES "happening"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "answer" ADD CONSTRAINT "answer_question_id_question_id_fk" FOREIGN KEY ("question_id") REFERENCES "question"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "group" ADD CONSTRAINT "group_leader_user_id_fk" FOREIGN KEY ("leader") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "question" ADD CONSTRAINT "question_happening_id_happening_id_fk" FOREIGN KEY ("happening_id") REFERENCES "happening"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "registration" ADD CONSTRAINT "registration_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "registration" ADD CONSTRAINT "registration_happening_id_happening_id_fk" FOREIGN KEY ("happening_id") REFERENCES "happening"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "session" ADD CONSTRAINT "session_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "spot_range" ADD CONSTRAINT "spot_range_happening_id_happening_id_fk" FOREIGN KEY ("happening_id") REFERENCES "happening"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_to_groups" ADD CONSTRAINT "users_to_groups_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_to_groups" ADD CONSTRAINT "users_to_groups_group_id_group_id_fk" FOREIGN KEY ("group_id") REFERENCES "group"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "user" ADD CONSTRAINT "user_degree_id_degree_id_fk" FOREIGN KEY ("degree_id") REFERENCES "degree"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/db/drizzle/migrations/0001_lame_iron_lad.sql b/packages/db/drizzle/migrations/0001_lame_iron_lad.sql deleted file mode 100644 index d706f32da5..0000000000 --- a/packages/db/drizzle/migrations/0001_lame_iron_lad.sql +++ /dev/null @@ -1,22 +0,0 @@ -ALTER TABLE "answer" ALTER COLUMN "happening_id" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "answer" ALTER COLUMN "question_id" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "degree" ALTER COLUMN "id" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "degree" ALTER COLUMN "name" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "group" ALTER COLUMN "id" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "group" ALTER COLUMN "name" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "happenings_to_groups" ALTER COLUMN "happening_id" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "happenings_to_groups" ALTER COLUMN "group_id" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "happening" ALTER COLUMN "id" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "happening" ALTER COLUMN "slug" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "happening" ALTER COLUMN "title" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "question" ALTER COLUMN "id" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "question" ALTER COLUMN "happening_id" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "site_feedback" ALTER COLUMN "name" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "site_feedback" ALTER COLUMN "email" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "spot_range" ALTER COLUMN "id" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "spot_range" ALTER COLUMN "happening_id" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "users_to_groups" ALTER COLUMN "group_id" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "user" ALTER COLUMN "alternative_email" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "user" ALTER COLUMN "degree_id" SET DATA TYPE varchar(255);--> statement-breakpoint -ALTER TABLE "happening" ADD COLUMN "registration_groups" json;--> statement-breakpoint -ALTER TABLE "happening" ADD COLUMN "registration_start_groups" timestamp; \ No newline at end of file diff --git a/packages/db/drizzle/migrations/0002_normal_famine.sql b/packages/db/drizzle/migrations/0002_normal_famine.sql deleted file mode 100644 index 6d376a16d7..0000000000 --- a/packages/db/drizzle/migrations/0002_normal_famine.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TYPE "registration_status" ADD VALUE 'pending'; \ No newline at end of file diff --git a/packages/db/drizzle/migrations/0003_known_shaman.sql b/packages/db/drizzle/migrations/0003_known_shaman.sql deleted file mode 100644 index a60e75a85a..0000000000 --- a/packages/db/drizzle/migrations/0003_known_shaman.sql +++ /dev/null @@ -1,11 +0,0 @@ -DO $$ BEGIN - ALTER TABLE "happenings_to_groups" ADD CONSTRAINT "happenings_to_groups_happening_id_happening_id_fk" FOREIGN KEY ("happening_id") REFERENCES "happening"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "happenings_to_groups" ADD CONSTRAINT "happenings_to_groups_group_id_group_id_fk" FOREIGN KEY ("group_id") REFERENCES "group"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/db/drizzle/migrations/0004_soft_monster_badoon.sql b/packages/db/drizzle/migrations/0004_soft_monster_badoon.sql deleted file mode 100644 index 774e7df502..0000000000 --- a/packages/db/drizzle/migrations/0004_soft_monster_badoon.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE "group" DROP CONSTRAINT "group_leader_user_id_fk"; ---> statement-breakpoint -ALTER TABLE "group" DROP COLUMN IF EXISTS "leader"; \ No newline at end of file diff --git a/packages/db/drizzle/migrations/0005_typical_ego.sql b/packages/db/drizzle/migrations/0005_typical_ego.sql deleted file mode 100644 index bb4cadc0ca..0000000000 --- a/packages/db/drizzle/migrations/0005_typical_ego.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE "happenings_to_groups" DROP CONSTRAINT "happenings_to_groups_happening_id_happening_id_fk"; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "happenings_to_groups" ADD CONSTRAINT "happenings_to_groups_happening_id_happening_id_fk" FOREIGN KEY ("happening_id") REFERENCES "happening"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/db/drizzle/migrations/0006_messy_gravity.sql b/packages/db/drizzle/migrations/0006_messy_gravity.sql deleted file mode 100644 index ea32450b6f..0000000000 --- a/packages/db/drizzle/migrations/0006_messy_gravity.sql +++ /dev/null @@ -1,2 +0,0 @@ -CREATE UNIQUE INDEX IF NOT EXISTS "unique_email_idx" ON "user" ("email");--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "unique_alternative_email_idx" ON "user" ("alternative_email"); \ No newline at end of file diff --git a/packages/db/drizzle/migrations/0007_wild_silver_fox.sql b/packages/db/drizzle/migrations/0007_wild_silver_fox.sql deleted file mode 100644 index 8f81871ac1..0000000000 --- a/packages/db/drizzle/migrations/0007_wild_silver_fox.sql +++ /dev/null @@ -1,8 +0,0 @@ -DROP INDEX IF EXISTS "question_idx";--> statement-breakpoint -DROP INDEX IF EXISTS "type_idx";--> statement-breakpoint -DROP INDEX IF EXISTS "slug_idx";--> statement-breakpoint -DROP INDEX IF EXISTS "happening_id_title";--> statement-breakpoint -DROP INDEX IF EXISTS "status_idx";--> statement-breakpoint -DROP INDEX IF EXISTS "happening_id_min_year_max_year";--> statement-breakpoint -DROP INDEX IF EXISTS "unique_email_idx";--> statement-breakpoint -DROP INDEX IF EXISTS "unique_alternative_email_idx"; \ No newline at end of file diff --git a/packages/db/drizzle/migrations/0008_known_trauma.sql b/packages/db/drizzle/migrations/0008_known_trauma.sql deleted file mode 100644 index e80db54b23..0000000000 --- a/packages/db/drizzle/migrations/0008_known_trauma.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "happening" ADD CONSTRAINT "happening_slug_unique" UNIQUE("slug"); \ No newline at end of file diff --git a/packages/db/drizzle/migrations/0009_burly_wind_dancer.sql b/packages/db/drizzle/migrations/0009_burly_wind_dancer.sql deleted file mode 100644 index dafbfb1f49..0000000000 --- a/packages/db/drizzle/migrations/0009_burly_wind_dancer.sql +++ /dev/null @@ -1,71 +0,0 @@ -ALTER TABLE "account" DROP CONSTRAINT "account_user_id_user_id_fk"; ---> statement-breakpoint -ALTER TABLE "answer" DROP CONSTRAINT "answer_user_id_user_id_fk"; ---> statement-breakpoint -ALTER TABLE "happenings_to_groups" DROP CONSTRAINT "happenings_to_groups_happening_id_happening_id_fk"; ---> statement-breakpoint -ALTER TABLE "question" DROP CONSTRAINT "question_happening_id_happening_id_fk"; ---> statement-breakpoint -ALTER TABLE "registration" DROP CONSTRAINT "registration_user_id_user_id_fk"; ---> statement-breakpoint -ALTER TABLE "session" DROP CONSTRAINT "session_user_id_user_id_fk"; ---> statement-breakpoint -ALTER TABLE "spot_range" DROP CONSTRAINT "spot_range_happening_id_happening_id_fk"; ---> statement-breakpoint -ALTER TABLE "users_to_groups" DROP CONSTRAINT "users_to_groups_user_id_user_id_fk"; ---> statement-breakpoint -ALTER TABLE "user" DROP CONSTRAINT "user_degree_id_degree_id_fk"; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "account" ADD CONSTRAINT "account_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "answer" ADD CONSTRAINT "answer_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "happenings_to_groups" ADD CONSTRAINT "happenings_to_groups_happening_id_happening_id_fk" FOREIGN KEY ("happening_id") REFERENCES "happening"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "question" ADD CONSTRAINT "question_happening_id_happening_id_fk" FOREIGN KEY ("happening_id") REFERENCES "happening"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "registration" ADD CONSTRAINT "registration_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "session" ADD CONSTRAINT "session_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "spot_range" ADD CONSTRAINT "spot_range_happening_id_happening_id_fk" FOREIGN KEY ("happening_id") REFERENCES "happening"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_to_groups" ADD CONSTRAINT "users_to_groups_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "user" ADD CONSTRAINT "user_degree_id_degree_id_fk" FOREIGN KEY ("degree_id") REFERENCES "degree"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/db/drizzle/migrations/0010_lucky_karen_page.sql b/packages/db/drizzle/migrations/0010_lucky_karen_page.sql deleted file mode 100644 index 49db615c9c..0000000000 --- a/packages/db/drizzle/migrations/0010_lucky_karen_page.sql +++ /dev/null @@ -1,31 +0,0 @@ -CREATE TABLE IF NOT EXISTS "shopping_list_item" ( - "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, - "user_id" text NOT NULL, - "name" text NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "users_to_shopping_list_items" ( - "user_id" text NOT NULL, - "item_id" uuid NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - CONSTRAINT "users_to_shopping_list_items_user_id_item_id_pk" PRIMARY KEY("user_id","item_id") -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "shopping_list_item" ADD CONSTRAINT "shopping_list_item_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_to_shopping_list_items" ADD CONSTRAINT "users_to_shopping_list_items_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_to_shopping_list_items" ADD CONSTRAINT "users_to_shopping_list_items_item_id_shopping_list_item_id_fk" FOREIGN KEY ("item_id") REFERENCES "shopping_list_item"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/db/drizzle/migrations/0011_luxuriant_carmella_unuscione.sql b/packages/db/drizzle/migrations/0011_luxuriant_carmella_unuscione.sql deleted file mode 100644 index 8da4b9c9c5..0000000000 --- a/packages/db/drizzle/migrations/0011_luxuriant_carmella_unuscione.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE IF NOT EXISTS "reaction" ( - "react_to_key" text NOT NULL, - "emoji_id" integer NOT NULL, - "user_id" text NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - CONSTRAINT "reaction_react_to_key_emoji_id_user_id_pk" PRIMARY KEY("react_to_key","emoji_id","user_id") -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "reaction" ADD CONSTRAINT "reaction_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/db/drizzle/migrations/0012_wide_vance_astro.sql b/packages/db/drizzle/migrations/0012_wide_vance_astro.sql deleted file mode 100644 index 6225c31699..0000000000 --- a/packages/db/drizzle/migrations/0012_wide_vance_astro.sql +++ /dev/null @@ -1,41 +0,0 @@ -CREATE TABLE IF NOT EXISTS "strike" ( - "id" serial PRIMARY KEY NOT NULL, - "user_id" text NOT NULL, - "strike_info_id" uuid NOT NULL, - "is_deleted" boolean DEFAULT false NOT NULL -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "strike_info" ( - "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, - "happening_id" varchar(255) NOT NULL, - "issuer_id" text NOT NULL, - "reason" text NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL -); ---> statement-breakpoint -ALTER TABLE "user" ADD COLUMN "is_banned" boolean DEFAULT false NOT NULL;--> statement-breakpoint -ALTER TABLE "user" ADD COLUMN "banned_from_strike" integer;--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "user_idx" ON "strike" ("user_id","id");--> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "strike" ADD CONSTRAINT "strike_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "strike" ADD CONSTRAINT "strike_strike_info_id_strike_info_id_fk" FOREIGN KEY ("strike_info_id") REFERENCES "strike_info"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "strike_info" ADD CONSTRAINT "strike_info_happening_id_happening_id_fk" FOREIGN KEY ("happening_id") REFERENCES "happening"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "strike_info" ADD CONSTRAINT "strike_info_issuer_id_user_id_fk" FOREIGN KEY ("issuer_id") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/db/drizzle/migrations/0013_tough_smiling_tiger.sql b/packages/db/drizzle/migrations/0013_tough_smiling_tiger.sql deleted file mode 100644 index af1041e27a..0000000000 --- a/packages/db/drizzle/migrations/0013_tough_smiling_tiger.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "registration" ADD COLUMN "registration_changed_at" text; \ No newline at end of file diff --git a/packages/db/drizzle/migrations/0014_low_rafael_vega.sql b/packages/db/drizzle/migrations/0014_low_rafael_vega.sql deleted file mode 100644 index 543486fe3c..0000000000 --- a/packages/db/drizzle/migrations/0014_low_rafael_vega.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX IF NOT EXISTS "slug_idx" ON "happening" ("slug"); \ No newline at end of file diff --git a/packages/db/drizzle/migrations/0015_chilly_william_stryker.sql b/packages/db/drizzle/migrations/0015_chilly_william_stryker.sql deleted file mode 100644 index cb018be7a8..0000000000 --- a/packages/db/drizzle/migrations/0015_chilly_william_stryker.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE IF NOT EXISTS "comment" ( - "id" text PRIMARY KEY NOT NULL, - "post_id" text NOT NULL, - "parent_comment_id" text, - "user_id" text NOT NULL, - "content" text NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - "updated_at" timestamp NOT NULL -); diff --git a/packages/db/drizzle/migrations/0016_thin_wolfpack.sql b/packages/db/drizzle/migrations/0016_thin_wolfpack.sql deleted file mode 100644 index e82d6ba0f2..0000000000 --- a/packages/db/drizzle/migrations/0016_thin_wolfpack.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE "comment" ALTER COLUMN "user_id" DROP NOT NULL;--> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "comment" ADD CONSTRAINT "comment_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/db/drizzle/migrations/0017_light_elektra.sql b/packages/db/drizzle/migrations/0017_light_elektra.sql deleted file mode 100644 index e396c0e681..0000000000 --- a/packages/db/drizzle/migrations/0017_light_elektra.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX IF NOT EXISTS "post_idx" ON "comment" ("post_id"); \ No newline at end of file diff --git a/packages/db/drizzle/migrations/0018_wakeful_blue_marvel.sql b/packages/db/drizzle/migrations/0018_wakeful_blue_marvel.sql deleted file mode 100644 index d01169ca10..0000000000 --- a/packages/db/drizzle/migrations/0018_wakeful_blue_marvel.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE "registration" ADD COLUMN "prev_status" "registration_status";--> statement-breakpoint -ALTER TABLE "registration" ADD COLUMN "changed_at" timestamp;--> statement-breakpoint -ALTER TABLE "registration" ADD COLUMN "changed_by" text;--> statement-breakpoint -ALTER TABLE "registration" DROP COLUMN IF EXISTS "registration_changed_at"; \ No newline at end of file diff --git a/packages/db/drizzle/migrations/0019_young_valeria_richards.sql b/packages/db/drizzle/migrations/0019_young_valeria_richards.sql deleted file mode 100644 index 39cd43bbd7..0000000000 --- a/packages/db/drizzle/migrations/0019_young_valeria_richards.sql +++ /dev/null @@ -1,6 +0,0 @@ -DROP INDEX IF EXISTS "post_idx";--> statement-breakpoint -DROP INDEX IF EXISTS "slug_idx";--> statement-breakpoint -DROP INDEX IF EXISTS "user_idx";--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "post_idx" ON "comment" USING btree (post_id);--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "slug_idx" ON "happening" USING btree (slug);--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "user_idx" ON "strike" USING btree (user_id,id); \ No newline at end of file diff --git a/packages/db/drizzle/migrations/0020_fixed_fabian_cortez.sql b/packages/db/drizzle/migrations/0020_fixed_fabian_cortez.sql deleted file mode 100644 index cbedd5e322..0000000000 --- a/packages/db/drizzle/migrations/0020_fixed_fabian_cortez.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE IF NOT EXISTS "access_request" ( - "id" text PRIMARY KEY NOT NULL, - "email" text NOT NULL, - "reason" text NOT NULL, - "created_at" timestamp DEFAULT now() NOT NULL, - CONSTRAINT "access_request_email_unique" UNIQUE("email") -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "cache" ( - "key" text PRIMARY KEY NOT NULL, - "value" json, - "ttl" timestamp DEFAULT now() + interval '1 day' NOT NULL -); diff --git a/packages/db/drizzle/migrations/0021_daily_moon_knight.sql b/packages/db/drizzle/migrations/0021_daily_moon_knight.sql deleted file mode 100644 index 08cef6739a..0000000000 --- a/packages/db/drizzle/migrations/0021_daily_moon_knight.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "cache" RENAME TO "kv";--> statement-breakpoint -ALTER TABLE "kv" ALTER COLUMN "ttl" DROP NOT NULL; \ No newline at end of file diff --git a/packages/db/drizzle/migrations/0022_powerful_outlaw_kid.sql b/packages/db/drizzle/migrations/0022_powerful_outlaw_kid.sql deleted file mode 100644 index 9bccc77e41..0000000000 --- a/packages/db/drizzle/migrations/0022_powerful_outlaw_kid.sql +++ /dev/null @@ -1,60 +0,0 @@ -ALTER TABLE "reaction" DROP CONSTRAINT "reaction_user_id_user_id_fk"; ---> statement-breakpoint -ALTER TABLE "registration" DROP CONSTRAINT "registration_user_id_user_id_fk"; ---> statement-breakpoint -ALTER TABLE "users_to_groups" DROP CONSTRAINT "users_to_groups_user_id_user_id_fk"; ---> statement-breakpoint -ALTER TABLE "users_to_groups" DROP CONSTRAINT "users_to_groups_group_id_group_id_fk"; ---> statement-breakpoint -ALTER TABLE "shopping_list_item" DROP CONSTRAINT "shopping_list_item_user_id_user_id_fk"; ---> statement-breakpoint -ALTER TABLE "users_to_shopping_list_items" DROP CONSTRAINT "users_to_shopping_list_items_user_id_user_id_fk"; ---> statement-breakpoint -ALTER TABLE "strike" DROP CONSTRAINT "strike_user_id_user_id_fk"; ---> statement-breakpoint -ALTER TABLE "user" ADD COLUMN "last_sign_in_at" timestamp;--> statement-breakpoint -ALTER TABLE "user" ADD COLUMN "updated_at" timestamp;--> statement-breakpoint -ALTER TABLE "user" ADD COLUMN "created_at" timestamp;--> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "reaction" ADD CONSTRAINT "reaction_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "registration" ADD CONSTRAINT "registration_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_to_groups" ADD CONSTRAINT "users_to_groups_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_to_groups" ADD CONSTRAINT "users_to_groups_group_id_group_id_fk" FOREIGN KEY ("group_id") REFERENCES "public"."group"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "shopping_list_item" ADD CONSTRAINT "shopping_list_item_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "users_to_shopping_list_items" ADD CONSTRAINT "users_to_shopping_list_items_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "strike" ADD CONSTRAINT "strike_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -CREATE INDEX IF NOT EXISTS "email_idx" ON "user" USING btree ("email"); \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0000_snapshot.json b/packages/db/drizzle/migrations/meta/0000_snapshot.json index c9b82594cb..7f11c61815 100644 --- a/packages/db/drizzle/migrations/meta/0000_snapshot.json +++ b/packages/db/drizzle/migrations/meta/0000_snapshot.json @@ -1,76 +1,133 @@ { - "version": "7", - "dialect": "postgresql", + "version": "6", + "dialect": "sqlite", + "id": "d16f1fe9-159f-4968-a9d6-429880cac329", + "prevId": "00000000-0000-0000-0000-000000000000", "tables": { - "public.account": { + "access_request": { + "name": "access_request", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "access_request_email_unique": { + "name": "access_request_email_unique", + "columns": [ + "email" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "account": { "name": "account", - "schema": "", "columns": { "user_id": { "name": "user_id", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "type": { "name": "type", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "provider": { "name": "provider", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "provider_account_id": { "name": "provider_account_id", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "refresh_token": { "name": "refresh_token", "type": "text", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "access_token": { "name": "access_token", "type": "text", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "expires_at": { "name": "expires_at", "type": "integer", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "token_type": { "name": "token_type", "type": "text", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "scope": { "name": "scope", "type": "text", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "id_token": { "name": "id_token", "type": "text", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "session_state": { "name": "session_state", "type": "text", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false } }, "indexes": {}, @@ -78,541 +135,675 @@ "account_user_id_user_id_fk": { "name": "account_user_id_user_id_fk", "tableFrom": "account", + "tableTo": "user", "columnsFrom": [ "user_id" ], - "tableTo": "user", - "schemaTo": "public", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": { "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", "columns": [ "provider", "provider_account_id" - ] + ], + "name": "account_provider_provider_account_id_pk" } }, "uniqueConstraints": {} }, - "public.answer": { + "answer": { "name": "answer", - "schema": "", "columns": { "user_id": { "name": "user_id", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "happening_id": { "name": "happening_id", - "type": "varchar", + "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "question_id": { "name": "question_id", - "type": "varchar", + "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "answer": { "name": "answer", - "type": "json", + "type": "blob", "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "question_idx": { - "columns": [ - { - "expression": "question_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "question_idx", - "isUnique": false, - "method": "btree", - "concurrently": false + "notNull": false, + "autoincrement": false } }, + "indexes": {}, "foreignKeys": { "answer_user_id_user_id_fk": { "name": "answer_user_id_user_id_fk", "tableFrom": "answer", + "tableTo": "user", "columnsFrom": [ "user_id" ], - "tableTo": "user", - "schemaTo": "public", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "answer_happening_id_happening_id_fk": { "name": "answer_happening_id_happening_id_fk", "tableFrom": "answer", + "tableTo": "happening", "columnsFrom": [ "happening_id" ], - "tableTo": "happening", - "schemaTo": "public", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" }, "answer_question_id_question_id_fk": { "name": "answer_question_id_question_id_fk", "tableFrom": "answer", + "tableTo": "question", "columnsFrom": [ "question_id" ], - "tableTo": "question", - "schemaTo": "public", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": { "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", "columns": [ - "user_id", "happening_id", - "question_id" - ] + "question_id", + "user_id" + ], + "name": "answer_user_id_happening_id_question_id_pk" } }, "uniqueConstraints": {} }, - "public.degree": { - "name": "degree", - "schema": "", + "comment": { + "name": "comment", "columns": { "id": { "name": "id", - "type": "varchar", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "post_id": { + "name": "post_id", + "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, - "name": { - "name": "name", - "type": "varchar", + "parent_comment_id": { + "name": "parent_comment_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false } }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", + "indexes": { + "post_idx": { + "name": "post_idx", "columns": [ + "post_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "comment_user_id_user_id_fk": { + "name": "comment_user_id_user_id_fk", + "tableFrom": "comment", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ "id" - ] + ], + "onDelete": "set null", + "onUpdate": "no action" } }, + "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "public.group": { - "name": "group", - "schema": "", + "degree": { + "name": "degree", "columns": { "id": { "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false }, "name": { "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "leader": { - "name": "leader", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true, + "autoincrement": false } }, "indexes": {}, - "foreignKeys": { - "group_leader_user_id_fk": { - "name": "group_leader_user_id_fk", - "tableFrom": "group", - "columnsFrom": [ - "leader" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "group": { + "name": "group", + "columns": { + "id": { + "name": "id", + "type": "text(255)", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false } }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "public.happenings_to_groups": { + "happenings_to_groups": { "name": "happenings_to_groups", - "schema": "", "columns": { "happening_id": { "name": "happening_id", - "type": "varchar", + "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "group_id": { "name": "group_id", - "type": "varchar", + "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false } }, "indexes": {}, - "foreignKeys": {}, + "foreignKeys": { + "happenings_to_groups_happening_id_happening_id_fk": { + "name": "happenings_to_groups_happening_id_happening_id_fk", + "tableFrom": "happenings_to_groups", + "tableTo": "happening", + "columnsFrom": [ + "happening_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "happenings_to_groups_group_id_group_id_fk": { + "name": "happenings_to_groups_group_id_group_id_fk", + "tableFrom": "happenings_to_groups", + "tableTo": "group", + "columnsFrom": [ + "group_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, "compositePrimaryKeys": { "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", "columns": [ - "happening_id", - "group_id" - ] + "group_id", + "happening_id" + ], + "name": "happenings_to_groups_happening_id_group_id_pk" } }, "uniqueConstraints": {} }, - "public.happening": { + "happening": { "name": "happening", - "schema": "", "columns": { "id": { "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false }, "slug": { "name": "slug", - "type": "varchar", + "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "title": { "name": "title", - "type": "varchar", + "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "type": { "name": "type", - "type": "happening_type", + "type": "text", "primaryKey": false, "notNull": true, + "autoincrement": false, "default": "'event'" }, "date": { "name": "date", - "type": "timestamp", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "registration_groups": { + "name": "registration_groups", + "type": "blob", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "registration_start_groups": { + "name": "registration_start_groups", + "type": "integer", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "registration_start": { "name": "registration_start", - "type": "timestamp", + "type": "integer", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "registration_end": { "name": "registration_end", - "type": "timestamp", + "type": "integer", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false } }, "indexes": { - "type_idx": { + "happening_slug_unique": { + "name": "happening_slug_unique", "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } + "slug" ], - "name": "type_idx", - "isUnique": false, - "method": "btree", - "concurrently": false + "isUnique": true }, "slug_idx": { + "name": "slug_idx", "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } + "slug" ], - "name": "slug_idx", - "isUnique": true, - "method": "btree", - "concurrently": false + "isUnique": false } }, "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "kv": { + "name": "kv", + "columns": { + "key": { + "name": "key", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "blob", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "ttl": { + "name": "ttl", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false } }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "public.question": { + "question": { "name": "question", - "schema": "", "columns": { "id": { "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false }, "title": { "name": "title", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "required": { "name": "required", - "type": "boolean", + "type": "integer", "primaryKey": false, "notNull": true, + "autoincrement": false, "default": false }, "type": { "name": "type", - "type": "question_type", + "type": "text", "primaryKey": false, "notNull": true, + "autoincrement": false, "default": "'text'" }, "is_sensitive": { "name": "is_sensitive", - "type": "boolean", + "type": "integer", "primaryKey": false, "notNull": true, + "autoincrement": false, "default": false }, "options": { "name": "options", - "type": "json", + "type": "blob", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "happening_id": { "name": "happening_id", - "type": "varchar", + "type": "text", "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "happening_id_title": { - "columns": [ - { - "expression": "title", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "happening_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "happening_id_title", - "isUnique": true, - "method": "btree", - "concurrently": false + "notNull": true, + "autoincrement": false } }, + "indexes": {}, "foreignKeys": { "question_happening_id_happening_id_fk": { "name": "question_happening_id_happening_id_fk", "tableFrom": "question", + "tableTo": "happening", "columnsFrom": [ "happening_id" ], - "tableTo": "happening", - "schemaTo": "public", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] + "onDelete": "cascade", + "onUpdate": "no action" } }, + "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "public.registration": { - "name": "registration", - "schema": "", + "reaction": { + "name": "reaction", "columns": { - "user_id": { - "name": "user_id", + "react_to_key": { + "name": "react_to_key", "type": "text", "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, - "status": { - "name": "status", - "type": "registration_status", + "emoji_id": { + "name": "emoji_id", + "type": "integer", "primaryKey": false, "notNull": true, - "default": "'waiting'" + "autoincrement": false }, - "unregister_reason": { - "name": "unregister_reason", + "user_id": { + "name": "user_id", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true, + "autoincrement": false }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "integer", "primaryKey": false, "notNull": true, - "default": "now()" - } - }, - "indexes": { - "status_idx": { - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "status_idx", - "isUnique": false, - "method": "btree", - "concurrently": false + "autoincrement": false } }, + "indexes": {}, "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", + "reaction_user_id_user_id_fk": { + "name": "reaction_user_id_user_id_fk", + "tableFrom": "reaction", + "tableTo": "user", "columnsFrom": [ "user_id" ], - "tableTo": "user", - "schemaTo": "public", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "reaction_react_to_key_emoji_id_user_id_pk": { + "columns": [ + "emoji_id", + "react_to_key", + "user_id" + ], + "name": "reaction_react_to_key_emoji_id_user_id_pk" + } + }, + "uniqueConstraints": {} + }, + "registration": { + "name": "registration", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "happening_id": { + "name": "happening_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'waiting'" + }, + "unregister_reason": { + "name": "unregister_reason", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "prev_status": { + "name": "prev_status", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "changed_at": { + "name": "changed_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "changed_by": { + "name": "changed_by", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "registration_user_id_user_id_fk": { + "name": "registration_user_id_user_id_fk", + "tableFrom": "registration", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "registration_happening_id_happening_id_fk": { + "name": "registration_happening_id_happening_id_fk", + "tableFrom": "registration", "tableTo": "happening", - "schemaTo": "public", + "columnsFrom": [ + "happening_id" + ], "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": { "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", "columns": [ - "user_id", - "happening_id" - ] + "happening_id", + "user_id" + ], + "name": "registration_user_id_happening_id_pk" } }, "uniqueConstraints": {} }, - "public.session": { + "session": { "name": "session", - "schema": "", "columns": { "session_token": { "name": "session_token", "type": "text", - "primaryKey": false, - "notNull": true + "primaryKey": true, + "notNull": true, + "autoincrement": false }, "user_id": { "name": "user_id", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "expires": { "name": "expires", - "type": "timestamp", + "type": "integer", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false } }, "indexes": {}, @@ -620,199 +811,160 @@ "session_user_id_user_id_fk": { "name": "session_user_id_user_id_fk", "tableFrom": "session", + "tableTo": "user", "columnsFrom": [ "user_id" ], - "tableTo": "user", - "schemaTo": "public", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] + "onDelete": "cascade", + "onUpdate": "no action" } }, + "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "public.site_feedback": { + "site_feedback": { "name": "site_feedback", - "schema": "", "columns": { "id": { "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false }, "name": { "name": "name", - "type": "varchar", + "type": "text", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "email": { "name": "email", - "type": "varchar", + "type": "text", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "message": { "name": "message", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "category": { "name": "category", - "type": "feedback_category", + "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "is_read": { "name": "is_read", - "type": "boolean", + "type": "integer", "primaryKey": false, "notNull": true, + "autoincrement": false, "default": false }, "created_at": { "name": "created_at", - "type": "timestamp", + "type": "integer", "primaryKey": false, "notNull": true, - "default": "now()" + "autoincrement": false } }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, + "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "public.spot_range": { + "spot_range": { "name": "spot_range", - "schema": "", "columns": { "id": { "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false }, "happening_id": { "name": "happening_id", - "type": "varchar", + "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "spots": { "name": "spots", "type": "integer", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "min_year": { "name": "min_year", "type": "integer", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "max_year": { "name": "max_year", "type": "integer", "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "happening_id_min_year_max_year": { - "columns": [ - { - "expression": "happening_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "min_year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "max_year", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "happening_id_min_year_max_year", - "isUnique": true, - "method": "btree", - "concurrently": false + "notNull": true, + "autoincrement": false } }, + "indexes": {}, "foreignKeys": { "spot_range_happening_id_happening_id_fk": { "name": "spot_range_happening_id_happening_id_fk", "tableFrom": "spot_range", + "tableTo": "happening", "columnsFrom": [ "happening_id" ], - "tableTo": "happening", - "schemaTo": "public", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] + "onDelete": "cascade", + "onUpdate": "no action" } }, + "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "public.users_to_groups": { + "users_to_groups": { "name": "users_to_groups", - "schema": "", "columns": { "user_id": { "name": "user_id", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "group_id": { "name": "group_id", - "type": "varchar", + "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "is_leader": { "name": "is_leader", - "type": "boolean", + "type": "integer", "primaryKey": false, "notNull": true, + "autoincrement": false, "default": false } }, @@ -821,269 +973,509 @@ "users_to_groups_user_id_user_id_fk": { "name": "users_to_groups_user_id_user_id_fk", "tableFrom": "users_to_groups", + "tableTo": "user", "columnsFrom": [ "user_id" ], - "tableTo": "user", - "schemaTo": "public", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "cascade", + "onUpdate": "no action" }, "users_to_groups_group_id_group_id_fk": { "name": "users_to_groups_group_id_group_id_fk", "tableFrom": "users_to_groups", + "tableTo": "group", "columnsFrom": [ "group_id" ], - "tableTo": "group", - "schemaTo": "public", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" + "onDelete": "cascade", + "onUpdate": "no action" } }, "compositePrimaryKeys": { "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", "columns": [ - "user_id", - "group_id" - ] + "group_id", + "user_id" + ], + "name": "users_to_groups_user_id_group_id_pk" } }, "uniqueConstraints": {} }, - "public.user": { + "user": { "name": "user", - "schema": "", "columns": { "id": { "name": "id", "type": "text", - "primaryKey": false, - "notNull": true + "primaryKey": true, + "notNull": true, + "autoincrement": false }, "name": { "name": "name", "type": "text", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "email": { "name": "email", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "email_verified": { "name": "email_verified", - "type": "timestamp", + "type": "integer", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "image": { "name": "image", "type": "text", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "alternative_email": { "name": "alternative_email", - "type": "varchar", + "type": "text", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "degree_id": { "name": "degree_id", - "type": "varchar", + "type": "text", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "year": { "name": "year", "type": "integer", "primaryKey": false, - "notNull": false + "notNull": false, + "autoincrement": false }, "type": { "name": "type", - "type": "user_type", + "type": "text", "primaryKey": false, "notNull": true, + "autoincrement": false, "default": "'student'" + }, + "is_banned": { + "name": "is_banned", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "banned_from_strike": { + "name": "banned_from_strike", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_sign_in_at": { + "name": "last_sign_in_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "email_idx": { + "name": "email_idx", + "columns": [ + "email" + ], + "isUnique": false } }, - "indexes": {}, "foreignKeys": { "user_degree_id_degree_id_fk": { "name": "user_degree_id_degree_id_fk", "tableFrom": "user", + "tableTo": "degree", "columnsFrom": [ "degree_id" ], - "tableTo": "degree", - "schemaTo": "public", "columnsTo": [ "id" ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] + "onDelete": "no action", + "onUpdate": "no action" } }, + "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "public.verification_token": { + "verification_token": { "name": "verification_token", - "schema": "", "columns": { "identifier": { "name": "identifier", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "token": { "name": "token", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "expires": { "name": "expires", - "type": "timestamp", + "type": "integer", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": { "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", "columns": [ "identifier", "token" - ] + ], + "name": "verification_token_identifier_token_pk" + } + }, + "uniqueConstraints": {} + }, + "shopping_list_item": { + "name": "shopping_list_item", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "shopping_list_item_user_id_user_id_fk": { + "name": "shopping_list_item_user_id_user_id_fk", + "tableFrom": "shopping_list_item", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "users_to_shopping_list_items": { + "name": "users_to_shopping_list_items", + "columns": { + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "item_id": { + "name": "item_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "users_to_shopping_list_items_user_id_user_id_fk": { + "name": "users_to_shopping_list_items_user_id_user_id_fk", + "tableFrom": "users_to_shopping_list_items", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "users_to_shopping_list_items_item_id_shopping_list_item_id_fk": { + "name": "users_to_shopping_list_items_item_id_shopping_list_item_id_fk", + "tableFrom": "users_to_shopping_list_items", + "tableTo": "shopping_list_item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "users_to_shopping_list_items_user_id_item_id_pk": { + "columns": [ + "item_id", + "user_id" + ], + "name": "users_to_shopping_list_items_user_id_item_id_pk" } }, "uniqueConstraints": {} }, - "public.whitelist": { + "whitelist": { "name": "whitelist", - "schema": "", "columns": { "email": { "name": "email", "type": "text", - "primaryKey": false, - "notNull": true + "primaryKey": true, + "notNull": true, + "autoincrement": false }, "expires_at": { "name": "expires_at", - "type": "timestamp", + "type": "integer", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false }, "reason": { "name": "reason", "type": "text", "primaryKey": false, - "notNull": true + "notNull": true, + "autoincrement": false } }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "strike": { + "name": "strike", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "strike_info_id": { + "name": "strike_info_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "is_deleted": { + "name": "is_deleted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + } + }, + "indexes": { + "user_idx": { + "name": "user_idx", "columns": [ - "email" - ] + "user_id", + "id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "strike_user_id_user_id_fk": { + "name": "strike_user_id_user_id_fk", + "tableFrom": "strike", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "strike_strike_info_id_strike_info_id_fk": { + "name": "strike_strike_info_id_strike_info_id_fk", + "tableFrom": "strike", + "tableTo": "strike_info", + "columnsFrom": [ + "strike_info_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" } }, + "compositePrimaryKeys": {}, "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] + "strike_info": { + "name": "strike_info", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "happening_id": { + "name": "happening_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "issuer_id": { + "name": "issuer_id", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": { + "strike_info_happening_id_happening_id_fk": { + "name": "strike_info_happening_id_happening_id_fk", + "tableFrom": "strike_info", + "tableTo": "happening", + "columnsFrom": [ + "happening_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "strike_info_issuer_id_user_id_fk": { + "name": "strike_info_issuer_id_user_id_fk", + "tableFrom": "strike_info", + "tableTo": "user", + "columnsFrom": [ + "issuer_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} } }, - "schemas": {}, + "enums": {}, "_meta": { "schemas": {}, "tables": {}, "columns": {} }, - "id": "c2bee28c-1136-4412-9ed0-bd5bdff91265", - "prevId": "00000000-0000-0000-0000-000000000000" + "internal": { + "indexes": {} + } } \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0001_snapshot.json b/packages/db/drizzle/migrations/meta/0001_snapshot.json deleted file mode 100644 index fef1cbc4b9..0000000000 --- a/packages/db/drizzle/migrations/meta/0001_snapshot.json +++ /dev/null @@ -1,1101 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "question_idx": { - "columns": [ - { - "expression": "question_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "question_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "leader": { - "name": "leader", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "group_leader_user_id_fk": { - "name": "group_leader_user_id_fk", - "tableFrom": "group", - "columnsFrom": [ - "leader" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "type_idx": { - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "type_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - }, - "slug_idx": { - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "slug_idx", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "happening_id_title": { - "columns": [ - { - "expression": "title", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "happening_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "happening_id_title", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "status_idx": { - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "status_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "happening_id_min_year_max_year": { - "columns": [ - { - "expression": "happening_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "min_year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "max_year", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "happening_id_min_year_max_year", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "primaryKey": false, - "notNull": true, - "default": "'student'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "bf942746-da94-4326-a6da-ee496ba255c1", - "prevId": "c2bee28c-1136-4412-9ed0-bd5bdff91265" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0002_snapshot.json b/packages/db/drizzle/migrations/meta/0002_snapshot.json deleted file mode 100644 index 70ba3d0118..0000000000 --- a/packages/db/drizzle/migrations/meta/0002_snapshot.json +++ /dev/null @@ -1,1102 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "question_idx": { - "columns": [ - { - "expression": "question_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "question_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "leader": { - "name": "leader", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "group_leader_user_id_fk": { - "name": "group_leader_user_id_fk", - "tableFrom": "group", - "columnsFrom": [ - "leader" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "type_idx": { - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "type_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - }, - "slug_idx": { - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "slug_idx", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "happening_id_title": { - "columns": [ - { - "expression": "title", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "happening_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "happening_id_title", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "status_idx": { - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "status_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "happening_id_min_year_max_year": { - "columns": [ - { - "expression": "happening_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "min_year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "max_year", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "happening_id_min_year_max_year", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "primaryKey": false, - "notNull": true, - "default": "'student'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "aef7c6fe-385c-4ca5-abe8-efc1b8bc42ab", - "prevId": "bf942746-da94-4326-a6da-ee496ba255c1" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0003_snapshot.json b/packages/db/drizzle/migrations/meta/0003_snapshot.json deleted file mode 100644 index ebe687f6e5..0000000000 --- a/packages/db/drizzle/migrations/meta/0003_snapshot.json +++ /dev/null @@ -1,1131 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "question_idx": { - "columns": [ - { - "expression": "question_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "question_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "leader": { - "name": "leader", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "group_leader_user_id_fk": { - "name": "group_leader_user_id_fk", - "tableFrom": "group", - "columnsFrom": [ - "leader" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "type_idx": { - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "type_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - }, - "slug_idx": { - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "slug_idx", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "happening_id_title": { - "columns": [ - { - "expression": "title", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "happening_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "happening_id_title", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "status_idx": { - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "status_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "happening_id_min_year_max_year": { - "columns": [ - { - "expression": "happening_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "min_year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "max_year", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "happening_id_min_year_max_year", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "primaryKey": false, - "notNull": true, - "default": "'student'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "3666cdd0-8146-46ff-8b46-5779395d8c9f", - "prevId": "aef7c6fe-385c-4ca5-abe8-efc1b8bc42ab" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0004_snapshot.json b/packages/db/drizzle/migrations/meta/0004_snapshot.json deleted file mode 100644 index c0092db419..0000000000 --- a/packages/db/drizzle/migrations/meta/0004_snapshot.json +++ /dev/null @@ -1,1110 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "question_idx": { - "columns": [ - { - "expression": "question_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "question_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "type_idx": { - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "type_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - }, - "slug_idx": { - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "slug_idx", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "happening_id_title": { - "columns": [ - { - "expression": "title", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "happening_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "happening_id_title", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "status_idx": { - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "status_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "happening_id_min_year_max_year": { - "columns": [ - { - "expression": "happening_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "min_year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "max_year", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "happening_id_min_year_max_year", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "primaryKey": false, - "notNull": true, - "default": "'student'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "a407deeb-b6a7-4a5b-a992-77a1998d42e6", - "prevId": "3666cdd0-8146-46ff-8b46-5779395d8c9f" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0005_snapshot.json b/packages/db/drizzle/migrations/meta/0005_snapshot.json deleted file mode 100644 index 05009dc795..0000000000 --- a/packages/db/drizzle/migrations/meta/0005_snapshot.json +++ /dev/null @@ -1,1110 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "question_idx": { - "columns": [ - { - "expression": "question_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "question_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "type_idx": { - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "type_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - }, - "slug_idx": { - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "slug_idx", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "happening_id_title": { - "columns": [ - { - "expression": "title", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "happening_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "happening_id_title", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "status_idx": { - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "status_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "happening_id_min_year_max_year": { - "columns": [ - { - "expression": "happening_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "min_year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "max_year", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "happening_id_min_year_max_year", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "primaryKey": false, - "notNull": true, - "default": "'student'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "7cae0878-7213-4158-aee7-f57b28eef738", - "prevId": "a407deeb-b6a7-4a5b-a992-77a1998d42e6" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0006_snapshot.json b/packages/db/drizzle/migrations/meta/0006_snapshot.json deleted file mode 100644 index e640952ade..0000000000 --- a/packages/db/drizzle/migrations/meta/0006_snapshot.json +++ /dev/null @@ -1,1139 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "question_idx": { - "columns": [ - { - "expression": "question_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "question_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "type_idx": { - "columns": [ - { - "expression": "type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "type_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - }, - "slug_idx": { - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "slug_idx", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "happening_id_title": { - "columns": [ - { - "expression": "title", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "happening_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "happening_id_title", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "status_idx": { - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "status_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "happening_id_min_year_max_year": { - "columns": [ - { - "expression": "happening_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "min_year", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "max_year", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "happening_id_min_year_max_year", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "primaryKey": false, - "notNull": true, - "default": "'student'" - } - }, - "indexes": { - "unique_email_idx": { - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "unique_email_idx", - "isUnique": true, - "method": "btree", - "concurrently": false - }, - "unique_alternative_email_idx": { - "columns": [ - { - "expression": "alternative_email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "unique_alternative_email_idx", - "isUnique": true, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "c5667ea7-6989-4cfa-918e-4aee1895c02a", - "prevId": "7cae0878-7213-4158-aee7-f57b28eef738" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0007_snapshot.json b/packages/db/drizzle/migrations/meta/0007_snapshot.json deleted file mode 100644 index e06f498ff9..0000000000 --- a/packages/db/drizzle/migrations/meta/0007_snapshot.json +++ /dev/null @@ -1,1003 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "primaryKey": false, - "notNull": true, - "default": "'student'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "65c06129-fe28-4a75-ac02-730a27062115", - "prevId": "c5667ea7-6989-4cfa-918e-4aee1895c02a" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0008_snapshot.json b/packages/db/drizzle/migrations/meta/0008_snapshot.json deleted file mode 100644 index 62e352a683..0000000000 --- a/packages/db/drizzle/migrations/meta/0008_snapshot.json +++ /dev/null @@ -1,1011 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "columns": [ - "slug" - ], - "nullsNotDistinct": false - } - } - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "primaryKey": false, - "notNull": true, - "default": "'student'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "schemaTo": "public", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "a403eef8-01f8-496a-b44f-969bec34c707", - "prevId": "65c06129-fe28-4a75-ac02-730a27062115" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0009_snapshot.json b/packages/db/drizzle/migrations/meta/0009_snapshot.json deleted file mode 100644 index f51086798c..0000000000 --- a/packages/db/drizzle/migrations/meta/0009_snapshot.json +++ /dev/null @@ -1,997 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "columns": [ - "slug" - ], - "nullsNotDistinct": false - } - } - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "primaryKey": false, - "notNull": true, - "default": "'student'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "73a1a849-bd80-4d93-993e-1f6910ab791e", - "prevId": "a403eef8-01f8-496a-b44f-969bec34c707" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0010_snapshot.json b/packages/db/drizzle/migrations/meta/0010_snapshot.json deleted file mode 100644 index ff610be67e..0000000000 --- a/packages/db/drizzle/migrations/meta/0010_snapshot.json +++ /dev/null @@ -1,1111 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "columns": [ - "slug" - ], - "nullsNotDistinct": false - } - } - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "primaryKey": false, - "notNull": true, - "default": "'student'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.shopping_list_item": { - "name": "shopping_list_item", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "shopping_list_item_user_id_user_id_fk": { - "name": "shopping_list_item_user_id_user_id_fk", - "tableFrom": "shopping_list_item", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.users_to_shopping_list_items": { - "name": "users_to_shopping_list_items", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "item_id": { - "name": "item_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_shopping_list_items_user_id_user_id_fk": { - "name": "users_to_shopping_list_items_user_id_user_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_shopping_list_items_item_id_shopping_list_item_id_fk": { - "name": "users_to_shopping_list_items_item_id_shopping_list_item_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "item_id" - ], - "tableTo": "shopping_list_item", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "users_to_shopping_list_items_user_id_item_id_pk": { - "name": "users_to_shopping_list_items_user_id_item_id_pk", - "columns": [ - "user_id", - "item_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "56cced97-9b85-434d-933f-92e3561de962", - "prevId": "73a1a849-bd80-4d93-993e-1f6910ab791e" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0011_snapshot.json b/packages/db/drizzle/migrations/meta/0011_snapshot.json deleted file mode 100644 index 0d8e879f83..0000000000 --- a/packages/db/drizzle/migrations/meta/0011_snapshot.json +++ /dev/null @@ -1,1169 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "columns": [ - "slug" - ], - "nullsNotDistinct": false - } - } - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.reaction": { - "name": "reaction", - "schema": "", - "columns": { - "react_to_key": { - "name": "react_to_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emoji_id": { - "name": "emoji_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "reaction_user_id_user_id_fk": { - "name": "reaction_user_id_user_id_fk", - "tableFrom": "reaction", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "reaction_react_to_key_emoji_id_user_id_pk": { - "name": "reaction_react_to_key_emoji_id_user_id_pk", - "columns": [ - "react_to_key", - "emoji_id", - "user_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "primaryKey": false, - "notNull": true, - "default": "'student'" - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.shopping_list_item": { - "name": "shopping_list_item", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "shopping_list_item_user_id_user_id_fk": { - "name": "shopping_list_item_user_id_user_id_fk", - "tableFrom": "shopping_list_item", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.users_to_shopping_list_items": { - "name": "users_to_shopping_list_items", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "item_id": { - "name": "item_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_shopping_list_items_user_id_user_id_fk": { - "name": "users_to_shopping_list_items_user_id_user_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_shopping_list_items_item_id_shopping_list_item_id_fk": { - "name": "users_to_shopping_list_items_item_id_shopping_list_item_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "item_id" - ], - "tableTo": "shopping_list_item", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "users_to_shopping_list_items_user_id_item_id_pk": { - "name": "users_to_shopping_list_items_user_id_item_id_pk", - "columns": [ - "user_id", - "item_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "b488748b-d6ae-4596-b745-24e98a1a1358", - "prevId": "56cced97-9b85-434d-933f-92e3561de962" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0012_snapshot.json b/packages/db/drizzle/migrations/meta/0012_snapshot.json deleted file mode 100644 index cca4d70282..0000000000 --- a/packages/db/drizzle/migrations/meta/0012_snapshot.json +++ /dev/null @@ -1,1334 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "columns": [ - "slug" - ], - "nullsNotDistinct": false - } - } - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.reaction": { - "name": "reaction", - "schema": "", - "columns": { - "react_to_key": { - "name": "react_to_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emoji_id": { - "name": "emoji_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "reaction_user_id_user_id_fk": { - "name": "reaction_user_id_user_id_fk", - "tableFrom": "reaction", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "reaction_react_to_key_emoji_id_user_id_pk": { - "name": "reaction_react_to_key_emoji_id_user_id_pk", - "columns": [ - "react_to_key", - "emoji_id", - "user_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "primaryKey": false, - "notNull": true, - "default": "'student'" - }, - "is_banned": { - "name": "is_banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned_from_strike": { - "name": "banned_from_strike", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.shopping_list_item": { - "name": "shopping_list_item", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "shopping_list_item_user_id_user_id_fk": { - "name": "shopping_list_item_user_id_user_id_fk", - "tableFrom": "shopping_list_item", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.users_to_shopping_list_items": { - "name": "users_to_shopping_list_items", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "item_id": { - "name": "item_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_shopping_list_items_user_id_user_id_fk": { - "name": "users_to_shopping_list_items_user_id_user_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_shopping_list_items_item_id_shopping_list_item_id_fk": { - "name": "users_to_shopping_list_items_item_id_shopping_list_item_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "item_id" - ], - "tableTo": "shopping_list_item", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "users_to_shopping_list_items_user_id_item_id_pk": { - "name": "users_to_shopping_list_items_user_id_item_id_pk", - "columns": [ - "user_id", - "item_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - }, - "public.strike": { - "name": "strike", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "strike_info_id": { - "name": "strike_info_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "is_deleted": { - "name": "is_deleted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "user_idx": { - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "user_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "strike_user_id_user_id_fk": { - "name": "strike_user_id_user_id_fk", - "tableFrom": "strike", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "strike_strike_info_id_strike_info_id_fk": { - "name": "strike_strike_info_id_strike_info_id_fk", - "tableFrom": "strike", - "columnsFrom": [ - "strike_info_id" - ], - "tableTo": "strike_info", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.strike_info": { - "name": "strike_info", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "issuer_id": { - "name": "issuer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "strike_info_happening_id_happening_id_fk": { - "name": "strike_info_happening_id_happening_id_fk", - "tableFrom": "strike_info", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "strike_info_issuer_id_user_id_fk": { - "name": "strike_info_issuer_id_user_id_fk", - "tableFrom": "strike_info", - "columnsFrom": [ - "issuer_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "5e84880d-f0bf-405b-9d5c-c336616800c0", - "prevId": "b488748b-d6ae-4596-b745-24e98a1a1358" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0013_snapshot.json b/packages/db/drizzle/migrations/meta/0013_snapshot.json deleted file mode 100644 index 50cc91fbe1..0000000000 --- a/packages/db/drizzle/migrations/meta/0013_snapshot.json +++ /dev/null @@ -1,1340 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "columns": [ - "slug" - ], - "nullsNotDistinct": false - } - } - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.reaction": { - "name": "reaction", - "schema": "", - "columns": { - "react_to_key": { - "name": "react_to_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emoji_id": { - "name": "emoji_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "reaction_user_id_user_id_fk": { - "name": "reaction_user_id_user_id_fk", - "tableFrom": "reaction", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "reaction_react_to_key_emoji_id_user_id_pk": { - "name": "reaction_react_to_key_emoji_id_user_id_pk", - "columns": [ - "react_to_key", - "emoji_id", - "user_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "registration_changed_at": { - "name": "registration_changed_at", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "primaryKey": false, - "notNull": true, - "default": "'student'" - }, - "is_banned": { - "name": "is_banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned_from_strike": { - "name": "banned_from_strike", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.shopping_list_item": { - "name": "shopping_list_item", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "shopping_list_item_user_id_user_id_fk": { - "name": "shopping_list_item_user_id_user_id_fk", - "tableFrom": "shopping_list_item", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.users_to_shopping_list_items": { - "name": "users_to_shopping_list_items", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "item_id": { - "name": "item_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_shopping_list_items_user_id_user_id_fk": { - "name": "users_to_shopping_list_items_user_id_user_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_shopping_list_items_item_id_shopping_list_item_id_fk": { - "name": "users_to_shopping_list_items_item_id_shopping_list_item_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "item_id" - ], - "tableTo": "shopping_list_item", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "users_to_shopping_list_items_user_id_item_id_pk": { - "name": "users_to_shopping_list_items_user_id_item_id_pk", - "columns": [ - "user_id", - "item_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - }, - "public.strike": { - "name": "strike", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "strike_info_id": { - "name": "strike_info_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "is_deleted": { - "name": "is_deleted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "user_idx": { - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "user_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "strike_user_id_user_id_fk": { - "name": "strike_user_id_user_id_fk", - "tableFrom": "strike", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "strike_strike_info_id_strike_info_id_fk": { - "name": "strike_strike_info_id_strike_info_id_fk", - "tableFrom": "strike", - "columnsFrom": [ - "strike_info_id" - ], - "tableTo": "strike_info", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.strike_info": { - "name": "strike_info", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "issuer_id": { - "name": "issuer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "strike_info_happening_id_happening_id_fk": { - "name": "strike_info_happening_id_happening_id_fk", - "tableFrom": "strike_info", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "strike_info_issuer_id_user_id_fk": { - "name": "strike_info_issuer_id_user_id_fk", - "tableFrom": "strike_info", - "columnsFrom": [ - "issuer_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "5a364031-f03a-4668-b1a6-d4581b79e04d", - "prevId": "5e84880d-f0bf-405b-9d5c-c336616800c0" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0014_snapshot.json b/packages/db/drizzle/migrations/meta/0014_snapshot.json deleted file mode 100644 index be482f79f8..0000000000 --- a/packages/db/drizzle/migrations/meta/0014_snapshot.json +++ /dev/null @@ -1,1355 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "slug_idx": { - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "slug_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "columns": [ - "slug" - ], - "nullsNotDistinct": false - } - } - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.reaction": { - "name": "reaction", - "schema": "", - "columns": { - "react_to_key": { - "name": "react_to_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emoji_id": { - "name": "emoji_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "reaction_user_id_user_id_fk": { - "name": "reaction_user_id_user_id_fk", - "tableFrom": "reaction", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "reaction_react_to_key_emoji_id_user_id_pk": { - "name": "reaction_react_to_key_emoji_id_user_id_pk", - "columns": [ - "react_to_key", - "emoji_id", - "user_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "registration_changed_at": { - "name": "registration_changed_at", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "primaryKey": false, - "notNull": true, - "default": "'student'" - }, - "is_banned": { - "name": "is_banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned_from_strike": { - "name": "banned_from_strike", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.shopping_list_item": { - "name": "shopping_list_item", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "shopping_list_item_user_id_user_id_fk": { - "name": "shopping_list_item_user_id_user_id_fk", - "tableFrom": "shopping_list_item", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.users_to_shopping_list_items": { - "name": "users_to_shopping_list_items", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "item_id": { - "name": "item_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_shopping_list_items_user_id_user_id_fk": { - "name": "users_to_shopping_list_items_user_id_user_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_shopping_list_items_item_id_shopping_list_item_id_fk": { - "name": "users_to_shopping_list_items_item_id_shopping_list_item_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "item_id" - ], - "tableTo": "shopping_list_item", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "users_to_shopping_list_items_user_id_item_id_pk": { - "name": "users_to_shopping_list_items_user_id_item_id_pk", - "columns": [ - "user_id", - "item_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - }, - "public.strike": { - "name": "strike", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "strike_info_id": { - "name": "strike_info_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "is_deleted": { - "name": "is_deleted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "user_idx": { - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "user_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "strike_user_id_user_id_fk": { - "name": "strike_user_id_user_id_fk", - "tableFrom": "strike", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "strike_strike_info_id_strike_info_id_fk": { - "name": "strike_strike_info_id_strike_info_id_fk", - "tableFrom": "strike", - "columnsFrom": [ - "strike_info_id" - ], - "tableTo": "strike_info", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.strike_info": { - "name": "strike_info", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "issuer_id": { - "name": "issuer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "strike_info_happening_id_happening_id_fk": { - "name": "strike_info_happening_id_happening_id_fk", - "tableFrom": "strike_info", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "strike_info_issuer_id_user_id_fk": { - "name": "strike_info_issuer_id_user_id_fk", - "tableFrom": "strike_info", - "columnsFrom": [ - "issuer_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "f16025e7-1020-4088-a857-d40cfcdb391e", - "prevId": "5a364031-f03a-4668-b1a6-d4581b79e04d" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0015_snapshot.json b/packages/db/drizzle/migrations/meta/0015_snapshot.json deleted file mode 100644 index 7cc481cbe4..0000000000 --- a/packages/db/drizzle/migrations/meta/0015_snapshot.json +++ /dev/null @@ -1,1413 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.comment": { - "name": "comment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "post_id": { - "name": "post_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_comment_id": { - "name": "parent_comment_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "slug_idx": { - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "slug_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "columns": [ - "slug" - ], - "nullsNotDistinct": false - } - } - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.reaction": { - "name": "reaction", - "schema": "", - "columns": { - "react_to_key": { - "name": "react_to_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emoji_id": { - "name": "emoji_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "reaction_user_id_user_id_fk": { - "name": "reaction_user_id_user_id_fk", - "tableFrom": "reaction", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "reaction_react_to_key_emoji_id_user_id_pk": { - "name": "reaction_react_to_key_emoji_id_user_id_pk", - "columns": [ - "react_to_key", - "emoji_id", - "user_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "registration_changed_at": { - "name": "registration_changed_at", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'student'" - }, - "is_banned": { - "name": "is_banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned_from_strike": { - "name": "banned_from_strike", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.shopping_list_item": { - "name": "shopping_list_item", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "shopping_list_item_user_id_user_id_fk": { - "name": "shopping_list_item_user_id_user_id_fk", - "tableFrom": "shopping_list_item", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.users_to_shopping_list_items": { - "name": "users_to_shopping_list_items", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "item_id": { - "name": "item_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_shopping_list_items_user_id_user_id_fk": { - "name": "users_to_shopping_list_items_user_id_user_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_shopping_list_items_item_id_shopping_list_item_id_fk": { - "name": "users_to_shopping_list_items_item_id_shopping_list_item_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "item_id" - ], - "tableTo": "shopping_list_item", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "users_to_shopping_list_items_user_id_item_id_pk": { - "name": "users_to_shopping_list_items_user_id_item_id_pk", - "columns": [ - "user_id", - "item_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - }, - "public.strike": { - "name": "strike", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "strike_info_id": { - "name": "strike_info_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "is_deleted": { - "name": "is_deleted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "user_idx": { - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "user_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "strike_user_id_user_id_fk": { - "name": "strike_user_id_user_id_fk", - "tableFrom": "strike", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "strike_strike_info_id_strike_info_id_fk": { - "name": "strike_strike_info_id_strike_info_id_fk", - "tableFrom": "strike", - "columnsFrom": [ - "strike_info_id" - ], - "tableTo": "strike_info", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.strike_info": { - "name": "strike_info", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "issuer_id": { - "name": "issuer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "strike_info_happening_id_happening_id_fk": { - "name": "strike_info_happening_id_happening_id_fk", - "tableFrom": "strike_info", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "strike_info_issuer_id_user_id_fk": { - "name": "strike_info_issuer_id_user_id_fk", - "tableFrom": "strike_info", - "columnsFrom": [ - "issuer_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "3678558c-21b7-41ed-9838-e3d5d1701c4d", - "prevId": "f16025e7-1020-4088-a857-d40cfcdb391e" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0016_snapshot.json b/packages/db/drizzle/migrations/meta/0016_snapshot.json deleted file mode 100644 index 14d95859fb..0000000000 --- a/packages/db/drizzle/migrations/meta/0016_snapshot.json +++ /dev/null @@ -1,1427 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.comment": { - "name": "comment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "post_id": { - "name": "post_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_comment_id": { - "name": "parent_comment_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "comment_user_id_user_id_fk": { - "name": "comment_user_id_user_id_fk", - "tableFrom": "comment", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "slug_idx": { - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "slug_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "columns": [ - "slug" - ], - "nullsNotDistinct": false - } - } - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.reaction": { - "name": "reaction", - "schema": "", - "columns": { - "react_to_key": { - "name": "react_to_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emoji_id": { - "name": "emoji_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "reaction_user_id_user_id_fk": { - "name": "reaction_user_id_user_id_fk", - "tableFrom": "reaction", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "reaction_react_to_key_emoji_id_user_id_pk": { - "name": "reaction_react_to_key_emoji_id_user_id_pk", - "columns": [ - "react_to_key", - "emoji_id", - "user_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "registration_changed_at": { - "name": "registration_changed_at", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'student'" - }, - "is_banned": { - "name": "is_banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned_from_strike": { - "name": "banned_from_strike", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.shopping_list_item": { - "name": "shopping_list_item", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "shopping_list_item_user_id_user_id_fk": { - "name": "shopping_list_item_user_id_user_id_fk", - "tableFrom": "shopping_list_item", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.users_to_shopping_list_items": { - "name": "users_to_shopping_list_items", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "item_id": { - "name": "item_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_shopping_list_items_user_id_user_id_fk": { - "name": "users_to_shopping_list_items_user_id_user_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_shopping_list_items_item_id_shopping_list_item_id_fk": { - "name": "users_to_shopping_list_items_item_id_shopping_list_item_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "item_id" - ], - "tableTo": "shopping_list_item", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "users_to_shopping_list_items_user_id_item_id_pk": { - "name": "users_to_shopping_list_items_user_id_item_id_pk", - "columns": [ - "user_id", - "item_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - }, - "public.strike": { - "name": "strike", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "strike_info_id": { - "name": "strike_info_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "is_deleted": { - "name": "is_deleted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "user_idx": { - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "user_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "strike_user_id_user_id_fk": { - "name": "strike_user_id_user_id_fk", - "tableFrom": "strike", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "strike_strike_info_id_strike_info_id_fk": { - "name": "strike_strike_info_id_strike_info_id_fk", - "tableFrom": "strike", - "columnsFrom": [ - "strike_info_id" - ], - "tableTo": "strike_info", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.strike_info": { - "name": "strike_info", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "issuer_id": { - "name": "issuer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "strike_info_happening_id_happening_id_fk": { - "name": "strike_info_happening_id_happening_id_fk", - "tableFrom": "strike_info", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "strike_info_issuer_id_user_id_fk": { - "name": "strike_info_issuer_id_user_id_fk", - "tableFrom": "strike_info", - "columnsFrom": [ - "issuer_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "4663786b-5650-4324-948d-13639efb33e3", - "prevId": "3678558c-21b7-41ed-9838-e3d5d1701c4d" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0017_snapshot.json b/packages/db/drizzle/migrations/meta/0017_snapshot.json deleted file mode 100644 index 1debfe82a8..0000000000 --- a/packages/db/drizzle/migrations/meta/0017_snapshot.json +++ /dev/null @@ -1,1442 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.comment": { - "name": "comment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "post_id": { - "name": "post_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_comment_id": { - "name": "parent_comment_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "post_idx": { - "columns": [ - { - "expression": "post_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "post_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "comment_user_id_user_id_fk": { - "name": "comment_user_id_user_id_fk", - "tableFrom": "comment", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "slug_idx": { - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "slug_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "columns": [ - "slug" - ], - "nullsNotDistinct": false - } - } - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.reaction": { - "name": "reaction", - "schema": "", - "columns": { - "react_to_key": { - "name": "react_to_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emoji_id": { - "name": "emoji_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "reaction_user_id_user_id_fk": { - "name": "reaction_user_id_user_id_fk", - "tableFrom": "reaction", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "reaction_react_to_key_emoji_id_user_id_pk": { - "name": "reaction_react_to_key_emoji_id_user_id_pk", - "columns": [ - "react_to_key", - "emoji_id", - "user_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "registration_changed_at": { - "name": "registration_changed_at", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'student'" - }, - "is_banned": { - "name": "is_banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned_from_strike": { - "name": "banned_from_strike", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.shopping_list_item": { - "name": "shopping_list_item", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "shopping_list_item_user_id_user_id_fk": { - "name": "shopping_list_item_user_id_user_id_fk", - "tableFrom": "shopping_list_item", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.users_to_shopping_list_items": { - "name": "users_to_shopping_list_items", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "item_id": { - "name": "item_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_shopping_list_items_user_id_user_id_fk": { - "name": "users_to_shopping_list_items_user_id_user_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_shopping_list_items_item_id_shopping_list_item_id_fk": { - "name": "users_to_shopping_list_items_item_id_shopping_list_item_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "item_id" - ], - "tableTo": "shopping_list_item", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "users_to_shopping_list_items_user_id_item_id_pk": { - "name": "users_to_shopping_list_items_user_id_item_id_pk", - "columns": [ - "user_id", - "item_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - }, - "public.strike": { - "name": "strike", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "strike_info_id": { - "name": "strike_info_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "is_deleted": { - "name": "is_deleted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "user_idx": { - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "user_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "strike_user_id_user_id_fk": { - "name": "strike_user_id_user_id_fk", - "tableFrom": "strike", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "strike_strike_info_id_strike_info_id_fk": { - "name": "strike_strike_info_id_strike_info_id_fk", - "tableFrom": "strike", - "columnsFrom": [ - "strike_info_id" - ], - "tableTo": "strike_info", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.strike_info": { - "name": "strike_info", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "issuer_id": { - "name": "issuer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "strike_info_happening_id_happening_id_fk": { - "name": "strike_info_happening_id_happening_id_fk", - "tableFrom": "strike_info", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "strike_info_issuer_id_user_id_fk": { - "name": "strike_info_issuer_id_user_id_fk", - "tableFrom": "strike_info", - "columnsFrom": [ - "issuer_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "d3e883eb-5b83-4a2d-900f-156e5b6ffd8f", - "prevId": "4663786b-5650-4324-948d-13639efb33e3" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0018_snapshot.json b/packages/db/drizzle/migrations/meta/0018_snapshot.json deleted file mode 100644 index 54fbcc9ad5..0000000000 --- a/packages/db/drizzle/migrations/meta/0018_snapshot.json +++ /dev/null @@ -1,1455 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "columnsFrom": [ - "question_id" - ], - "tableTo": "question", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.comment": { - "name": "comment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "post_id": { - "name": "post_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_comment_id": { - "name": "parent_comment_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "post_idx": { - "columns": [ - { - "expression": "post_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "post_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "comment_user_id_user_id_fk": { - "name": "comment_user_id_user_id_fk", - "tableFrom": "comment", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "slug_idx": { - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "slug_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "columns": [ - "slug" - ], - "nullsNotDistinct": false - } - } - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.reaction": { - "name": "reaction", - "schema": "", - "columns": { - "react_to_key": { - "name": "react_to_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emoji_id": { - "name": "emoji_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "reaction_user_id_user_id_fk": { - "name": "reaction_user_id_user_id_fk", - "tableFrom": "reaction", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "reaction_react_to_key_emoji_id_user_id_pk": { - "name": "reaction_react_to_key_emoji_id_user_id_pk", - "columns": [ - "react_to_key", - "emoji_id", - "user_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "prev_status": { - "name": "prev_status", - "type": "registration_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "changed_at": { - "name": "changed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "changed_by": { - "name": "changed_by", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "columnsFrom": [ - "group_id" - ], - "tableTo": "group", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'student'" - }, - "is_banned": { - "name": "is_banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned_from_strike": { - "name": "banned_from_strike", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "columnsFrom": [ - "degree_id" - ], - "tableTo": "degree", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.shopping_list_item": { - "name": "shopping_list_item", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "shopping_list_item_user_id_user_id_fk": { - "name": "shopping_list_item_user_id_user_id_fk", - "tableFrom": "shopping_list_item", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.users_to_shopping_list_items": { - "name": "users_to_shopping_list_items", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "item_id": { - "name": "item_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_shopping_list_items_user_id_user_id_fk": { - "name": "users_to_shopping_list_items_user_id_user_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "users_to_shopping_list_items_item_id_shopping_list_item_id_fk": { - "name": "users_to_shopping_list_items_item_id_shopping_list_item_id_fk", - "tableFrom": "users_to_shopping_list_items", - "columnsFrom": [ - "item_id" - ], - "tableTo": "shopping_list_item", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "users_to_shopping_list_items_user_id_item_id_pk": { - "name": "users_to_shopping_list_items_user_id_item_id_pk", - "columns": [ - "user_id", - "item_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - }, - "public.strike": { - "name": "strike", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "strike_info_id": { - "name": "strike_info_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "is_deleted": { - "name": "is_deleted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "user_idx": { - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "name": "user_idx", - "isUnique": false, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "strike_user_id_user_id_fk": { - "name": "strike_user_id_user_id_fk", - "tableFrom": "strike", - "columnsFrom": [ - "user_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "strike_strike_info_id_strike_info_id_fk": { - "name": "strike_strike_info_id_strike_info_id_fk", - "tableFrom": "strike", - "columnsFrom": [ - "strike_info_id" - ], - "tableTo": "strike_info", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.strike_info": { - "name": "strike_info", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "issuer_id": { - "name": "issuer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "strike_info_happening_id_happening_id_fk": { - "name": "strike_info_happening_id_happening_id_fk", - "tableFrom": "strike_info", - "columnsFrom": [ - "happening_id" - ], - "tableTo": "happening", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "strike_info_issuer_id_user_id_fk": { - "name": "strike_info_issuer_id_user_id_fk", - "tableFrom": "strike_info", - "columnsFrom": [ - "issuer_id" - ], - "tableTo": "user", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "schemas": {}, - "tables": {}, - "columns": {} - }, - "id": "286290f7-b422-4715-8127-badff7dfdc2c", - "prevId": "d3e883eb-5b83-4a2d-900f-156e5b6ffd8f" -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0019_snapshot.json b/packages/db/drizzle/migrations/meta/0019_snapshot.json deleted file mode 100644 index 7d1501485d..0000000000 --- a/packages/db/drizzle/migrations/meta/0019_snapshot.json +++ /dev/null @@ -1,1458 +0,0 @@ -{ - "id": "1bb141af-68d7-4fed-a0db-f33b519a801f", - "prevId": "286290f7-b422-4715-8127-badff7dfdc2c", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "tableTo": "question", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.comment": { - "name": "comment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "post_id": { - "name": "post_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_comment_id": { - "name": "parent_comment_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "post_idx": { - "name": "post_idx", - "columns": [ - { - "expression": "post_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "comment_user_id_user_id_fk": { - "name": "comment_user_id_user_id_fk", - "tableFrom": "comment", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "tableTo": "group", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "slug_idx": { - "name": "slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - } - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.reaction": { - "name": "reaction", - "schema": "", - "columns": { - "react_to_key": { - "name": "react_to_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emoji_id": { - "name": "emoji_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "reaction_user_id_user_id_fk": { - "name": "reaction_user_id_user_id_fk", - "tableFrom": "reaction", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "reaction_react_to_key_emoji_id_user_id_pk": { - "name": "reaction_react_to_key_emoji_id_user_id_pk", - "columns": [ - "react_to_key", - "emoji_id", - "user_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "prev_status": { - "name": "prev_status", - "type": "registration_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "changed_at": { - "name": "changed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "changed_by": { - "name": "changed_by", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "tableTo": "group", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'student'" - }, - "is_banned": { - "name": "is_banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned_from_strike": { - "name": "banned_from_strike", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "tableTo": "degree", - "columnsFrom": [ - "degree_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.shopping_list_item": { - "name": "shopping_list_item", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "shopping_list_item_user_id_user_id_fk": { - "name": "shopping_list_item_user_id_user_id_fk", - "tableFrom": "shopping_list_item", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.users_to_shopping_list_items": { - "name": "users_to_shopping_list_items", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "item_id": { - "name": "item_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_shopping_list_items_user_id_user_id_fk": { - "name": "users_to_shopping_list_items_user_id_user_id_fk", - "tableFrom": "users_to_shopping_list_items", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_shopping_list_items_item_id_shopping_list_item_id_fk": { - "name": "users_to_shopping_list_items_item_id_shopping_list_item_id_fk", - "tableFrom": "users_to_shopping_list_items", - "tableTo": "shopping_list_item", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_shopping_list_items_user_id_item_id_pk": { - "name": "users_to_shopping_list_items_user_id_item_id_pk", - "columns": [ - "user_id", - "item_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - }, - "public.strike": { - "name": "strike", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "strike_info_id": { - "name": "strike_info_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "is_deleted": { - "name": "is_deleted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "user_idx": { - "name": "user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "strike_user_id_user_id_fk": { - "name": "strike_user_id_user_id_fk", - "tableFrom": "strike", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "strike_strike_info_id_strike_info_id_fk": { - "name": "strike_strike_info_id_strike_info_id_fk", - "tableFrom": "strike", - "tableTo": "strike_info", - "columnsFrom": [ - "strike_info_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.strike_info": { - "name": "strike_info", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "issuer_id": { - "name": "issuer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "strike_info_happening_id_happening_id_fk": { - "name": "strike_info_happening_id_happening_id_fk", - "tableFrom": "strike_info", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "strike_info_issuer_id_user_id_fk": { - "name": "strike_info_issuer_id_user_id_fk", - "tableFrom": "strike_info", - "tableTo": "user", - "columnsFrom": [ - "issuer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0020_snapshot.json b/packages/db/drizzle/migrations/meta/0020_snapshot.json deleted file mode 100644 index d93c7117f8..0000000000 --- a/packages/db/drizzle/migrations/meta/0020_snapshot.json +++ /dev/null @@ -1,1530 +0,0 @@ -{ - "id": "e7de022e-5b42-4f01-8ba2-17c909da532c", - "prevId": "1bb141af-68d7-4fed-a0db-f33b519a801f", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.access_request": { - "name": "access_request", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "access_request_email_unique": { - "name": "access_request_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "tableTo": "question", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.cache": { - "name": "cache", - "schema": "", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "ttl": { - "name": "ttl", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now() + interval '1 day'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.comment": { - "name": "comment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "post_id": { - "name": "post_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_comment_id": { - "name": "parent_comment_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "post_idx": { - "name": "post_idx", - "columns": [ - { - "expression": "post_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "comment_user_id_user_id_fk": { - "name": "comment_user_id_user_id_fk", - "tableFrom": "comment", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "tableTo": "group", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "slug_idx": { - "name": "slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - } - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.reaction": { - "name": "reaction", - "schema": "", - "columns": { - "react_to_key": { - "name": "react_to_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emoji_id": { - "name": "emoji_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "reaction_user_id_user_id_fk": { - "name": "reaction_user_id_user_id_fk", - "tableFrom": "reaction", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "reaction_react_to_key_emoji_id_user_id_pk": { - "name": "reaction_react_to_key_emoji_id_user_id_pk", - "columns": [ - "react_to_key", - "emoji_id", - "user_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "prev_status": { - "name": "prev_status", - "type": "registration_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "changed_at": { - "name": "changed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "changed_by": { - "name": "changed_by", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "tableTo": "group", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'student'" - }, - "is_banned": { - "name": "is_banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned_from_strike": { - "name": "banned_from_strike", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "tableTo": "degree", - "columnsFrom": [ - "degree_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.shopping_list_item": { - "name": "shopping_list_item", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "shopping_list_item_user_id_user_id_fk": { - "name": "shopping_list_item_user_id_user_id_fk", - "tableFrom": "shopping_list_item", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.users_to_shopping_list_items": { - "name": "users_to_shopping_list_items", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "item_id": { - "name": "item_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_shopping_list_items_user_id_user_id_fk": { - "name": "users_to_shopping_list_items_user_id_user_id_fk", - "tableFrom": "users_to_shopping_list_items", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_shopping_list_items_item_id_shopping_list_item_id_fk": { - "name": "users_to_shopping_list_items_item_id_shopping_list_item_id_fk", - "tableFrom": "users_to_shopping_list_items", - "tableTo": "shopping_list_item", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_shopping_list_items_user_id_item_id_pk": { - "name": "users_to_shopping_list_items_user_id_item_id_pk", - "columns": [ - "user_id", - "item_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - }, - "public.strike": { - "name": "strike", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "strike_info_id": { - "name": "strike_info_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "is_deleted": { - "name": "is_deleted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "user_idx": { - "name": "user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "strike_user_id_user_id_fk": { - "name": "strike_user_id_user_id_fk", - "tableFrom": "strike", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "strike_strike_info_id_strike_info_id_fk": { - "name": "strike_strike_info_id_strike_info_id_fk", - "tableFrom": "strike", - "tableTo": "strike_info", - "columnsFrom": [ - "strike_info_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.strike_info": { - "name": "strike_info", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "issuer_id": { - "name": "issuer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "strike_info_happening_id_happening_id_fk": { - "name": "strike_info_happening_id_happening_id_fk", - "tableFrom": "strike_info", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "strike_info_issuer_id_user_id_fk": { - "name": "strike_info_issuer_id_user_id_fk", - "tableFrom": "strike_info", - "tableTo": "user", - "columnsFrom": [ - "issuer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0021_snapshot.json b/packages/db/drizzle/migrations/meta/0021_snapshot.json deleted file mode 100644 index 311cd3361f..0000000000 --- a/packages/db/drizzle/migrations/meta/0021_snapshot.json +++ /dev/null @@ -1,1530 +0,0 @@ -{ - "id": "6d6555e4-47df-46f1-8134-fb73c22d6832", - "prevId": "e7de022e-5b42-4f01-8ba2-17c909da532c", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.access_request": { - "name": "access_request", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "access_request_email_unique": { - "name": "access_request_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "tableTo": "question", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.comment": { - "name": "comment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "post_id": { - "name": "post_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_comment_id": { - "name": "parent_comment_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "post_idx": { - "name": "post_idx", - "columns": [ - { - "expression": "post_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "comment_user_id_user_id_fk": { - "name": "comment_user_id_user_id_fk", - "tableFrom": "comment", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "tableTo": "group", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "slug_idx": { - "name": "slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - } - }, - "public.kv": { - "name": "kv", - "schema": "", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "ttl": { - "name": "ttl", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now() + interval '1 day'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.reaction": { - "name": "reaction", - "schema": "", - "columns": { - "react_to_key": { - "name": "react_to_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emoji_id": { - "name": "emoji_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "reaction_user_id_user_id_fk": { - "name": "reaction_user_id_user_id_fk", - "tableFrom": "reaction", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "reaction_react_to_key_emoji_id_user_id_pk": { - "name": "reaction_react_to_key_emoji_id_user_id_pk", - "columns": [ - "react_to_key", - "emoji_id", - "user_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "prev_status": { - "name": "prev_status", - "type": "registration_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "changed_at": { - "name": "changed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "changed_by": { - "name": "changed_by", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "tableTo": "group", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'student'" - }, - "is_banned": { - "name": "is_banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned_from_strike": { - "name": "banned_from_strike", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "tableTo": "degree", - "columnsFrom": [ - "degree_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.shopping_list_item": { - "name": "shopping_list_item", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "shopping_list_item_user_id_user_id_fk": { - "name": "shopping_list_item_user_id_user_id_fk", - "tableFrom": "shopping_list_item", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.users_to_shopping_list_items": { - "name": "users_to_shopping_list_items", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "item_id": { - "name": "item_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_shopping_list_items_user_id_user_id_fk": { - "name": "users_to_shopping_list_items_user_id_user_id_fk", - "tableFrom": "users_to_shopping_list_items", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "users_to_shopping_list_items_item_id_shopping_list_item_id_fk": { - "name": "users_to_shopping_list_items_item_id_shopping_list_item_id_fk", - "tableFrom": "users_to_shopping_list_items", - "tableTo": "shopping_list_item", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_shopping_list_items_user_id_item_id_pk": { - "name": "users_to_shopping_list_items_user_id_item_id_pk", - "columns": [ - "user_id", - "item_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - }, - "public.strike": { - "name": "strike", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "strike_info_id": { - "name": "strike_info_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "is_deleted": { - "name": "is_deleted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "user_idx": { - "name": "user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "strike_user_id_user_id_fk": { - "name": "strike_user_id_user_id_fk", - "tableFrom": "strike", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "strike_strike_info_id_strike_info_id_fk": { - "name": "strike_strike_info_id_strike_info_id_fk", - "tableFrom": "strike", - "tableTo": "strike_info", - "columnsFrom": [ - "strike_info_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.strike_info": { - "name": "strike_info", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "issuer_id": { - "name": "issuer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "strike_info_happening_id_happening_id_fk": { - "name": "strike_info_happening_id_happening_id_fk", - "tableFrom": "strike_info", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "strike_info_issuer_id_user_id_fk": { - "name": "strike_info_issuer_id_user_id_fk", - "tableFrom": "strike_info", - "tableTo": "user", - "columnsFrom": [ - "issuer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/0022_snapshot.json b/packages/db/drizzle/migrations/meta/0022_snapshot.json deleted file mode 100644 index 84519df710..0000000000 --- a/packages/db/drizzle/migrations/meta/0022_snapshot.json +++ /dev/null @@ -1,1565 +0,0 @@ -{ - "id": "4c000b31-3660-4e47-a252-32844844e338", - "prevId": "6d6555e4-47df-46f1-8134-fb73c22d6832", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.access_request": { - "name": "access_request", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "access_request_email_unique": { - "name": "access_request_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - } - }, - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": [ - "provider", - "provider_account_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.answer": { - "name": "answer", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "question_id": { - "name": "question_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "answer": { - "name": "answer", - "type": "json", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "answer_user_id_user_id_fk": { - "name": "answer_user_id_user_id_fk", - "tableFrom": "answer", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "answer_happening_id_happening_id_fk": { - "name": "answer_happening_id_happening_id_fk", - "tableFrom": "answer", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "answer_question_id_question_id_fk": { - "name": "answer_question_id_question_id_fk", - "tableFrom": "answer", - "tableTo": "question", - "columnsFrom": [ - "question_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "answer_user_id_happening_id_question_id_pk": { - "name": "answer_user_id_happening_id_question_id_pk", - "columns": [ - "user_id", - "happening_id", - "question_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.comment": { - "name": "comment", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "post_id": { - "name": "post_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "parent_comment_id": { - "name": "parent_comment_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "post_idx": { - "name": "post_idx", - "columns": [ - { - "expression": "post_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "comment_user_id_user_id_fk": { - "name": "comment_user_id_user_id_fk", - "tableFrom": "comment", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "set null", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.degree": { - "name": "degree", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "degree_id_pk": { - "name": "degree_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "group_id_pk": { - "name": "group_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happenings_to_groups": { - "name": "happenings_to_groups", - "schema": "", - "columns": { - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "happenings_to_groups_happening_id_happening_id_fk": { - "name": "happenings_to_groups_happening_id_happening_id_fk", - "tableFrom": "happenings_to_groups", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "happenings_to_groups_group_id_group_id_fk": { - "name": "happenings_to_groups_group_id_group_id_fk", - "tableFrom": "happenings_to_groups", - "tableTo": "group", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "happenings_to_groups_happening_id_group_id_pk": { - "name": "happenings_to_groups_happening_id_group_id_pk", - "columns": [ - "happening_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.happening": { - "name": "happening", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "happening_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'event'" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_groups": { - "name": "registration_groups", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "registration_start_groups": { - "name": "registration_start_groups", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_start": { - "name": "registration_start", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "registration_end": { - "name": "registration_end", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "slug_idx": { - "name": "slug_idx", - "columns": [ - { - "expression": "slug", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": { - "happening_id_pk": { - "name": "happening_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": { - "happening_slug_unique": { - "name": "happening_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - } - }, - "public.kv": { - "name": "kv", - "schema": "", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "ttl": { - "name": "ttl", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "now() + interval '1 day'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.question": { - "name": "question", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "required": { - "name": "required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "type": { - "name": "type", - "type": "question_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "is_sensitive": { - "name": "is_sensitive", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "options": { - "name": "options", - "type": "json", - "primaryKey": false, - "notNull": false - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "question_happening_id_happening_id_fk": { - "name": "question_happening_id_happening_id_fk", - "tableFrom": "question", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "question_id_pk": { - "name": "question_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.reaction": { - "name": "reaction", - "schema": "", - "columns": { - "react_to_key": { - "name": "react_to_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "emoji_id": { - "name": "emoji_id", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "reaction_user_id_user_id_fk": { - "name": "reaction_user_id_user_id_fk", - "tableFrom": "reaction", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "reaction_react_to_key_emoji_id_user_id_pk": { - "name": "reaction_react_to_key_emoji_id_user_id_pk", - "columns": [ - "react_to_key", - "emoji_id", - "user_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.registration": { - "name": "registration", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "registration_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'waiting'" - }, - "unregister_reason": { - "name": "unregister_reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "prev_status": { - "name": "prev_status", - "type": "registration_status", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "changed_at": { - "name": "changed_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "changed_by": { - "name": "changed_by", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "registration_user_id_user_id_fk": { - "name": "registration_user_id_user_id_fk", - "tableFrom": "registration", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "registration_happening_id_happening_id_fk": { - "name": "registration_happening_id_happening_id_fk", - "tableFrom": "registration", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "registration_user_id_happening_id_pk": { - "name": "registration_user_id_happening_id_pk", - "columns": [ - "user_id", - "happening_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "session_session_token_pk": { - "name": "session_session_token_pk", - "columns": [ - "session_token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.site_feedback": { - "name": "site_feedback", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message": { - "name": "message", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "category": { - "name": "category", - "type": "feedback_category", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "is_read": { - "name": "is_read", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "site_feedback_id_pk": { - "name": "site_feedback_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.spot_range": { - "name": "spot_range", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "spots": { - "name": "spots", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "min_year": { - "name": "min_year", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "max_year": { - "name": "max_year", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "spot_range_happening_id_happening_id_fk": { - "name": "spot_range_happening_id_happening_id_fk", - "tableFrom": "spot_range", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "spot_range_id_pk": { - "name": "spot_range_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.users_to_groups": { - "name": "users_to_groups", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "is_leader": { - "name": "is_leader", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_groups_user_id_user_id_fk": { - "name": "users_to_groups_user_id_user_id_fk", - "tableFrom": "users_to_groups", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "users_to_groups_group_id_group_id_fk": { - "name": "users_to_groups_group_id_group_id_fk", - "tableFrom": "users_to_groups", - "tableTo": "group", - "columnsFrom": [ - "group_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_groups_user_id_group_id_pk": { - "name": "users_to_groups_user_id_group_id_pk", - "columns": [ - "user_id", - "group_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "alternative_email": { - "name": "alternative_email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "degree_id": { - "name": "degree_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "year": { - "name": "year", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "user_type", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'student'" - }, - "is_banned": { - "name": "is_banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned_from_strike": { - "name": "banned_from_strike", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "last_sign_in_at": { - "name": "last_sign_in_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "email_idx": { - "name": "email_idx", - "columns": [ - { - "expression": "email", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "user_degree_id_degree_id_fk": { - "name": "user_degree_id_degree_id_fk", - "tableFrom": "user", - "tableTo": "degree", - "columnsFrom": [ - "degree_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "user_id_pk": { - "name": "user_id_pk", - "columns": [ - "id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.verification_token": { - "name": "verification_token", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verification_token_identifier_token_pk": { - "name": "verification_token_identifier_token_pk", - "columns": [ - "identifier", - "token" - ] - } - }, - "uniqueConstraints": {} - }, - "public.shopping_list_item": { - "name": "shopping_list_item", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "shopping_list_item_user_id_user_id_fk": { - "name": "shopping_list_item_user_id_user_id_fk", - "tableFrom": "shopping_list_item", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.users_to_shopping_list_items": { - "name": "users_to_shopping_list_items", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "item_id": { - "name": "item_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "users_to_shopping_list_items_user_id_user_id_fk": { - "name": "users_to_shopping_list_items_user_id_user_id_fk", - "tableFrom": "users_to_shopping_list_items", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "users_to_shopping_list_items_item_id_shopping_list_item_id_fk": { - "name": "users_to_shopping_list_items_item_id_shopping_list_item_id_fk", - "tableFrom": "users_to_shopping_list_items", - "tableTo": "shopping_list_item", - "columnsFrom": [ - "item_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_shopping_list_items_user_id_item_id_pk": { - "name": "users_to_shopping_list_items_user_id_item_id_pk", - "columns": [ - "user_id", - "item_id" - ] - } - }, - "uniqueConstraints": {} - }, - "public.whitelist": { - "name": "whitelist", - "schema": "", - "columns": { - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "whitelist_email_pk": { - "name": "whitelist_email_pk", - "columns": [ - "email" - ] - } - }, - "uniqueConstraints": {} - }, - "public.strike": { - "name": "strike", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "strike_info_id": { - "name": "strike_info_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "is_deleted": { - "name": "is_deleted", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "user_idx": { - "name": "user_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "strike_user_id_user_id_fk": { - "name": "strike_user_id_user_id_fk", - "tableFrom": "strike", - "tableTo": "user", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "strike_strike_info_id_strike_info_id_fk": { - "name": "strike_strike_info_id_strike_info_id_fk", - "tableFrom": "strike", - "tableTo": "strike_info", - "columnsFrom": [ - "strike_info_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - }, - "public.strike_info": { - "name": "strike_info", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "happening_id": { - "name": "happening_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "issuer_id": { - "name": "issuer_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "strike_info_happening_id_happening_id_fk": { - "name": "strike_info_happening_id_happening_id_fk", - "tableFrom": "strike_info", - "tableTo": "happening", - "columnsFrom": [ - "happening_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "strike_info_issuer_id_user_id_fk": { - "name": "strike_info_issuer_id_user_id_fk", - "tableFrom": "strike_info", - "tableTo": "user", - "columnsFrom": [ - "issuer_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {} - } - }, - "enums": { - "public.degree_type": { - "name": "degree_type", - "schema": "public", - "values": [ - "bachelors", - "masters", - "integrated", - "year" - ] - }, - "public.feedback_category": { - "name": "feedback_category", - "schema": "public", - "values": [ - "bug", - "feature", - "login", - "other" - ] - }, - "public.happening_type": { - "name": "happening_type", - "schema": "public", - "values": [ - "bedpres", - "event", - "external" - ] - }, - "public.question_type": { - "name": "question_type", - "schema": "public", - "values": [ - "text", - "textarea", - "radio", - "checkbox" - ] - }, - "public.registration_status": { - "name": "registration_status", - "schema": "public", - "values": [ - "registered", - "unregistered", - "removed", - "waiting", - "pending" - ] - }, - "public.user_type": { - "name": "user_type", - "schema": "public", - "values": [ - "student", - "company", - "guest", - "alum" - ] - } - }, - "schemas": {}, - "sequences": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/drizzle/migrations/meta/_journal.json b/packages/db/drizzle/migrations/meta/_journal.json index 9c1f9609f9..84ee329728 100644 --- a/packages/db/drizzle/migrations/meta/_journal.json +++ b/packages/db/drizzle/migrations/meta/_journal.json @@ -1,166 +1,12 @@ { - "version": "5", - "dialect": "pg", + "version": "7", + "dialect": "sqlite", "entries": [ { "idx": 0, - "version": "5", - "when": 1701274511590, - "tag": "0000_parallel_onslaught", - "breakpoints": true - }, - { - "idx": 1, - "version": "5", - "when": 1701525206480, - "tag": "0001_lame_iron_lad", - "breakpoints": true - }, - { - "idx": 2, - "version": "5", - "when": 1702573307656, - "tag": "0002_normal_famine", - "breakpoints": true - }, - { - "idx": 3, - "version": "5", - "when": 1702644301355, - "tag": "0003_known_shaman", - "breakpoints": true - }, - { - "idx": 4, - "version": "5", - "when": 1704362797554, - "tag": "0004_soft_monster_badoon", - "breakpoints": true - }, - { - "idx": 5, - "version": "5", - "when": 1704473981524, - "tag": "0005_typical_ego", - "breakpoints": true - }, - { - "idx": 6, - "version": "5", - "when": 1704536625357, - "tag": "0006_messy_gravity", - "breakpoints": true - }, - { - "idx": 7, - "version": "5", - "when": 1704637616302, - "tag": "0007_wild_silver_fox", - "breakpoints": true - }, - { - "idx": 8, - "version": "5", - "when": 1704638584927, - "tag": "0008_known_trauma", - "breakpoints": true - }, - { - "idx": 9, - "version": "5", - "when": 1705442979217, - "tag": "0009_burly_wind_dancer", - "breakpoints": true - }, - { - "idx": 10, - "version": "5", - "when": 1706626165443, - "tag": "0010_lucky_karen_page", - "breakpoints": true - }, - { - "idx": 11, - "version": "5", - "when": 1706724154932, - "tag": "0011_luxuriant_carmella_unuscione", - "breakpoints": true - }, - { - "idx": 12, - "version": "5", - "when": 1708798994433, - "tag": "0012_wide_vance_astro", - "breakpoints": true - }, - { - "idx": 13, - "version": "5", - "when": 1709200139702, - "tag": "0013_tough_smiling_tiger", - "breakpoints": true - }, - { - "idx": 14, - "version": "5", - "when": 1712238204095, - "tag": "0014_low_rafael_vega", - "breakpoints": true - }, - { - "idx": 15, - "version": "6", - "when": 1715893992753, - "tag": "0015_chilly_william_stryker", - "breakpoints": true - }, - { - "idx": 16, - "version": "6", - "when": 1716058797709, - "tag": "0016_thin_wolfpack", - "breakpoints": true - }, - { - "idx": 17, - "version": "6", - "when": 1716150164053, - "tag": "0017_light_elektra", - "breakpoints": true - }, - { - "idx": 18, "version": "6", - "when": 1716709837519, - "tag": "0018_wakeful_blue_marvel", - "breakpoints": true - }, - { - "idx": 19, - "version": "7", - "when": 1717709479243, - "tag": "0019_young_valeria_richards", - "breakpoints": true - }, - { - "idx": 20, - "version": "7", - "when": 1719939189981, - "tag": "0020_fixed_fabian_cortez", - "breakpoints": true - }, - { - "idx": 21, - "version": "7", - "when": 1720452987900, - "tag": "0021_daily_moon_knight", - "breakpoints": true - }, - { - "idx": 22, - "version": "7", - "when": 1721925392240, - "tag": "0022_powerful_outlaw_kid", + "when": 1722018021122, + "tag": "0000_curved_jazinda", "breakpoints": true }, { diff --git a/packages/db/package.json b/packages/db/package.json index 1ffa6a0322..f075fdd5f7 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -4,36 +4,32 @@ "exports": { ".": "./src/index.ts", "./schemas": "./src/schemas/index.ts", - "./utils": "./src/utils.ts" + "./utils": "./src/utils.ts", + "./error": "./src/error.ts" }, "scripts": { "clean": "rm -rf .turbo node_modules", "lint": "eslint .", "lint:fix": "eslint lint --fix", "db:generate": "pnpm with-env drizzle-kit generate", - "db:migrate": "pnpm with-env tsx ./drizzle/migrate.ts", + "db:migrate": "pnpm with-env drizzle-kit migrate", "db:check": "pnpm with-env drizzle-kit check && tsx ./drizzle/check.ts", - "db:up": "docker compose up -d", - "db:down": "docker compose down", - "db:down-volumes": "docker compose down --volumes", "kit:up": "drizzle-kit up", "dev": "pnpm with-env drizzle-kit studio", "typecheck": "tsc --noEmit", "with-env": "dotenv -e ../../.env --" }, "dependencies": { + "@libsql/client": "0.9.0", "drizzle-orm": "0.33.0", "drizzle-zod": "0.5.1", "nanoid": "5.0.7", "next-auth": "4.24.7", - "pg": "8.12.0", - "postgres": "3.4.4", "zod": "3.23.8" }, "devDependencies": { "@echo-webkom/tsconfig": "workspace:*", "@types/node": "20.16.0", - "@types/pg": "8.11.6", "dotenv-cli": "7.4.2", "drizzle-kit": "0.24.0", "eslint-config-webkom": "workspace:*", diff --git a/packages/db/src/error.ts b/packages/db/src/error.ts new file mode 100644 index 0000000000..48558d20bb --- /dev/null +++ b/packages/db/src/error.ts @@ -0,0 +1,7 @@ +import { LibsqlError } from "@libsql/client"; + +export const isDatabaseError = (error: unknown): error is LibsqlError => { + return error instanceof LibsqlError; +}; + +export const SQLITE_CONSTRAINT_UNIQUE = "2067"; diff --git a/packages/db/src/index.ts b/packages/db/src/index.ts index 7ce17602d4..adb8a9e289 100644 --- a/packages/db/src/index.ts +++ b/packages/db/src/index.ts @@ -1,55 +1,14 @@ -import { drizzle } from "drizzle-orm/postgres-js"; -import postgres from "postgres"; +import { createClient } from "@libsql/client/web"; +import { drizzle } from "drizzle-orm/libsql"; import * as schema from "./schemas"; -export type Database = ReturnType; +const client = createClient({ + url: process.env.DATABASE_URL!, + authToken: process.env.DATABASE_AUTH_TOKEN, +}); -const globalForPool = globalThis as unknown as { - pool: ReturnType | undefined; -}; - -let pool; - -const createPool = () => { - return postgres(process.env.DATABASE_URL!, { - max: 90, - prepare: false, - }); -}; - -if (process.env.NODE_ENV !== "production") { - if (!globalForPool.pool) { - globalForPool.pool = createPool(); - } - pool = globalForPool.pool; -} else { - pool = createPool(); -} - -const createDatabase = (pool: ReturnType) => { - return drizzle(pool, { - schema, - logger: process.env.DATABASE_LOG === "true", - }); -}; - -export const db = createDatabase(pool); - -/** - * PostgresError is hærk to work with. Just check if it has a code property. - * We can deduct enough information from that. - * - * @see https://www.postgresql.org/docs/current/errcodes-appendix.html - */ -type PostgresIshError = { - code: string; -}; - -export const isPostgresIshError = (e: unknown): e is PostgresIshError => { - if (typeof e !== "object" || e === null) { - return false; - } - - return "code" in e && e instanceof Error; -}; +export const db = drizzle(client, { + schema, + logger: process.env.NODE_ENV !== "production", +}); diff --git a/packages/db/src/schemas/access-request.ts b/packages/db/src/schemas/access-request.ts index 0f2065db4b..6eb3157045 100644 --- a/packages/db/src/schemas/access-request.ts +++ b/packages/db/src/schemas/access-request.ts @@ -1,11 +1,13 @@ import { type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { pgTable, text, timestamp } from "drizzle-orm/pg-core"; +import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core"; -export const accessRequests = pgTable("access_request", { - id: text("id").primaryKey(), +import { now } from "../utils"; + +export const accessRequests = sqliteTable("access_request", { + id: text("id").notNull().primaryKey(), email: text("email").unique().notNull(), reason: text("reason").notNull(), - createdAt: timestamp("created_at").notNull().defaultNow(), + createdAt: integer("created_at", { mode: "timestamp" }).notNull().$defaultFn(now), }); export type AccessRequest = InferSelectModel; diff --git a/packages/db/src/schemas/accounts.ts b/packages/db/src/schemas/accounts.ts index 5c3b7bf7d2..ade1f04da1 100644 --- a/packages/db/src/schemas/accounts.ts +++ b/packages/db/src/schemas/accounts.ts @@ -1,11 +1,11 @@ import { type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { integer, pgTable, primaryKey, text } from "drizzle-orm/pg-core"; +import { integer, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import type { AdapterAccount } from "next-auth/adapters"; import { users } from "."; -export const accounts = pgTable( +export const accounts = sqliteTable( "account", { userId: text("user_id") diff --git a/packages/db/src/schemas/answers.ts b/packages/db/src/schemas/answers.ts index 8f3ddd50ab..1f65e72070 100644 --- a/packages/db/src/schemas/answers.ts +++ b/packages/db/src/schemas/answers.ts @@ -1,5 +1,5 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { json, pgTable, primaryKey, text, varchar } from "drizzle-orm/pg-core"; +import { blob, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { happenings, questions, registrations, users } from "."; @@ -8,7 +8,7 @@ type AnswerCol = { answer: string | Array; }; -export const answers = pgTable( +export const answers = sqliteTable( "answer", { userId: text("user_id") @@ -16,17 +16,17 @@ export const answers = pgTable( .references(() => users.id, { onDelete: "cascade", }), - happeningId: varchar("happening_id", { length: 255 }) + happeningId: text("happening_id") .notNull() .references(() => happenings.id, { onDelete: "cascade", }), - questionId: varchar("question_id", { length: 255 }) + questionId: text("question_id") .notNull() .references(() => questions.id, { onDelete: "cascade", }), - answer: json("answer").$type(), + answer: blob("answer", { mode: "json" }).$type(), }, (table) => ({ pk: primaryKey({ columns: [table.userId, table.happeningId, table.questionId] }), diff --git a/packages/db/src/schemas/comments.ts b/packages/db/src/schemas/comments.ts index 88481c1af0..2f3ec0bcc6 100644 --- a/packages/db/src/schemas/comments.ts +++ b/packages/db/src/schemas/comments.ts @@ -1,10 +1,11 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { index, pgTable, text, timestamp } from "drizzle-orm/pg-core"; +import { index, integer, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { nanoid } from "nanoid"; import { users } from "."; +import { now } from "../utils"; -export const comments = pgTable( +export const comments = sqliteTable( "comment", { id: text("id").notNull().primaryKey().$defaultFn(nanoid), @@ -14,10 +15,8 @@ export const comments = pgTable( onDelete: "set null", }), content: text("content").notNull(), - createdAt: timestamp("created_at").notNull().defaultNow(), - updatedAt: timestamp("updated_at") - .notNull() - .$onUpdateFn(() => new Date()), + createdAt: integer("created_at", { mode: "timestamp" }).notNull().$defaultFn(now), + updatedAt: integer("updated_at", { mode: "timestamp" }).notNull().$onUpdateFn(now), }, (t) => ({ postIdx: index("post_idx").on(t.postId), diff --git a/packages/db/src/schemas/degrees.ts b/packages/db/src/schemas/degrees.ts index 0068163fb8..b93e63a3cc 100644 --- a/packages/db/src/schemas/degrees.ts +++ b/packages/db/src/schemas/degrees.ts @@ -1,17 +1,17 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { pgTable, primaryKey, varchar } from "drizzle-orm/pg-core"; +import { primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { nanoid } from "nanoid"; import { users } from "."; -export const degrees = pgTable( +export const degrees = sqliteTable( "degree", { - id: varchar("id", { length: 255 }) + id: text("id") .notNull() .$defaultFn(() => nanoid()), - name: varchar("name", { length: 255 }).notNull(), + name: text("name").notNull(), }, (table) => ({ pk: primaryKey({ columns: [table.id] }), diff --git a/packages/db/src/schemas/enums.ts b/packages/db/src/schemas/enums.ts index 800d79ad1e..1424e58a5e 100644 --- a/packages/db/src/schemas/enums.ts +++ b/packages/db/src/schemas/enums.ts @@ -1,30 +1,23 @@ -import { pgEnum } from "drizzle-orm/pg-core"; +export const degreeTypeEnum = ["bachelors", "masters", "integrated", "year"] as const; +export type DegreeType = (typeof degreeTypeEnum)[number]; -export type DegreeType = (typeof degreeTypeEnum)["enumValues"][number]; -export const degreeTypeEnum = pgEnum("degree_type", ["bachelors", "masters", "integrated", "year"]); +export const happeningTypeEnum = ["bedpres", "event", "external"] as const; +export type HappeningType = (typeof happeningTypeEnum)[number]; -export type HappeningType = (typeof happeningTypeEnum)["enumValues"][number]; -export const happeningTypeEnum = pgEnum("happening_type", ["bedpres", "event", "external"]); - -export type RegistrationStatus = (typeof registrationStatusEnum)["enumValues"][number]; -export const registrationStatusEnum = pgEnum("registration_status", [ +export const registrationStatusEnum = [ "registered", "unregistered", "removed", "waiting", "pending", -]); +] as const; +export type RegistrationStatus = (typeof registrationStatusEnum)[number]; -export type QuestionType = (typeof questionTypeEnum)["enumValues"][number]; -export const questionTypeEnum = pgEnum("question_type", ["text", "textarea", "radio", "checkbox"]); +export const questionTypeEnum = ["text", "textarea", "radio", "checkbox"] as const; +export type QuestionType = (typeof questionTypeEnum)[number]; -export type UserType = (typeof userTypeEnum)["enumValues"][number]; -export const userTypeEnum = pgEnum("user_type", ["student", "company", "guest", "alum"]); +export const userTypeEnum = ["student", "company", "guest", "alum"] as const; +export type UserType = (typeof userTypeEnum)[number]; -export type FeedbackCategory = (typeof feedbackCategoryEnum)["enumValues"][number]; -export const feedbackCategoryEnum = pgEnum("feedback_category", [ - "bug", - "feature", - "login", - "other", -]); +export const feedbackCategoryEnum = ["bug", "feature", "login", "other"] as const; +export type FeedbackCategory = (typeof feedbackCategoryEnum)[number]; diff --git a/packages/db/src/schemas/groups.ts b/packages/db/src/schemas/groups.ts index 630a8c5613..46b49c65c5 100644 --- a/packages/db/src/schemas/groups.ts +++ b/packages/db/src/schemas/groups.ts @@ -1,18 +1,17 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { pgTable, primaryKey, varchar } from "drizzle-orm/pg-core"; +import { primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { nanoid } from "nanoid"; -import { happeningsToGroups } from "."; -import { usersToGroups } from "./users-to-groups"; +import { happeningsToGroups, usersToGroups } from "."; -export const groups = pgTable( +export const groups = sqliteTable( "group", { - id: varchar("id", { length: 255 }) + id: text("id", { length: 255 }) .notNull() .$defaultFn(() => nanoid()), - name: varchar("name", { length: 255 }).notNull(), + name: text("name", { length: 255 }).notNull(), }, (table) => ({ pk: primaryKey({ columns: [table.id] }), diff --git a/packages/db/src/schemas/happenings-to-groups.ts b/packages/db/src/schemas/happenings-to-groups.ts index 4df37a667e..45838383e5 100644 --- a/packages/db/src/schemas/happenings-to-groups.ts +++ b/packages/db/src/schemas/happenings-to-groups.ts @@ -1,18 +1,18 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { pgTable, primaryKey, varchar } from "drizzle-orm/pg-core"; +import { primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { groups, happenings } from "."; -export const happeningsToGroups = pgTable( +export const happeningsToGroups = sqliteTable( "happenings_to_groups", { - happeningId: varchar("happening_id", { length: 255 }) + happeningId: text("happening_id") .notNull() .references(() => happenings.id, { onDelete: "cascade", }), - groupId: varchar("group_id", { length: 255 }) + groupId: text("group_id") .notNull() .references(() => groups.id, { onDelete: "cascade", diff --git a/packages/db/src/schemas/happenings.ts b/packages/db/src/schemas/happenings.ts index 8bc1c92747..769c72e1f2 100644 --- a/packages/db/src/schemas/happenings.ts +++ b/packages/db/src/schemas/happenings.ts @@ -1,21 +1,21 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { index, json, pgTable, primaryKey, timestamp, varchar } from "drizzle-orm/pg-core"; +import { blob, index, integer, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { happeningsToGroups, happeningTypeEnum, questions, registrations, spotRanges } from "."; -export const happenings = pgTable( +export const happenings = sqliteTable( "happening", { - id: varchar("id", { length: 255 }).notNull(), - slug: varchar("slug", { length: 255 }).notNull().unique(), - title: varchar("title", { length: 255 }).notNull(), - type: happeningTypeEnum("type").notNull().default("event"), - date: timestamp("date"), - registrationGroups: json("registration_groups").$type>(), - registrationStartGroups: timestamp("registration_start_groups"), - registrationStart: timestamp("registration_start"), - registrationEnd: timestamp("registration_end"), + id: text("id").notNull(), + slug: text("slug").notNull().unique(), + title: text("title").notNull(), + type: text("type", { enum: happeningTypeEnum }).notNull().default("event"), + date: integer("date", { mode: "timestamp" }), + registrationGroups: blob("registration_groups", { mode: "json" }).$type>(), + registrationStartGroups: integer("registration_start_groups", { mode: "timestamp" }), + registrationStart: integer("registration_start", { mode: "timestamp" }), + registrationEnd: integer("registration_end", { mode: "timestamp" }), }, (table) => ({ pk: primaryKey({ columns: [table.id] }), diff --git a/packages/db/src/schemas/kv.ts b/packages/db/src/schemas/kv.ts index 1d8899841f..7292340eb7 100644 --- a/packages/db/src/schemas/kv.ts +++ b/packages/db/src/schemas/kv.ts @@ -1,10 +1,13 @@ -import { sql, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { json, pgTable, text, timestamp } from "drizzle-orm/pg-core"; +import { type InferInsertModel, type InferSelectModel } from "drizzle-orm"; +import { blob, integer, sqliteTable, text } from "drizzle-orm/sqlite-core"; -export const kv = pgTable("kv", { +export const kv = sqliteTable("kv", { key: text("key").notNull().primaryKey(), - value: json("value"), - ttl: timestamp("ttl").default(sql`now() + interval '1 day'`), + value: blob("value", { mode: "json" }), + // ttl: timestamp("ttl").default(sql`now() + interval '1 day'`), + ttl: integer("ttl", { mode: "timestamp" }).$defaultFn( + () => new Date(new Date().getTime() + 60 * 60 * 24 * 1000), + ), }); export type KV = InferSelectModel; diff --git a/packages/db/src/schemas/questions.ts b/packages/db/src/schemas/questions.ts index 65c9977d67..d660365bff 100644 --- a/packages/db/src/schemas/questions.ts +++ b/packages/db/src/schemas/questions.ts @@ -1,5 +1,5 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { boolean, json, pgTable, primaryKey, text, varchar } from "drizzle-orm/pg-core"; +import { blob, integer, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { answers, happenings, questionTypeEnum } from "."; @@ -9,16 +9,16 @@ type Option = { value: string; }; -export const questions = pgTable( +export const questions = sqliteTable( "question", { - id: varchar("id", { length: 255 }).notNull(), + id: text("id").notNull(), title: text("title").notNull(), - required: boolean("required").notNull().default(false), - type: questionTypeEnum("type").notNull().default("text"), - isSensitive: boolean("is_sensitive").notNull().default(false), - options: json("options").$type>(), - happeningId: varchar("happening_id", { length: 255 }) + required: integer("required", { mode: "boolean" }).notNull().default(false), + type: text("type", { enum: questionTypeEnum }).notNull().default("text"), + isSensitive: integer("is_sensitive", { mode: "boolean" }).notNull().default(false), + options: blob("options", { mode: "json" }).$type>(), + happeningId: text("happening_id") .notNull() .references(() => happenings.id, { onDelete: "cascade", diff --git a/packages/db/src/schemas/reactions.ts b/packages/db/src/schemas/reactions.ts index 8f658f90c5..d637707aab 100644 --- a/packages/db/src/schemas/reactions.ts +++ b/packages/db/src/schemas/reactions.ts @@ -1,9 +1,10 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { integer, pgTable, primaryKey, text, timestamp } from "drizzle-orm/pg-core"; +import { integer, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; +import { now } from "../utils"; import { users } from "./users"; -export const reactions = pgTable( +export const reactions = sqliteTable( "reaction", { reactToKey: text("react_to_key").notNull(), @@ -11,7 +12,7 @@ export const reactions = pgTable( userId: text("user_id") .notNull() .references(() => users.id, { onDelete: "no action" }), - createdAt: timestamp("created_at").notNull().defaultNow(), + createdAt: integer("created_at", { mode: "timestamp" }).notNull().$defaultFn(now), }, (table) => ({ pk: primaryKey({ columns: [table.reactToKey, table.emojiId, table.userId] }), diff --git a/packages/db/src/schemas/registrations.ts b/packages/db/src/schemas/registrations.ts index 661144d9f4..79e1de262b 100644 --- a/packages/db/src/schemas/registrations.ts +++ b/packages/db/src/schemas/registrations.ts @@ -1,10 +1,11 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { pgTable, primaryKey, text, timestamp } from "drizzle-orm/pg-core"; +import { integer, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { answers, happenings, registrationStatusEnum, users } from "."; +import { now } from "../utils"; -export const registrations = pgTable( +export const registrations = sqliteTable( "registration", { userId: text("user_id") @@ -15,11 +16,11 @@ export const registrations = pgTable( .references(() => happenings.id, { onDelete: "cascade", }), - status: registrationStatusEnum("status").notNull().default("waiting"), + status: text("status", { enum: registrationStatusEnum }).notNull().default("waiting"), unregisterReason: text("unregister_reason"), - createdAt: timestamp("created_at").notNull().defaultNow(), - prevStatus: registrationStatusEnum("prev_status"), - changedAt: timestamp("changed_at").$onUpdate(() => new Date()), + createdAt: integer("created_at", { mode: "timestamp" }).notNull().$defaultFn(now), + prevStatus: text("prev_status", { enum: registrationStatusEnum }), + changedAt: integer("changed_at", { mode: "timestamp" }).$onUpdate(now), changedBy: text("changed_by"), }, (table) => ({ diff --git a/packages/db/src/schemas/sessions.ts b/packages/db/src/schemas/sessions.ts index 83a04213c0..5ba493b078 100644 --- a/packages/db/src/schemas/sessions.ts +++ b/packages/db/src/schemas/sessions.ts @@ -1,17 +1,17 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { pgTable, primaryKey, text, timestamp } from "drizzle-orm/pg-core"; +import { integer, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { users } from "."; -export const sessions = pgTable( +export const sessions = sqliteTable( "session", { sessionToken: text("session_token").notNull(), userId: text("user_id") .notNull() .references(() => users.id, { onDelete: "cascade" }), - expires: timestamp("expires", { mode: "date" }).notNull(), + expires: integer("expires", { mode: "timestamp" }).notNull(), }, (table) => ({ pk: primaryKey({ columns: [table.sessionToken] }), diff --git a/packages/db/src/schemas/shopping-list-items.ts b/packages/db/src/schemas/shopping-list-items.ts index 934c72cf5e..da92407760 100644 --- a/packages/db/src/schemas/shopping-list-items.ts +++ b/packages/db/src/schemas/shopping-list-items.ts @@ -1,19 +1,22 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core"; +import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; +import { nanoid } from "nanoid"; import { users } from "."; import { usersToShoppingListItems } from "./users-to-shopping-list-items"; -export const shoppingListItems = pgTable("shopping_list_item", { - id: uuid("id").defaultRandom().primaryKey(), +export const shoppingListItems = sqliteTable("shopping_list_item", { + id: text("id").primaryKey().$defaultFn(nanoid), userId: text("user_id") .notNull() .references(() => users.id, { onDelete: "cascade", }), name: text("name").notNull(), - createdAt: timestamp("created_at").notNull().defaultNow(), + createdAt: integer("created_at", { mode: "timestamp" }) + .notNull() + .$defaultFn(() => new Date()), }); export const shoppingListItemsRelations = relations(shoppingListItems, ({ one, many }) => ({ diff --git a/packages/db/src/schemas/site-feedback.ts b/packages/db/src/schemas/site-feedback.ts index ca2dac0e01..c4dc7db4ba 100644 --- a/packages/db/src/schemas/site-feedback.ts +++ b/packages/db/src/schemas/site-feedback.ts @@ -1,22 +1,22 @@ import { type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { boolean, pgTable, primaryKey, text, timestamp, varchar } from "drizzle-orm/pg-core"; +import { integer, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { nanoid } from "nanoid"; import { feedbackCategoryEnum } from "./enums"; -export const siteFeedback = pgTable( +export const siteFeedback = sqliteTable( "site_feedback", { - id: varchar("id") - .notNull() - .$defaultFn(() => nanoid()), - name: varchar("name", { length: 255 }), - email: varchar("email", { length: 255 }), + id: text("id").notNull().$defaultFn(nanoid), + name: text("name"), + email: text("email"), message: text("message").notNull(), - category: feedbackCategoryEnum("category").notNull(), - isRead: boolean("is_read").notNull().default(false), - createdAt: timestamp("created_at").notNull().defaultNow(), + category: text("category", { enum: feedbackCategoryEnum }).notNull(), + isRead: integer("is_read", { mode: "boolean" }).notNull().default(false), + createdAt: integer("created_at", { mode: "timestamp" }) + .notNull() + .$defaultFn(() => new Date()), }, (table) => ({ pk: primaryKey({ columns: [table.id] }), diff --git a/packages/db/src/schemas/spot-ranges.ts b/packages/db/src/schemas/spot-ranges.ts index 8a7993320d..78eb6712f6 100644 --- a/packages/db/src/schemas/spot-ranges.ts +++ b/packages/db/src/schemas/spot-ranges.ts @@ -1,17 +1,15 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { integer, pgTable, primaryKey, varchar } from "drizzle-orm/pg-core"; +import { integer, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { nanoid } from "nanoid"; import { happenings } from "."; -export const spotRanges = pgTable( +export const spotRanges = sqliteTable( "spot_range", { - id: varchar("id", { length: 255 }) - .notNull() - .$defaultFn(() => nanoid()), - happeningId: varchar("happening_id", { length: 255 }) + id: text("id").notNull().$defaultFn(nanoid), + happeningId: text("happening_id") .notNull() .references(() => happenings.id, { onDelete: "cascade", diff --git a/packages/db/src/schemas/strike-infos.ts b/packages/db/src/schemas/strike-infos.ts index f4a03e9250..5d401f8c9c 100644 --- a/packages/db/src/schemas/strike-infos.ts +++ b/packages/db/src/schemas/strike-infos.ts @@ -1,19 +1,21 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { pgTable, text, timestamp, uuid, varchar } from "drizzle-orm/pg-core"; +import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; +import { nanoid } from "nanoid"; import { happenings, users } from "."; +import { now } from "../utils"; -export const strikeInfos = pgTable("strike_info", { - id: uuid("id").defaultRandom().primaryKey(), - happeningId: varchar("happening_id", { length: 255 }) +export const strikeInfos = sqliteTable("strike_info", { + id: text("id").notNull().primaryKey().$defaultFn(nanoid), + happeningId: text("happening_id") .notNull() .references(() => happenings.id), issuerId: text("issuer_id") .notNull() .references(() => users.id), reason: text("reason").notNull(), - createdAt: timestamp("created_at").notNull().defaultNow(), + createdAt: integer("created_at", { mode: "timestamp" }).notNull().$defaultFn(now), }); export const strikeInfoRelations = relations(strikeInfos, ({ one }) => ({ diff --git a/packages/db/src/schemas/strikes.ts b/packages/db/src/schemas/strikes.ts index c6bc2317d7..0ff8deed2a 100644 --- a/packages/db/src/schemas/strikes.ts +++ b/packages/db/src/schemas/strikes.ts @@ -1,22 +1,22 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { boolean, index, pgTable, serial, text, uuid } from "drizzle-orm/pg-core"; +import { index, integer, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { strikeInfos, users } from "."; -export const strikes = pgTable( +export const strikes = sqliteTable( "strike", { - id: serial("id").notNull().primaryKey(), + id: integer("id").notNull().primaryKey(), userId: text("user_id") .notNull() .references(() => users.id, { onDelete: "cascade", }), - strikeInfoId: uuid("strike_info_id") + strikeInfoId: text("strike_info_id") .notNull() .references(() => strikeInfos.id, { onDelete: "cascade" }), - isDeleted: boolean("is_deleted").notNull().default(false), + isDeleted: integer("is_deleted", { mode: "boolean" }).notNull().default(false), }, (table) => ({ userIdx: index("user_idx").on(table.userId, table.id), diff --git a/packages/db/src/schemas/users-to-groups.ts b/packages/db/src/schemas/users-to-groups.ts index fc8693232f..73d993a8c6 100644 --- a/packages/db/src/schemas/users-to-groups.ts +++ b/packages/db/src/schemas/users-to-groups.ts @@ -1,10 +1,10 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { boolean, pgTable, primaryKey, text, varchar } from "drizzle-orm/pg-core"; +import { integer, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { groups, users } from "."; -export const usersToGroups = pgTable( +export const usersToGroups = sqliteTable( "users_to_groups", { userId: text("user_id") @@ -12,12 +12,12 @@ export const usersToGroups = pgTable( .references(() => users.id, { onDelete: "cascade", }), - groupId: varchar("group_id", { length: 255 }) + groupId: text("group_id") .notNull() .references(() => groups.id, { onDelete: "cascade", }), - isLeader: boolean("is_leader").notNull().default(false), + isLeader: integer("is_leader", { mode: "boolean" }).notNull().default(false), }, (table) => ({ pk: primaryKey({ columns: [table.userId, table.groupId] }), diff --git a/packages/db/src/schemas/users-to-shopping-list-items.ts b/packages/db/src/schemas/users-to-shopping-list-items.ts index ce3a911266..660d9923ee 100644 --- a/packages/db/src/schemas/users-to-shopping-list-items.ts +++ b/packages/db/src/schemas/users-to-shopping-list-items.ts @@ -1,10 +1,10 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { pgTable, primaryKey, text, timestamp, uuid } from "drizzle-orm/pg-core"; +import { integer, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { shoppingListItems, users } from "."; -export const usersToShoppingListItems = pgTable( +export const usersToShoppingListItems = sqliteTable( "users_to_shopping_list_items", { userId: text("user_id") @@ -12,10 +12,12 @@ export const usersToShoppingListItems = pgTable( .references(() => users.id, { onDelete: "cascade", }), - itemId: uuid("item_id") + itemId: text("item_id") .notNull() .references(() => shoppingListItems.id, { onDelete: "cascade" }), - createdAt: timestamp("created_at").notNull().defaultNow(), + createdAt: integer("created_at", { mode: "timestamp" }) + .notNull() + .$defaultFn(() => new Date()), }, (table) => ({ pk: primaryKey({ columns: [table.userId, table.itemId] }), diff --git a/packages/db/src/schemas/users.ts b/packages/db/src/schemas/users.ts index 0340375d33..ae1bc44f8a 100644 --- a/packages/db/src/schemas/users.ts +++ b/packages/db/src/schemas/users.ts @@ -1,14 +1,5 @@ import { relations, type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { - boolean, - index, - integer, - pgTable, - primaryKey, - text, - timestamp, - varchar, -} from "drizzle-orm/pg-core"; +import { index, integer, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { @@ -21,24 +12,24 @@ import { } from "."; import { now } from "../utils"; -export const users = pgTable( +export const users = sqliteTable( "user", { id: text("id").notNull(), name: text("name"), email: text("email").notNull(), - emailVerified: timestamp("email_verified", { mode: "date" }), + emailVerified: integer("email_verified", { mode: "timestamp" }), image: text("image"), - alternativeEmail: varchar("alternative_email", { length: 255 }), - degreeId: varchar("degree_id", { length: 255 }).references(() => degrees.id), + alternativeEmail: text("alternative_email"), + degreeId: text("degree_id").references(() => degrees.id), year: integer("year"), - type: userTypeEnum("type").notNull().default("student"), - isBanned: boolean("is_banned").notNull().default(false), + type: text("type", { enum: userTypeEnum }).notNull().default("student"), + isBanned: integer("is_banned", { mode: "boolean" }).notNull().default(false), bannedFromStrike: integer("banned_from_strike"), - lastSignInAt: timestamp("last_sign_in_at"), - updatedAt: timestamp("updated_at").$onUpdate(now), - createdAt: timestamp("created_at").$defaultFn(now), - hasReadTerms: boolean("has_read_terms").notNull().default(false), + lastSignInAt: integer("last_sign_in_at", { mode: "timestamp" }), + updatedAt: integer("updated_at", { mode: "timestamp" }).$onUpdate(now), + createdAt: integer("created_at", { mode: "timestamp" }).$defaultFn(now), + hasReadTerms: integer("has_read_terms", { mode: "boolean" }).notNull().default(false), }, (table) => ({ pk: primaryKey({ columns: [table.id] }), diff --git a/packages/db/src/schemas/verification-tokens.ts b/packages/db/src/schemas/verification-tokens.ts index a0a74d2872..6480376e9d 100644 --- a/packages/db/src/schemas/verification-tokens.ts +++ b/packages/db/src/schemas/verification-tokens.ts @@ -1,13 +1,13 @@ import { type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { pgTable, primaryKey, text, timestamp } from "drizzle-orm/pg-core"; +import { integer, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; -export const verificationTokens = pgTable( +export const verificationTokens = sqliteTable( "verification_token", { identifier: text("identifier").notNull(), token: text("token").notNull(), - expires: timestamp("expires", { mode: "date" }).notNull(), + expires: integer("expires", { mode: "timestamp" }).notNull(), }, (vt) => ({ compoundKey: primaryKey({ columns: [vt.identifier, vt.token] }), diff --git a/packages/db/src/schemas/whitelist.ts b/packages/db/src/schemas/whitelist.ts index bb0e9b6688..f0931e5302 100644 --- a/packages/db/src/schemas/whitelist.ts +++ b/packages/db/src/schemas/whitelist.ts @@ -1,12 +1,12 @@ import { type InferInsertModel, type InferSelectModel } from "drizzle-orm"; -import { pgTable, primaryKey, text, timestamp } from "drizzle-orm/pg-core"; +import { integer, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; -export const whitelist = pgTable( +export const whitelist = sqliteTable( "whitelist", { email: text("email").notNull(), - expiresAt: timestamp("expires_at", { mode: "date" }).notNull(), + expiresAt: integer("expires_at", { mode: "timestamp" }).notNull(), reason: text("reason").notNull(), }, (table) => ({ diff --git a/playwright/package.json b/playwright/package.json index 781678ad96..06adbc35cc 100644 --- a/playwright/package.json +++ b/playwright/package.json @@ -13,13 +13,15 @@ "with-env": "dotenv -e ../.env --" }, "devDependencies": { + "@echo-webkom/db": "workspace:*", "@echo-webkom/tsconfig": "workspace:*", + "@libsql/client": "0.9.0", "@playwright/test": "1.46.1", "@types/node": "20.16.0", "dotenv-cli": "7.4.2", + "drizzle-orm": "0.32.0", "eslint": "8.57.0", "eslint-config-webkom": "workspace:*", - "postgres": "3.4.4", "typescript": "5.5.4" }, "eslintConfig": { diff --git a/playwright/web/register.spec.ts b/playwright/web/register.spec.ts index 72cd549bde..48a8ff204b 100644 --- a/playwright/web/register.spec.ts +++ b/playwright/web/register.spec.ts @@ -1,16 +1,17 @@ import { expect, test } from "@playwright/test"; -import postgres from "postgres"; +import { eq } from "drizzle-orm"; + +import { db } from "@echo-webkom/db"; +import { registrations } from "@echo-webkom/db/schemas"; import { loginAs } from "../helpers/sessionTest"; const SLUG = "test-i-prod-med-webkom"; const ID = "5cbb5337-a6e6-4eff-a821-a73722594f47"; -const sql = postgres(process.env.DATABASE_URL!); - test.describe("Register", () => { test.beforeEach(async () => { - await sql`DELETE FROM registration WHERE happening_id = ${ID}`; + await db.delete(registrations).where(eq(registrations.happeningId, ID)); }); test("register and deregister to event", async ({ page }) => { diff --git a/playwright/web/strikes.spec.ts b/playwright/web/strikes.spec.ts index 767a88eb1a..2e2225299d 100644 --- a/playwright/web/strikes.spec.ts +++ b/playwright/web/strikes.spec.ts @@ -1,16 +1,16 @@ import { expect, test } from "@playwright/test"; -import postgres from "postgres"; + +import { db } from "@echo-webkom/db"; +import { strikeInfos, strikes } from "@echo-webkom/db/schemas"; import { loginAs } from "../helpers/sessionTest"; const user = { id: "alum", name: "Andreas Aanes" }; -const sql = postgres(process.env.DATABASE_URL!); - test.describe("Strikes", () => { test.beforeEach(async () => { - await sql`DELETE FROM strike`; - await sql`DELETE FROM strike_info`; + await db.delete(strikes); + await db.delete(strikeInfos); await fetch("http://localhost:3000/api/revalidate", { method: "POST", headers: { Authorization: `Bearer ${process.env.ADMIN_KEY!}` }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a8b92ab52b..dd81c586b0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -188,7 +188,7 @@ importers: version: 3.6.0 drizzle-orm: specifier: 0.33.0 - version: 0.33.0(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1) + version: 0.33.0(@libsql/client@0.9.0)(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1) framer-motion: specifier: 11.3.28 version: 11.3.28(@emotion/is-prop-valid@1.2.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -321,7 +321,7 @@ importers: version: link:../db drizzle-orm: specifier: 0.33.0 - version: 0.33.0(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1) + version: 0.33.0(@libsql/client@0.9.0)(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1) next: specifier: 14.2.5 version: 14.2.5(@babel/core@7.24.6)(@playwright/test@1.46.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -397,24 +397,21 @@ importers: packages/db: dependencies: + '@libsql/client': + specifier: 0.9.0 + version: 0.9.0 drizzle-orm: specifier: 0.33.0 - version: 0.33.0(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1) + version: 0.33.0(@libsql/client@0.9.0)(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1) drizzle-zod: specifier: 0.5.1 - version: 0.5.1(drizzle-orm@0.33.0(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1))(zod@3.23.8) + version: 0.5.1(drizzle-orm@0.33.0(@libsql/client@0.9.0)(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1))(zod@3.23.8) nanoid: specifier: 5.0.7 version: 5.0.7 next-auth: specifier: 4.24.7 version: 4.24.7(next@14.2.5(@babel/core@7.24.6)(@playwright/test@1.46.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - pg: - specifier: 8.12.0 - version: 8.12.0 - postgres: - specifier: 3.4.4 - version: 3.4.4 zod: specifier: 3.23.8 version: 3.23.8 @@ -425,9 +422,6 @@ importers: '@types/node': specifier: 20.16.0 version: 20.16.0 - '@types/pg': - specifier: 8.11.6 - version: 8.11.6 dotenv-cli: specifier: 7.4.2 version: 7.4.2 @@ -550,7 +544,7 @@ importers: version: 12.1.0 drizzle-orm: specifier: 0.33.0 - version: 0.33.0(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1) + version: 0.33.0(@libsql/client@0.9.0)(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1) groq: specifier: 3.53.0 version: 3.53.0 @@ -579,9 +573,15 @@ importers: playwright: devDependencies: + '@echo-webkom/db': + specifier: workspace:* + version: link:../packages/db '@echo-webkom/tsconfig': specifier: workspace:* version: link:../packages/config/tsconfig + '@libsql/client': + specifier: 0.9.0 + version: 0.9.0 '@playwright/test': specifier: 1.46.1 version: 1.46.1 @@ -591,15 +591,15 @@ importers: dotenv-cli: specifier: 7.4.2 version: 7.4.2 + drizzle-orm: + specifier: 0.32.0 + version: 0.32.0(@libsql/client@0.9.0)(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1) eslint: specifier: 8.57.0 version: 8.57.0 eslint-config-webkom: specifier: workspace:* version: link:../packages/config/eslint - postgres: - specifier: 3.4.4 - version: 3.4.4 typescript: specifier: 5.5.4 version: 5.5.4 @@ -2289,6 +2289,95 @@ packages: '@lezer/lr@1.4.0': resolution: {integrity: sha512-Wst46p51km8gH0ZUmeNrtpRYmdlRHUpN1DQd3GFAyKANi8WVz8c2jHYTf1CVScFaCjQw1iO3ZZdqGDxQPRErTg==} + '@libsql/client@0.9.0': + resolution: {integrity: sha512-mT+91wtb8pxK9SWd566D5W2VUCemksUMqICRBtf0WXiS7XzNcQhWyrwYOnVrVmTSze/SCCsNNEKIkCRwk/pr2Q==} + + '@libsql/core@0.9.0': + resolution: {integrity: sha512-rCsS/EC32K8ARjDQJGqauGZmkR6orOOY4I7898PyQ/mmltAkMwRgz5kjEmYRZ42o7mP0ayJfbw28qgv7SRFEgg==} + + '@libsql/darwin-arm64@0.3.19': + resolution: {integrity: sha512-rmOqsLcDI65zzxlUOoEiPJLhqmbFsZF6p4UJQ2kMqB+Kc0Rt5/A1OAdOZ/Wo8fQfJWjR1IbkbpEINFioyKf+nQ==} + cpu: [arm64] + os: [darwin] + + '@libsql/darwin-arm64@0.4.1': + resolution: {integrity: sha512-XICT9/OyU8Aa9Iv1xZIHgvM09n/1OQUk3VC+s5uavzdiGHrDMkOWzN47JN7/FiMa/NWrcgoEiDMk3+e7mE53Ig==} + cpu: [arm64] + os: [darwin] + + '@libsql/darwin-x64@0.3.19': + resolution: {integrity: sha512-q9O55B646zU+644SMmOQL3FIfpmEvdWpRpzubwFc2trsa+zoBlSkHuzU9v/C+UNoPHQVRMP7KQctJ455I/h/xw==} + cpu: [x64] + os: [darwin] + + '@libsql/darwin-x64@0.4.1': + resolution: {integrity: sha512-pSKxhRrhu4SsTD+IBRZXcs1SkwMdeAG1tv6Z/Ctp/sOEYrgkU8MDKLqkOr9NsmwpK4S0+JdwjkLMyhTkct/5TQ==} + cpu: [x64] + os: [darwin] + + '@libsql/hrana-client@0.6.2': + resolution: {integrity: sha512-MWxgD7mXLNf9FXXiM0bc90wCjZSpErWKr5mGza7ERy2FJNNMXd7JIOv+DepBA1FQTIfI8TFO4/QDYgaQC0goNw==} + + '@libsql/isomorphic-fetch@0.2.5': + resolution: {integrity: sha512-8s/B2TClEHms2yb+JGpsVRTPBfy1ih/Pq6h6gvyaNcYnMVJvgQRY7wAa8U2nD0dppbCuDU5evTNMEhrQ17ZKKg==} + engines: {node: '>=18.0.0'} + + '@libsql/isomorphic-ws@0.1.5': + resolution: {integrity: sha512-DtLWIH29onUYR00i0GlQ3UdcTRC6EP4u9w/h9LxpUZJWRMARk6dQwZ6Jkd+QdwVpuAOrdxt18v0K2uIYR3fwFg==} + + '@libsql/linux-arm64-gnu@0.3.19': + resolution: {integrity: sha512-mgeAUU1oqqh57k7I3cQyU6Trpdsdt607eFyEmH5QO7dv303ti+LjUvh1pp21QWV6WX7wZyjeJV1/VzEImB+jRg==} + cpu: [arm64] + os: [linux] + + '@libsql/linux-arm64-gnu@0.4.1': + resolution: {integrity: sha512-9lpvb24tO2qZd9nq5dlq3ESA3hSKYWBIK7lJjfiCM6f7a70AUwBY9QoPJV9q4gILIyVnR1YBGrlm50nnb+dYgw==} + cpu: [arm64] + os: [linux] + + '@libsql/linux-arm64-musl@0.3.19': + resolution: {integrity: sha512-VEZtxghyK6zwGzU9PHohvNxthruSxBEnRrX7BSL5jQ62tN4n2JNepJ6SdzXp70pdzTfwroOj/eMwiPt94gkVRg==} + cpu: [arm64] + os: [linux] + + '@libsql/linux-arm64-musl@0.4.1': + resolution: {integrity: sha512-lyxi+lFxE+NcBRDMQCxCtDg3c4WcKAbc9u63d5+B23Vm+UgphD9XY4seu+tGrBy1MU2tuNVix7r9S7ECpAaVrA==} + cpu: [arm64] + os: [linux] + + '@libsql/linux-x64-gnu@0.3.19': + resolution: {integrity: sha512-2t/J7LD5w2f63wGihEO+0GxfTyYIyLGEvTFEsMO16XI5o7IS9vcSHrxsvAJs4w2Pf907uDjmc7fUfMg6L82BrQ==} + cpu: [x64] + os: [linux] + + '@libsql/linux-x64-gnu@0.4.1': + resolution: {integrity: sha512-psvuQ3UFBEmDFV8ZHG+WkUHIJiWv+elZ+zIPvOVedlIKdxG1O+8WthWUAhFHOGnbiyzc4sAZ4c3de1oCvyHxyQ==} + cpu: [x64] + os: [linux] + + '@libsql/linux-x64-musl@0.3.19': + resolution: {integrity: sha512-BLsXyJaL8gZD8+3W2LU08lDEd9MIgGds0yPy5iNPp8tfhXx3pV/Fge2GErN0FC+nzt4DYQtjL+A9GUMglQefXQ==} + cpu: [x64] + os: [linux] + + '@libsql/linux-x64-musl@0.4.1': + resolution: {integrity: sha512-PDidJ3AhGDqosGg3OAZzGxMFIbnuOALya4BoezJKl667AFv3x7BBQ30H81Mngsq3Fh8RkJkXSdWfL91+Txb1iA==} + cpu: [x64] + os: [linux] + + '@libsql/win32-x64-msvc@0.3.19': + resolution: {integrity: sha512-ay1X9AobE4BpzG0XPw1gplyLZPGHIgJOovvW23gUrukRegiUP62uzhpRbKNogLlUOynyXeq//prHgPXiebUfWg==} + cpu: [x64] + os: [win32] + + '@libsql/win32-x64-msvc@0.4.1': + resolution: {integrity: sha512-IdODVqV/PrdOnHA/004uWyorZQuRsB7U7bCRCE3vXgABj3eJLJGc6cv2C6ksEaEoVxJbD8k53H4VVAGrtYwXzQ==} + cpu: [x64] + os: [win32] + + '@neon-rs/load@0.0.4': + resolution: {integrity: sha512-kTPhdZyTQxB+2wpiRcFWrDcejc4JI6tkPuS7UZCG4l6Zvc5kU/gGQ/ozvHTh1XR5tS+UlfAfGuPajjzQjCiHCw==} + '@next/env@14.2.5': resolution: {integrity: sha512-/zZGkrTOsraVfYjGP8uM0p6r0BDT6xWpkjdVbcz66PJVSpwXX3yNiRycxAuDfBKGWBrZBXRuK/YVlkNgxHGwmA==} @@ -3721,6 +3810,9 @@ packages: '@types/uuid@8.3.4': resolution: {integrity: sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==} + '@types/ws@8.5.12': + resolution: {integrity: sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==} + '@typescript-eslint/eslint-plugin@7.18.0': resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} engines: {node: ^18.18.0 || >=20.0.0} @@ -4643,6 +4735,10 @@ packages: data-uri-to-buffer@1.2.0: resolution: {integrity: sha512-vKQ9DTQPN1FLYiiEEOQ6IBGFqvjCa5rSK3cWMy/Nespm5d/x3dGFT9UBZnkLxCwua/IXBi2TYnwTEpsOvhC4UQ==} + data-uri-to-buffer@4.0.1: + resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} + engines: {node: '>= 12'} + data-urls@5.0.0: resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==} engines: {node: '>=18'} @@ -4799,6 +4895,10 @@ packages: des.js@1.1.0: resolution: {integrity: sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==} + detect-libc@2.0.2: + resolution: {integrity: sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==} + engines: {node: '>=8'} + detect-libc@2.0.3: resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} engines: {node: '>=8'} @@ -4892,6 +4992,95 @@ packages: resolution: {integrity: sha512-rUl5Rf5HLOVkAwHEVEi8xgulIRWzoys0q77RHGCxv5e9v8AI3JGFg7Ug5K1kn513RwNZbuNJMUKOXo0j8kPRgg==} hasBin: true + drizzle-orm@0.32.0: + resolution: {integrity: sha512-99IlfVGPNHzOFEXo9Phyu5At5TALLsY2t6WxFFy68rYd9Ej4cHX/7WjdPOn7JNRW69MNeNtP8XrDQg43SppuAA==} + peerDependencies: + '@aws-sdk/client-rds-data': '>=3' + '@cloudflare/workers-types': '>=3' + '@electric-sql/pglite': '>=0.1.1' + '@libsql/client': '*' + '@neondatabase/serverless': '>=0.1' + '@op-engineering/op-sqlite': '>=2' + '@opentelemetry/api': ^1.4.1 + '@planetscale/database': '>=1' + '@prisma/client': '*' + '@tidbcloud/serverless': '*' + '@types/better-sqlite3': '*' + '@types/pg': '*' + '@types/react': '>=18' + '@types/sql.js': '*' + '@vercel/postgres': '>=0.8.0' + '@xata.io/client': '*' + better-sqlite3: '>=7' + bun-types: '*' + expo-sqlite: '>=13.2.0' + knex: '*' + kysely: '*' + mysql2: '>=2' + pg: '>=8' + postgres: '>=3' + prisma: '*' + react: '>=18' + sql.js: '>=1' + sqlite3: '>=5' + peerDependenciesMeta: + '@aws-sdk/client-rds-data': + optional: true + '@cloudflare/workers-types': + optional: true + '@electric-sql/pglite': + optional: true + '@libsql/client': + optional: true + '@neondatabase/serverless': + optional: true + '@op-engineering/op-sqlite': + optional: true + '@opentelemetry/api': + optional: true + '@planetscale/database': + optional: true + '@prisma/client': + optional: true + '@tidbcloud/serverless': + optional: true + '@types/better-sqlite3': + optional: true + '@types/pg': + optional: true + '@types/react': + optional: true + '@types/sql.js': + optional: true + '@vercel/postgres': + optional: true + '@xata.io/client': + optional: true + better-sqlite3: + optional: true + bun-types: + optional: true + expo-sqlite: + optional: true + knex: + optional: true + kysely: + optional: true + mysql2: + optional: true + pg: + optional: true + postgres: + optional: true + prisma: + optional: true + react: + optional: true + sql.js: + optional: true + sqlite3: + optional: true + drizzle-orm@0.33.0: resolution: {integrity: sha512-SHy72R2Rdkz0LEq0PSG/IdvnT3nGiWuRk+2tXZQ90GVq/XQhpCzu/EFT3V2rox+w8MlkBQxifF8pCStNYnERfA==} peerDependencies: @@ -5306,6 +5495,10 @@ packages: fd-slicer@1.1.0: resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} + fetch-blob@3.2.0: + resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} + engines: {node: ^12.20 || >= 14.13} + file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} @@ -5398,6 +5591,10 @@ packages: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} + formdata-polyfill@4.0.10: + resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} + engines: {node: '>=12.20.0'} + fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} @@ -6125,6 +6322,9 @@ packages: jose@4.15.5: resolution: {integrity: sha512-jc7BFxgKPKi94uOvEmzlSWFFe2+vASyXaKUpdQKatWAESU2MWjDfFf0fdfc83CDKcA5QecabZeNLyfhe3yKNkg==} + js-base64@3.7.7: + resolution: {integrity: sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==} + js-beautify@1.15.1: resolution: {integrity: sha512-ESjNzSlt/sWE8sciZH8kBF8BPlwXPwhR6pWKAw8bw4Bwj+iZcnKW6ONWUutJ7eObuBZQpiIb8S7OYspWrKt7rA==} engines: {node: '>=14'} @@ -6252,6 +6452,16 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} + libsql@0.3.19: + resolution: {integrity: sha512-Aj5cQ5uk/6fHdmeW0TiXK42FqUlwx7ytmMLPSaUQPin5HKKKuUPD62MAbN4OEweGBBI7q1BekoEN4gPUEL6MZA==} + cpu: [x64, arm64, wasm32] + os: [darwin, linux, win32] + + libsql@0.4.1: + resolution: {integrity: sha512-qZlR9Yu1zMBeLChzkE/cKfoKV3Esp9cn9Vx5Zirn4AVhDWPcjYhKwbtJcMuHehgk3mH+fJr9qW+3vesBWbQpBg==} + cpu: [x64, arm64, wasm32] + os: [darwin, linux, win32] + lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} @@ -6726,6 +6936,14 @@ packages: nice-try@1.0.5: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} + node-domexception@1.0.0: + resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} + engines: {node: '>=10.5.0'} + + node-fetch@3.3.2: + resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + node-html-parser@6.1.13: resolution: {integrity: sha512-qIsTMOY4C/dAa5Q5vsobRpOOvPfC4pB61UVW2uSwZNUp0QU/jCekTal1vMmbO0DgdHeLUJpv/ARmDqErVxA3Sg==} @@ -7387,6 +7605,9 @@ packages: progress-stream@2.0.0: resolution: {integrity: sha512-xJwOWR46jcXUq6EH9yYyqp+I52skPySOeHfkxOZ2IY1AiBi/sFJhbhAKHoV3OTw/omQ45KTio9215dRJ2Yxd3Q==} + promise-limit@2.7.0: + resolution: {integrity: sha512-7nJ6v5lnJsXwGprnGXga4wx6d1POjvi5Qmf1ivTRxTjH4Z/9Czja/UCMLVmB9N93GeWOU93XaFaEt6jbuoagNw==} + prop-types@15.8.1: resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} @@ -8883,6 +9104,10 @@ packages: web-namespaces@2.0.1: resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==} + web-streams-polyfill@3.3.3: + resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} + engines: {node: '>= 8'} + webidl-conversions@7.0.0: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} @@ -11318,6 +11543,85 @@ snapshots: dependencies: '@lezer/common': 1.2.1 + '@libsql/client@0.9.0': + dependencies: + '@libsql/core': 0.9.0 + '@libsql/hrana-client': 0.6.2 + js-base64: 3.7.7 + libsql: 0.4.1 + promise-limit: 2.7.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@libsql/core@0.9.0': + dependencies: + js-base64: 3.7.7 + + '@libsql/darwin-arm64@0.3.19': + optional: true + + '@libsql/darwin-arm64@0.4.1': + optional: true + + '@libsql/darwin-x64@0.3.19': + optional: true + + '@libsql/darwin-x64@0.4.1': + optional: true + + '@libsql/hrana-client@0.6.2': + dependencies: + '@libsql/isomorphic-fetch': 0.2.5 + '@libsql/isomorphic-ws': 0.1.5 + js-base64: 3.7.7 + node-fetch: 3.3.2 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@libsql/isomorphic-fetch@0.2.5': {} + + '@libsql/isomorphic-ws@0.1.5': + dependencies: + '@types/ws': 8.5.12 + ws: 8.18.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@libsql/linux-arm64-gnu@0.3.19': + optional: true + + '@libsql/linux-arm64-gnu@0.4.1': + optional: true + + '@libsql/linux-arm64-musl@0.3.19': + optional: true + + '@libsql/linux-arm64-musl@0.4.1': + optional: true + + '@libsql/linux-x64-gnu@0.3.19': + optional: true + + '@libsql/linux-x64-gnu@0.4.1': + optional: true + + '@libsql/linux-x64-musl@0.3.19': + optional: true + + '@libsql/linux-x64-musl@0.4.1': + optional: true + + '@libsql/win32-x64-msvc@0.3.19': + optional: true + + '@libsql/win32-x64-msvc@0.4.1': + optional: true + + '@neon-rs/load@0.0.4': {} + '@next/env@14.2.5': {} '@next/eslint-plugin-next@14.2.5': @@ -12887,6 +13191,7 @@ snapshots: '@types/node': 20.16.0 pg-protocol: 1.6.1 pg-types: 4.0.2 + optional: true '@types/progress-stream@2.0.5': dependencies: @@ -12954,6 +13259,10 @@ snapshots: '@types/uuid@8.3.4': {} + '@types/ws@8.5.12': + dependencies: + '@types/node': 20.16.0 + '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.10.0 @@ -14083,6 +14392,8 @@ snapshots: data-uri-to-buffer@1.2.0: {} + data-uri-to-buffer@4.0.1: {} + data-urls@5.0.0: dependencies: whatwg-mimetype: 4.0.0 @@ -14251,6 +14562,8 @@ snapshots: inherits: 2.0.4 minimalistic-assert: 1.0.1 + detect-libc@2.0.2: {} + detect-libc@2.0.3: {} detect-node-es@1.1.0: {} @@ -14342,17 +14655,27 @@ snapshots: transitivePeerDependencies: - supports-color - drizzle-orm@0.33.0(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1): + drizzle-orm@0.32.0(@libsql/client@0.9.0)(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1): + optionalDependencies: + '@libsql/client': 0.9.0 + '@types/pg': 8.11.6 + '@types/react': 18.3.3 + pg: 8.12.0 + postgres: 3.4.4 + react: 18.3.1 + + drizzle-orm@0.33.0(@libsql/client@0.9.0)(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1): optionalDependencies: + '@libsql/client': 0.9.0 '@types/pg': 8.11.6 '@types/react': 18.3.3 pg: 8.12.0 postgres: 3.4.4 react: 18.3.1 - drizzle-zod@0.5.1(drizzle-orm@0.33.0(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1))(zod@3.23.8): + drizzle-zod@0.5.1(drizzle-orm@0.33.0(@libsql/client@0.9.0)(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1))(zod@3.23.8): dependencies: - drizzle-orm: 0.33.0(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1) + drizzle-orm: 0.33.0(@libsql/client@0.9.0)(@types/pg@8.11.6)(@types/react@18.3.3)(pg@8.12.0)(postgres@3.4.4)(react@18.3.1) zod: 3.23.8 duplexify@3.7.1: @@ -14966,6 +15289,11 @@ snapshots: dependencies: pend: 1.2.0 + fetch-blob@3.2.0: + dependencies: + node-domexception: 1.0.0 + web-streams-polyfill: 3.3.3 + file-entry-cache@6.0.1: dependencies: flat-cache: 3.2.0 @@ -15050,6 +15378,10 @@ snapshots: combined-stream: 1.0.8 mime-types: 2.1.35 + formdata-polyfill@4.0.10: + dependencies: + fetch-blob: 3.2.0 + fraction.js@4.3.7: {} framer-motion@10.16.16(react-dom@18.2.0(react@18.3.1))(react@18.3.1): @@ -15862,6 +16194,8 @@ snapshots: jose@4.15.5: {} + js-base64@3.7.7: {} + js-beautify@1.15.1: dependencies: config-chain: 1.1.13 @@ -16061,6 +16395,33 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 + libsql@0.3.19: + dependencies: + '@neon-rs/load': 0.0.4 + detect-libc: 2.0.2 + optionalDependencies: + '@libsql/darwin-arm64': 0.3.19 + '@libsql/darwin-x64': 0.3.19 + '@libsql/linux-arm64-gnu': 0.3.19 + '@libsql/linux-arm64-musl': 0.3.19 + '@libsql/linux-x64-gnu': 0.3.19 + '@libsql/linux-x64-musl': 0.3.19 + '@libsql/win32-x64-msvc': 0.3.19 + + libsql@0.4.1: + dependencies: + '@neon-rs/load': 0.0.4 + detect-libc: 2.0.2 + libsql: 0.3.19 + optionalDependencies: + '@libsql/darwin-arm64': 0.4.1 + '@libsql/darwin-x64': 0.4.1 + '@libsql/linux-arm64-gnu': 0.4.1 + '@libsql/linux-arm64-musl': 0.4.1 + '@libsql/linux-x64-gnu': 0.4.1 + '@libsql/linux-x64-musl': 0.4.1 + '@libsql/win32-x64-msvc': 0.4.1 + lilconfig@2.1.0: {} lilconfig@3.1.1: {} @@ -16723,6 +17084,14 @@ snapshots: nice-try@1.0.5: {} + node-domexception@1.0.0: {} + + node-fetch@3.3.2: + dependencies: + data-uri-to-buffer: 4.0.1 + fetch-blob: 3.2.0 + formdata-polyfill: 4.0.10 + node-html-parser@6.1.13: dependencies: css-select: 5.1.0 @@ -16877,7 +17246,8 @@ snapshots: dependencies: rxjs: 7.8.1 - obuf@1.1.2: {} + obuf@1.1.2: + optional: true oidc-token-hash@5.0.3: {} @@ -17100,17 +17470,22 @@ snapshots: pg-cloudflare@1.1.1: optional: true - pg-connection-string@2.6.4: {} + pg-connection-string@2.6.4: + optional: true - pg-int8@1.0.1: {} + pg-int8@1.0.1: + optional: true - pg-numeric@1.0.2: {} + pg-numeric@1.0.2: + optional: true pg-pool@3.6.2(pg@8.12.0): dependencies: pg: 8.12.0 + optional: true - pg-protocol@1.6.1: {} + pg-protocol@1.6.1: + optional: true pg-types@2.2.0: dependencies: @@ -17119,6 +17494,7 @@ snapshots: postgres-bytea: 1.0.0 postgres-date: 1.0.7 postgres-interval: 1.2.0 + optional: true pg-types@4.0.2: dependencies: @@ -17129,6 +17505,7 @@ snapshots: postgres-date: 2.1.0 postgres-interval: 3.0.0 postgres-range: 1.1.4 + optional: true pg@8.12.0: dependencies: @@ -17139,10 +17516,12 @@ snapshots: pgpass: 1.0.5 optionalDependencies: pg-cloudflare: 1.1.1 + optional: true pgpass@1.0.5: dependencies: split2: 4.2.0 + optional: true picocolors@1.0.1: {} @@ -17254,29 +17633,39 @@ snapshots: picocolors: 1.0.1 source-map-js: 1.2.0 - postgres-array@2.0.0: {} + postgres-array@2.0.0: + optional: true - postgres-array@3.0.2: {} + postgres-array@3.0.2: + optional: true - postgres-bytea@1.0.0: {} + postgres-bytea@1.0.0: + optional: true postgres-bytea@3.0.0: dependencies: obuf: 1.1.2 + optional: true - postgres-date@1.0.7: {} + postgres-date@1.0.7: + optional: true - postgres-date@2.1.0: {} + postgres-date@2.1.0: + optional: true postgres-interval@1.2.0: dependencies: xtend: 4.0.2 + optional: true - postgres-interval@3.0.0: {} + postgres-interval@3.0.0: + optional: true - postgres-range@1.1.4: {} + postgres-range@1.1.4: + optional: true - postgres@3.4.4: {} + postgres@3.4.4: + optional: true preact-render-to-string@5.2.6(preact@10.20.2): dependencies: @@ -17332,6 +17721,8 @@ snapshots: speedometer: 1.0.0 through2: 2.0.5 + promise-limit@2.7.0: {} + prop-types@15.8.1: dependencies: loose-envify: 1.4.0 @@ -19234,6 +19625,8 @@ snapshots: web-namespaces@2.0.1: {} + web-streams-polyfill@3.3.3: {} + webidl-conversions@7.0.0: {} whatwg-encoding@3.1.1: diff --git a/turbo.json b/turbo.json index f2ffd733a8..c9e7313051 100644 --- a/turbo.json +++ b/turbo.json @@ -46,7 +46,7 @@ "NODE_ENV", "VERCEL_ENV", "DATABASE_URL", - "TEST_DATABASE_URL", + "DATABASE_AUTH_TOKEN", "NEXTAUTH_SECRET", "NEXTAUTH_URL", "FEIDE_CLIENT_ID",