diff --git a/prisma/migrations/20240613223000_add_unique_constraint_to_event_title/migration.sql b/prisma/migrations/20240613223000_add_unique_constraint_to_event_title/migration.sql deleted file mode 100644 index 93a18b7..0000000 --- a/prisma/migrations/20240613223000_add_unique_constraint_to_event_title/migration.sql +++ /dev/null @@ -1,228 +0,0 @@ --- CreateEnum -CREATE TYPE "Role" AS ENUM ('USER', 'ORGANIZER'); - --- CreateTable -CREATE TABLE "Person" ( - "id" SERIAL NOT NULL, - "name" TEXT NOT NULL, - "email" TEXT NOT NULL, - "phone_number" TEXT, - "role" "Role" NOT NULL DEFAULT 'USER', - "class" INTEGER, - "affiliation_id" INTEGER, - "image" TEXT, - - CONSTRAINT "Person_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Event" ( - "id" SERIAL NOT NULL, - "title" TEXT NOT NULL, - "event_start" TIMESTAMP(3) NOT NULL, - "event_end" TIMESTAMP(3) NOT NULL, - "reg_start" TIMESTAMP(3) NOT NULL, - "reg_end" TIMESTAMP(3) NOT NULL, - "estimated_participants" INTEGER NOT NULL, - "location" TEXT NOT NULL, - "transit" TEXT NOT NULL, - "description" TEXT NOT NULL, - "category_id" INTEGER NOT NULL, - "coordinator_id" INTEGER NOT NULL, - "form_id" INTEGER, - "organization_id" INTEGER NOT NULL, - "image" BYTEA NOT NULL, - - CONSTRAINT "Event_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Organization" ( - "id" SERIAL NOT NULL, - "name" TEXT NOT NULL, - "abbreviation" TEXT NOT NULL, - "unit" TEXT, - - CONSTRAINT "Organization_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Form" ( - "id" SERIAL NOT NULL, - "file" TEXT NOT NULL, - "student_id" INTEGER, - "type" SERIAL NOT NULL, - - CONSTRAINT "Form_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Comment" ( - "id" SERIAL NOT NULL, - "feedback" TEXT NOT NULL, - "date_written" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "author_id" INTEGER NOT NULL, - "event_id" INTEGER NOT NULL, - - CONSTRAINT "Comment_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Application" ( - "id" SERIAL NOT NULL, - "date_applied" TIMESTAMP(3) NOT NULL, - "summary" TEXT NOT NULL, - "approved" BOOLEAN NOT NULL, - "applicant_id" INTEGER NOT NULL, - "event_id" INTEGER NOT NULL, - - CONSTRAINT "Application_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Category" ( - "id" SERIAL NOT NULL, - "name" TEXT NOT NULL, - - CONSTRAINT "Category_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "HourSubmission" ( - "id" SERIAL NOT NULL, - "volunteer_id" INTEGER NOT NULL, - "event_id" INTEGER NOT NULL, - "hours" DOUBLE PRECISION NOT NULL, - "note" TEXT NOT NULL, - "date_submitted" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "approval_status" INTEGER NOT NULL, - "updated_at" TIMESTAMP(3), - "updated_by_id" INTEGER NOT NULL, - "deleted_at" TIMESTAMP(3), - "deleted_by_id" INTEGER, - - CONSTRAINT "HourSubmission_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "HourSubmissionCode" ( - "id" SERIAL NOT NULL, - "meaning" TEXT NOT NULL, - - CONSTRAINT "HourSubmissionCode_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "FormCode" ( - "id" SERIAL NOT NULL, - "title" TEXT NOT NULL, - "description" TEXT NOT NULL, - "downloadable" BOOLEAN NOT NULL DEFAULT false, - "upload_link" TEXT, - - CONSTRAINT "FormCode_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Account" ( - "id" SERIAL NOT NULL, - "userId" INTEGER NOT NULL, - "type" TEXT NOT NULL, - "provider" TEXT NOT NULL, - "providerAccountId" 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_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Session" ( - "id" SERIAL NOT NULL, - "sessionToken" TEXT NOT NULL, - "userId" INTEGER NOT NULL, - "expires" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Session_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "VerificationToken" ( - "identifier" TEXT NOT NULL, - "token" TEXT NOT NULL, - "expires" TIMESTAMP(3) NOT NULL -); - --- CreateIndex -CREATE UNIQUE INDEX "Person_email_key" ON "Person"("email"); - --- CreateIndex -CREATE UNIQUE INDEX "Person_phone_number_key" ON "Person"("phone_number"); - --- CreateIndex -CREATE UNIQUE INDEX "Event_title_key" ON "Event"("title"); - --- CreateIndex -CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId"); - --- CreateIndex -CREATE UNIQUE INDEX "Session_sessionToken_key" ON "Session"("sessionToken"); - --- CreateIndex -CREATE UNIQUE INDEX "VerificationToken_token_key" ON "VerificationToken"("token"); - --- CreateIndex -CREATE UNIQUE INDEX "VerificationToken_identifier_token_key" ON "VerificationToken"("identifier", "token"); - --- AddForeignKey -ALTER TABLE "Person" ADD CONSTRAINT "Person_affiliation_id_fkey" FOREIGN KEY ("affiliation_id") REFERENCES "Organization"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Event" ADD CONSTRAINT "Event_category_id_fkey" FOREIGN KEY ("category_id") REFERENCES "Category"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Event" ADD CONSTRAINT "Event_coordinator_id_fkey" FOREIGN KEY ("coordinator_id") REFERENCES "Person"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Event" ADD CONSTRAINT "Event_form_id_fkey" FOREIGN KEY ("form_id") REFERENCES "Form"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Event" ADD CONSTRAINT "Event_organization_id_fkey" FOREIGN KEY ("organization_id") REFERENCES "Organization"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Form" ADD CONSTRAINT "Form_student_id_fkey" FOREIGN KEY ("student_id") REFERENCES "Person"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Comment" ADD CONSTRAINT "Comment_author_id_fkey" FOREIGN KEY ("author_id") REFERENCES "Person"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Comment" ADD CONSTRAINT "Comment_event_id_fkey" FOREIGN KEY ("event_id") REFERENCES "Event"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Application" ADD CONSTRAINT "Application_applicant_id_fkey" FOREIGN KEY ("applicant_id") REFERENCES "Person"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Application" ADD CONSTRAINT "Application_event_id_fkey" FOREIGN KEY ("event_id") REFERENCES "Event"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "HourSubmission" ADD CONSTRAINT "HourSubmission_deleted_by_id_fkey" FOREIGN KEY ("deleted_by_id") REFERENCES "Person"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "HourSubmission" ADD CONSTRAINT "HourSubmission_event_id_fkey" FOREIGN KEY ("event_id") REFERENCES "Event"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "HourSubmission" ADD CONSTRAINT "HourSubmission_updated_by_id_fkey" FOREIGN KEY ("updated_by_id") REFERENCES "Person"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "HourSubmission" ADD CONSTRAINT "HourSubmission_volunteer_id_fkey" FOREIGN KEY ("volunteer_id") REFERENCES "Person"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "Person"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Session" ADD CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "Person"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/migrations/20240613225533_make_updated_by_optional/migration.sql b/prisma/migrations/20240613225533_make_updated_by_optional/migration.sql deleted file mode 100644 index f93e54b..0000000 --- a/prisma/migrations/20240613225533_make_updated_by_optional/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "HourSubmission" ADD COLUMN "description" TEXT; diff --git a/prisma/migrations/20240618183718_add_college_and_dietary_restrictions/migration.sql b/prisma/migrations/20240618183718_add_college_and_dietary_restrictions/migration.sql deleted file mode 100644 index bfb4ba5..0000000 --- a/prisma/migrations/20240618183718_add_college_and_dietary_restrictions/migration.sql +++ /dev/null @@ -1,3 +0,0 @@ --- AlterTable -ALTER TABLE "Person" ADD COLUMN "college" TEXT, -ADD COLUMN "dietary_restrictions" TEXT; diff --git a/prisma/migrations/20240619042916_added_admin_role_to_role/migration.sql b/prisma/migrations/20240619042916_added_admin_role_to_role/migration.sql deleted file mode 100644 index e21fdab..0000000 --- a/prisma/migrations/20240619042916_added_admin_role_to_role/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterEnum -ALTER TYPE "Role" ADD VALUE 'ADMIN'; diff --git a/prisma/migrations/20240624142134_added_approval_status_to_application/migration.sql b/prisma/migrations/20240624142134_added_approval_status_to_application/migration.sql deleted file mode 100644 index 0f78f10..0000000 --- a/prisma/migrations/20240624142134_added_approval_status_to_application/migration.sql +++ /dev/null @@ -1,28 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `approved` on the `Application` table. All the data in the column will be lost. - - You are about to alter the column `college` on the `Person` table. The data in that column could be lost. The data in that column will be cast from `Text` to `VarChar(255)`. - - You are about to drop the `HourSubmissionCode` table. If the table is not empty, all the data it contains will be lost. - -*/ --- AlterTable -ALTER TABLE "Application" DROP COLUMN "approved", -ADD COLUMN "approval_status" INTEGER NOT NULL DEFAULT 0; - --- AlterTable -ALTER TABLE "HourSubmission" ALTER COLUMN "approval_status" SET DEFAULT 0; - --- AlterTable -ALTER TABLE "Person" ALTER COLUMN "college" SET DATA TYPE VARCHAR(255); - --- DropTable -DROP TABLE "HourSubmissionCode"; - --- CreateTable -CREATE TABLE "ApprovalStatusCode" ( - "id" SERIAL NOT NULL, - "meaning" TEXT NOT NULL, - - CONSTRAINT "ApprovalStatusCode_pkey" PRIMARY KEY ("id") -); diff --git a/prisma/migrations/20240624144337_created_reason_table_for_applications/migration.sql b/prisma/migrations/20240624144337_created_reason_table_for_applications/migration.sql deleted file mode 100644 index 570e9dd..0000000 --- a/prisma/migrations/20240624144337_created_reason_table_for_applications/migration.sql +++ /dev/null @@ -1,21 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `summary` on the `Application` table. All the data in the column will be lost. - - Added the required column `reason_id` to the `Application` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "Application" DROP COLUMN "summary", -ADD COLUMN "reason_id" INTEGER NOT NULL; - --- CreateTable -CREATE TABLE "Reason" ( - "id" SERIAL NOT NULL, - "meaning" TEXT NOT NULL, - - CONSTRAINT "Reason_pkey" PRIMARY KEY ("id") -); - --- AddForeignKey -ALTER TABLE "Application" ADD CONSTRAINT "Application_reason_id_fkey" FOREIGN KEY ("reason_id") REFERENCES "Reason"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/migrations/20240624145832_added_update_and_deleted_by_to_applications/migration.sql b/prisma/migrations/20240624145832_added_update_and_deleted_by_to_applications/migration.sql deleted file mode 100644 index 2249ea5..0000000 --- a/prisma/migrations/20240624145832_added_update_and_deleted_by_to_applications/migration.sql +++ /dev/null @@ -1,17 +0,0 @@ -/* - Warnings: - - - Added the required column `updated_by_id` to the `Application` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "Application" ADD COLUMN "deleted_at" TIMESTAMP(3), -ADD COLUMN "deleted_by_id" INTEGER, -ADD COLUMN "updated_at" TIMESTAMP(3), -ADD COLUMN "updated_by_id" INTEGER NOT NULL; - --- AddForeignKey -ALTER TABLE "Application" ADD CONSTRAINT "Application_deleted_by_id_fkey" FOREIGN KEY ("deleted_by_id") REFERENCES "Person"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Application" ADD CONSTRAINT "Application_updated_by_id_fkey" FOREIGN KEY ("updated_by_id") REFERENCES "Person"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/migrations/20240624204359_made_hour_description_required/migration.sql b/prisma/migrations/20240624204359_made_hour_description_required/migration.sql deleted file mode 100644 index 8dff6b6..0000000 --- a/prisma/migrations/20240624204359_made_hour_description_required/migration.sql +++ /dev/null @@ -1,15 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `note` on the `HourSubmission` table. All the data in the column will be lost. - - Made the column `description` on table `HourSubmission` required. This step will fail if there are existing NULL values in that column. - -*/ --- AlterTable -ALTER TABLE "Application" ALTER COLUMN "updated_at" SET DEFAULT CURRENT_TIMESTAMP; - --- AlterTable -ALTER TABLE "HourSubmission" DROP COLUMN "note", -ADD COLUMN "feedback" TEXT, -ALTER COLUMN "updated_at" SET DEFAULT CURRENT_TIMESTAMP, -ALTER COLUMN "description" SET NOT NULL; diff --git a/prisma/migrations/20240626000641_add_organization_name_to_event/migration.sql b/prisma/migrations/20240626000641_add_organization_name_to_event/migration.sql deleted file mode 100644 index aa84664..0000000 --- a/prisma/migrations/20240626000641_add_organization_name_to_event/migration.sql +++ /dev/null @@ -1,9 +0,0 @@ --- DropForeignKey -ALTER TABLE "Event" DROP CONSTRAINT "Event_organization_id_fkey"; - --- AlterTable -ALTER TABLE "Event" ADD COLUMN "organization_name" TEXT, -ALTER COLUMN "organization_id" DROP NOT NULL; - --- AddForeignKey -ALTER TABLE "Event" ADD CONSTRAINT "Event_organization_id_fkey" FOREIGN KEY ("organization_id") REFERENCES "Organization"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/prisma/migrations/20240626003307_add_publish_to_event/migration.sql b/prisma/migrations/20240626003307_add_publish_to_event/migration.sql deleted file mode 100644 index c50f4ec..0000000 --- a/prisma/migrations/20240626003307_add_publish_to_event/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "Event" ADD COLUMN "published" BOOLEAN NOT NULL DEFAULT false; diff --git a/prisma/migrations/20240626004333_add_coordinator_name_email_to_event/migration.sql b/prisma/migrations/20240626004333_add_coordinator_name_email_to_event/migration.sql deleted file mode 100644 index b0f1de4..0000000 --- a/prisma/migrations/20240626004333_add_coordinator_name_email_to_event/migration.sql +++ /dev/null @@ -1,11 +0,0 @@ -/* - Warnings: - - - Added the required column `coordinator_email` to the `Event` table without a default value. This is not possible if the table is not empty. - - Added the required column `coordinator_name` to the `Event` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "Event" -ADD COLUMN "coordinator_email" TEXT DEFAULT 'default_email@example.com', -ADD COLUMN "coordinator_name" TEXT DEFAULT 'default_name'; \ No newline at end of file diff --git a/prisma/migrations/20240626142438_added_event_password/migration.sql b/prisma/migrations/20240626142438_added_event_password/migration.sql deleted file mode 100644 index ad48c0a..0000000 --- a/prisma/migrations/20240626142438_added_event_password/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "Event" ADD COLUMN "application_password" TEXT; diff --git a/prisma/migrations/20240626200303_add_bu_id_to_person/migration.sql b/prisma/migrations/20240626200303_add_bu_id_to_person/migration.sql deleted file mode 100644 index 496f489..0000000 --- a/prisma/migrations/20240626200303_add_bu_id_to_person/migration.sql +++ /dev/null @@ -1,14 +0,0 @@ -/* - Warnings: - - - A unique constraint covering the columns `[bu_id]` on the table `Person` will be added. If there are existing duplicate values, this will fail. - - Added the required column `bu_id` to the `Person` table without a default value. This is not possible if the table is not empty. - - Made the column `phone_number` on table `Person` required. This step will fail if there are existing NULL values in that column. - -*/ --- AlterTable -ALTER TABLE "Person" ADD COLUMN "bu_id" TEXT NOT NULL, -ALTER COLUMN "phone_number" SET NOT NULL; - --- CreateIndex -CREATE UNIQUE INDEX "Person_bu_id_key" ON "Person"("bu_id"); diff --git a/prisma/migrations/20240626201529_add_bu_id_to_person_optional/migration.sql b/prisma/migrations/20240626201529_add_bu_id_to_person_optional/migration.sql deleted file mode 100644 index fd22fed..0000000 --- a/prisma/migrations/20240626201529_add_bu_id_to_person_optional/migration.sql +++ /dev/null @@ -1,3 +0,0 @@ --- AlterTable -ALTER TABLE "Person" ALTER COLUMN "phone_number" DROP NOT NULL, -ALTER COLUMN "bu_id" DROP NOT NULL; diff --git a/prisma/migrations/20240627144950_remove_entirely_unnecessary_organization_name/migration.sql b/prisma/migrations/20240627144950_remove_entirely_unnecessary_organization_name/migration.sql deleted file mode 100644 index ac67b01..0000000 --- a/prisma/migrations/20240627144950_remove_entirely_unnecessary_organization_name/migration.sql +++ /dev/null @@ -1,14 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `coordinator_email` on the `Event` table. All the data in the column will be lost. - - You are about to drop the column `coordinator_name` on the `Event` table. All the data in the column will be lost. - - You are about to drop the column `organization_name` on the `Event` table. All the data in the column will be lost. - - You are about to drop the column `published` on the `Event` table. All the data in the column will be lost. - -*/ --- AlterTable -ALTER TABLE "Event" DROP COLUMN "coordinator_email", -DROP COLUMN "coordinator_name", -DROP COLUMN "organization_name", -DROP COLUMN "published"; diff --git a/prisma/migrations/20240627161034_removed_bu_id_for_fixing/migration.sql b/prisma/migrations/20240627161034_removed_bu_id_for_fixing/migration.sql deleted file mode 100644 index d14ffeb..0000000 --- a/prisma/migrations/20240627161034_removed_bu_id_for_fixing/migration.sql +++ /dev/null @@ -1,11 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `bu_id` on the `Person` table. All the data in the column will be lost. - -*/ --- DropIndex -DROP INDEX "Person_bu_id_key"; - --- AlterTable -ALTER TABLE "Person" DROP COLUMN "bu_id"; diff --git a/prisma/migrations/20240627161142_added_bu_id_back/migration.sql b/prisma/migrations/20240627161142_added_bu_id_back/migration.sql deleted file mode 100644 index 56cd8cd..0000000 --- a/prisma/migrations/20240627161142_added_bu_id_back/migration.sql +++ /dev/null @@ -1,11 +0,0 @@ -/* - Warnings: - - - A unique constraint covering the columns `[bu_id]` on the table `Person` will be added. If there are existing duplicate values, this will fail. - -*/ --- AlterTable -ALTER TABLE "Person" ADD COLUMN "bu_id" TEXT; - --- CreateIndex -CREATE UNIQUE INDEX "Person_bu_id_key" ON "Person"("bu_id"); diff --git a/prisma/migrations/20241030221808_add_test_field/migration.sql b/prisma/migrations/20241030221808_add_test_field/migration.sql deleted file mode 100644 index f32c7f0..0000000 --- a/prisma/migrations/20241030221808_add_test_field/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - Added the required column `test` to the `Organization` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "Organization" ADD COLUMN "test" INTEGER NOT NULL; diff --git a/prisma/migrations/20241030221931_remove_test_field/migration.sql b/prisma/migrations/20241030221931_remove_test_field/migration.sql deleted file mode 100644 index b5d95f3..0000000 --- a/prisma/migrations/20241030221931_remove_test_field/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `test` on the `Organization` table. All the data in the column will be lost. - -*/ --- AlterTable -ALTER TABLE "Organization" DROP COLUMN "test"; diff --git a/prisma/migrations/20241030231640_added_approval_status_to_events/migration.sql b/prisma/migrations/20241030231640_added_approval_status_to_events/migration.sql deleted file mode 100644 index 645f456..0000000 --- a/prisma/migrations/20241030231640_added_approval_status_to_events/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "Event" ADD COLUMN "approval_status" INTEGER NOT NULL DEFAULT 0; diff --git a/prisma/migrations/20241031155427_add/migration.sql b/prisma/migrations/20241031155427_add/migration.sql deleted file mode 100644 index 7ee109a..0000000 --- a/prisma/migrations/20241031155427_add/migration.sql +++ /dev/null @@ -1,30 +0,0 @@ --- CreateTable -CREATE TABLE "Waitlist" ( - "id" SERIAL NOT NULL, - "date_applied" TIMESTAMP(3) NOT NULL, - "applicant_id" INTEGER NOT NULL, - "event_id" INTEGER NOT NULL, - "approval_status" INTEGER NOT NULL DEFAULT 0, - "reason_id" INTEGER NOT NULL, - "deleted_at" TIMESTAMP(3), - "deleted_by_id" INTEGER, - "updated_at" TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP, - "updated_by_id" INTEGER NOT NULL, - - CONSTRAINT "Waitlist_pkey" PRIMARY KEY ("id") -); - --- AddForeignKey -ALTER TABLE "Waitlist" ADD CONSTRAINT "Waitlist_applicant_id_fkey" FOREIGN KEY ("applicant_id") REFERENCES "Person"("id") ON DELETE NO ACTION ON UPDATE NO ACTION; - --- AddForeignKey -ALTER TABLE "Waitlist" ADD CONSTRAINT "Waitlist_deleted_by_id_fkey" FOREIGN KEY ("deleted_by_id") REFERENCES "Person"("id") ON DELETE NO ACTION ON UPDATE NO ACTION; - --- AddForeignKey -ALTER TABLE "Waitlist" ADD CONSTRAINT "Waitlist_event_id_fkey" FOREIGN KEY ("event_id") REFERENCES "Event"("id") ON DELETE NO ACTION ON UPDATE NO ACTION; - --- AddForeignKey -ALTER TABLE "Waitlist" ADD CONSTRAINT "Waitlist_reason_id_fkey" FOREIGN KEY ("reason_id") REFERENCES "Reason"("id") ON DELETE NO ACTION ON UPDATE NO ACTION; - --- AddForeignKey -ALTER TABLE "Waitlist" ADD CONSTRAINT "Waitlist_updated_by_id_fkey" FOREIGN KEY ("updated_by_id") REFERENCES "Person"("id") ON DELETE NO ACTION ON UPDATE NO ACTION; diff --git a/prisma/migrations/20241107151545_added_fields_to_organization_table/migration.sql b/prisma/migrations/20241107151545_added_fields_to_organization_table/migration.sql deleted file mode 100644 index 17bebf8..0000000 --- a/prisma/migrations/20241107151545_added_fields_to_organization_table/migration.sql +++ /dev/null @@ -1,19 +0,0 @@ -/* - Warnings: - - - Added the required column `email` to the `Organization` table without a default value. This is not possible if the table is not empty. - - Added the required column `nameofservice` to the `Organization` table without a default value. This is not possible if the table is not empty. - - Added the required column `state` to the `Organization` table without a default value. This is not possible if the table is not empty. - - Added the required column `street` to the `Organization` table without a default value. This is not possible if the table is not empty. - - Added the required column `zipcode` to the `Organization` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "Organization" ADD COLUMN "apt" TEXT, -ADD COLUMN "email" TEXT NOT NULL, -ADD COLUMN "image" TEXT, -ADD COLUMN "nameofservice" TEXT NOT NULL, -ADD COLUMN "phone_number" TEXT, -ADD COLUMN "state" TEXT NOT NULL, -ADD COLUMN "street" TEXT NOT NULL, -ADD COLUMN "zipcode" INTEGER NOT NULL; diff --git a/prisma/migrations/20241107152355_added_city_field_to_organization_table/migration.sql b/prisma/migrations/20241107152355_added_city_field_to_organization_table/migration.sql deleted file mode 100644 index a54ad6a..0000000 --- a/prisma/migrations/20241107152355_added_city_field_to_organization_table/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - Added the required column `city` to the `Organization` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "Organization" ADD COLUMN "city" TEXT NOT NULL; diff --git a/prisma/migrations/20241107160319_updated_image_field_on_organization_table/migration.sql b/prisma/migrations/20241107160319_updated_image_field_on_organization_table/migration.sql deleted file mode 100644 index 08cd310..0000000 --- a/prisma/migrations/20241107160319_updated_image_field_on_organization_table/migration.sql +++ /dev/null @@ -1,9 +0,0 @@ -/* - Warnings: - - - The `image` column on the `Organization` table would be dropped and recreated. This will lead to data loss if there is data in the column. - -*/ --- AlterTable -ALTER TABLE "Organization" DROP COLUMN "image", -ADD COLUMN "image" BYTEA; diff --git a/prisma/migrations/20241114033539_changed_auth_variables_for_clerk/migration.sql b/prisma/migrations/20241114033539_changed_auth_variables_for_clerk/migration.sql deleted file mode 100644 index 604853d..0000000 --- a/prisma/migrations/20241114033539_changed_auth_variables_for_clerk/migration.sql +++ /dev/null @@ -1,29 +0,0 @@ -/* - Warnings: - - - You are about to drop the `Account` table. If the table is not empty, all the data it contains will be lost. - - You are about to drop the `Session` table. If the table is not empty, all the data it contains will be lost. - - You are about to drop the `VerificationToken` table. If the table is not empty, all the data it contains will be lost. - - A unique constraint covering the columns `[clerk_id]` on the table `Person` will be added. If there are existing duplicate values, this will fail. - -*/ --- DropForeignKey -ALTER TABLE "Account" DROP CONSTRAINT "Account_userId_fkey"; - --- DropForeignKey -ALTER TABLE "Session" DROP CONSTRAINT "Session_userId_fkey"; - --- AlterTable -ALTER TABLE "Person" ADD COLUMN "clerk_id" TEXT; - --- DropTable -DROP TABLE "Account"; - --- DropTable -DROP TABLE "Session"; - --- DropTable -DROP TABLE "VerificationToken"; - --- CreateIndex -CREATE UNIQUE INDEX "Person_clerk_id_key" ON "Person"("clerk_id"); diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml deleted file mode 100644 index fbffa92..0000000 --- a/prisma/migrations/migration_lock.toml +++ /dev/null @@ -1,3 +0,0 @@ -# Please do not edit this file manually -# It should be added in your version-control system (i.e. Git) -provider = "postgresql" \ No newline at end of file diff --git a/prisma/schema.prisma b/prisma/schema.prisma deleted file mode 100644 index 7aac65f..0000000 --- a/prisma/schema.prisma +++ /dev/null @@ -1,188 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} - -model Person { - id Int @id @default(autoincrement()) - clerk_id String? @unique - name String - email String @unique - phone_number String? @unique - role Role @default(USER) - class Int? - affiliation_id Int? - image String? - college String? @db.VarChar(255) - dietary_restrictions String? - bu_id String? @unique - applications Application[] @relation("applicant") - deleted_applications Application[] @relation("ApplicationDeleter") - updated_applications Application[] @relation("ApplicationUpdater") - comments Comment[] - events Event[] - forms Form[] - deleted_submissions HourSubmission[] @relation("HourSubmissionDeleter") - updated_submissions HourSubmission[] @relation("HourSubmissionUpdater") - hour_submissions HourSubmission[] - affiliation Organization? @relation(fields: [affiliation_id], references: [id]) - Waitlist_Waitlist_applicant_idToPerson Waitlist[] @relation("Waitlist_applicant_idToPerson") - Waitlist_Waitlist_deleted_by_idToPerson Waitlist[] @relation("Waitlist_deleted_by_idToPerson") - Waitlist_Waitlist_updated_by_idToPerson Waitlist[] @relation("Waitlist_updated_by_idToPerson") -} - -model Event { - id Int @id @default(autoincrement()) - title String @unique - event_start DateTime - event_end DateTime - reg_start DateTime - reg_end DateTime - estimated_participants Int - location String - transit String - description String - category_id Int - coordinator_id Int - form_id Int? - organization_id Int? - image Bytes - application_password String? - applications Application[] - comments Comment[] - category Category @relation(fields: [category_id], references: [id]) - coordinator Person @relation(fields: [coordinator_id], references: [id]) - form Form? @relation(fields: [form_id], references: [id]) - organization Organization? @relation(fields: [organization_id], references: [id]) - hour_submissions HourSubmission[] - approval_status Int @default(0) - Waitlist Waitlist[] -} - -model Organization { - id Int @id @default(autoincrement()) - name String - nameofservice String - abbreviation String - unit String? - street String - city String - state String - zipcode Int - apt String? - image Bytes? - phone_number String? - email String - events Event[] - members Person[] -} - -model Form { - id Int @id @default(autoincrement()) - file String - student_id Int? - type Int @default(autoincrement()) - events Event[] - student Person? @relation(fields: [student_id], references: [id]) -} - -model Comment { - id Int @id @default(autoincrement()) - feedback String - date_written DateTime @default(now()) - author_id Int - event_id Int - author Person @relation(fields: [author_id], references: [id]) - event Event @relation(fields: [event_id], references: [id]) -} - -model Application { - id Int @id @default(autoincrement()) - date_applied DateTime - applicant_id Int - event_id Int - approval_status Int @default(0) - reason_id Int - deleted_at DateTime? - deleted_by_id Int? - updated_at DateTime? @default(now()) - updated_by_id Int - applicant Person @relation("applicant", fields: [applicant_id], references: [id]) - deleted_by Person? @relation("ApplicationDeleter", fields: [deleted_by_id], references: [id]) - event Event @relation(fields: [event_id], references: [id]) - reason Reason @relation(fields: [reason_id], references: [id]) - updated_by Person @relation("ApplicationUpdater", fields: [updated_by_id], references: [id]) -} - -model Reason { - id Int @id @default(autoincrement()) - meaning String - Application Application[] - Waitlist Waitlist[] -} - -model Category { - id Int @id @default(autoincrement()) - name String - events Event[] -} - -model HourSubmission { - id Int @id @default(autoincrement()) - volunteer_id Int - event_id Int - hours Float - date_submitted DateTime @default(now()) - approval_status Int @default(0) - updated_at DateTime? @default(now()) - updated_by_id Int - deleted_at DateTime? - deleted_by_id Int? - description String - feedback String? - deleted_by Person? @relation("HourSubmissionDeleter", fields: [deleted_by_id], references: [id]) - event Event @relation(fields: [event_id], references: [id]) - updated_by Person @relation("HourSubmissionUpdater", fields: [updated_by_id], references: [id]) - volunteer Person @relation(fields: [volunteer_id], references: [id]) -} - -model ApprovalStatusCode { - id Int @id @default(autoincrement()) - meaning String -} - -model FormCode { - id Int @id @default(autoincrement()) - title String - description String - downloadable Boolean @default(false) - upload_link String? -} - -model Waitlist { - id Int @id @default(autoincrement()) - date_applied DateTime - applicant_id Int - event_id Int - approval_status Int @default(0) - reason_id Int - deleted_at DateTime? - deleted_by_id Int? - updated_at DateTime? @default(now()) - updated_by_id Int - Person_Waitlist_applicant_idToPerson Person @relation("Waitlist_applicant_idToPerson", fields: [applicant_id], references: [id], onDelete: NoAction, onUpdate: NoAction) - Person_Waitlist_deleted_by_idToPerson Person? @relation("Waitlist_deleted_by_idToPerson", fields: [deleted_by_id], references: [id], onDelete: NoAction, onUpdate: NoAction) - Event Event @relation(fields: [event_id], references: [id], onDelete: NoAction, onUpdate: NoAction) - Reason Reason @relation(fields: [reason_id], references: [id], onDelete: NoAction, onUpdate: NoAction) - Person_Waitlist_updated_by_idToPerson Person @relation("Waitlist_updated_by_idToPerson", fields: [updated_by_id], references: [id], onDelete: NoAction, onUpdate: NoAction) -} - -enum Role { - USER - ORGANIZER - ADMIN -} \ No newline at end of file