diff --git a/prisma/migrations/20240110184601_add_waitlistuser/migration.sql b/prisma/migrations/20240110184601_add_waitlistuser/migration.sql deleted file mode 100644 index 85da2ad4e..000000000 --- a/prisma/migrations/20240110184601_add_waitlistuser/migration.sql +++ /dev/null @@ -1,111 +0,0 @@ --- CreateEnum -CREATE TYPE "AccessEnum" AS ENUM ('READ', 'WRITE', 'ADMIN'); - --- CreateTable -CREATE TABLE "Account" ( - "id" TEXT NOT NULL, - "userId" TEXT 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" TEXT NOT NULL, - "sessionToken" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "expires" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Session_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "User" ( - "id" TEXT NOT NULL, - "name" TEXT, - "email" TEXT, - "emailVerified" TIMESTAMP(3), - "image" TEXT, - - CONSTRAINT "User_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "WaitlistUser" ( - "id" TEXT NOT NULL, - "email" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - - CONSTRAINT "WaitlistUser_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "VerificationToken" ( - "identifier" TEXT NOT NULL, - "token" TEXT NOT NULL, - "expires" TIMESTAMP(3) NOT NULL -); - --- CreateTable -CREATE TABLE "Org" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Org_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Member" ( - "id" TEXT NOT NULL, - "title" TEXT, - "access" "AccessEnum" NOT NULL DEFAULT 'READ', - "active" BOOLEAN NOT NULL DEFAULT true, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - "userId" TEXT, - "orgId" TEXT, - - CONSTRAINT "Member_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "Account_userId_idx" ON "Account"("userId"); - --- CreateIndex -CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId"); - --- CreateIndex -CREATE UNIQUE INDEX "Session_sessionToken_key" ON "Session"("sessionToken"); - --- CreateIndex -CREATE INDEX "Session_userId_idx" ON "Session"("userId"); - --- CreateIndex -CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); - --- CreateIndex -CREATE UNIQUE INDEX "WaitlistUser_email_key" ON "WaitlistUser"("email"); - --- CreateIndex -CREATE UNIQUE INDEX "VerificationToken_token_key" ON "VerificationToken"("token"); - --- CreateIndex -CREATE UNIQUE INDEX "VerificationToken_identifier_token_key" ON "VerificationToken"("identifier", "token"); - --- CreateIndex -CREATE INDEX "Member_orgId_idx" ON "Member"("orgId"); - --- CreateIndex -CREATE UNIQUE INDEX "Member_userId_orgId_key" ON "Member"("userId", "orgId"); diff --git a/prisma/migrations/20240113061544_company_and_associated_schema_changes/migration.sql b/prisma/migrations/20240113061544_company_and_associated_schema_changes/migration.sql deleted file mode 100644 index 1d5763790..000000000 --- a/prisma/migrations/20240113061544_company_and_associated_schema_changes/migration.sql +++ /dev/null @@ -1,60 +0,0 @@ -/* - Warnings: - - - You are about to drop the `Member` table. If the table is not empty, all the data it contains will be lost. - - You are about to drop the `Org` table. If the table is not empty, all the data it contains will be lost. - -*/ --- CreateEnum -CREATE TYPE "MEMBERHIP_STATUS" AS ENUM ('PENDING', 'ACCEPTED', 'DECLINED'); - --- CreateEnum -CREATE TYPE "MEMBERSHIP_ACCESS" AS ENUM ('READ', 'WRITE', 'ADMIN'); - --- DropTable -DROP TABLE "Member"; - --- DropTable -DROP TABLE "Org"; - --- DropEnum -DROP TYPE "AccessEnum"; - --- CreateTable -CREATE TABLE "Company" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "incorporationType" TEXT NOT NULL, - "incorporationDate" TIMESTAMP(3) NOT NULL, - "incorporationCountry" TEXT NOT NULL, - "incorporationState" TEXT NOT NULL, - "streetAddress" TEXT NOT NULL, - "city" TEXT NOT NULL, - "state" TEXT NOT NULL, - "zipcode" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Company_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Membership" ( - "id" TEXT NOT NULL, - "title" TEXT, - "active" BOOLEAN NOT NULL DEFAULT true, - "status" "MEMBERHIP_STATUS" NOT NULL DEFAULT 'PENDING', - "access" "MEMBERSHIP_ACCESS" NOT NULL DEFAULT 'READ', - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - "userId" TEXT, - "companyId" TEXT, - - CONSTRAINT "Membership_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "Membership_companyId_idx" ON "Membership"("companyId"); - --- CreateIndex -CREATE UNIQUE INDEX "Membership_userId_companyId_key" ON "Membership"("userId", "companyId"); diff --git a/prisma/migrations/20240114024759_add_onboarding_fields/migration.sql b/prisma/migrations/20240114024759_add_onboarding_fields/migration.sql deleted file mode 100644 index 8bb9a45da..000000000 --- a/prisma/migrations/20240114024759_add_onboarding_fields/migration.sql +++ /dev/null @@ -1,10 +0,0 @@ -/* - Warnings: - - - Made the column `companyId` on table `Membership` required. This step will fail if there are existing NULL values in that column. - -*/ --- AlterTable -ALTER TABLE "Membership" ADD COLUMN "isOnboarded" BOOLEAN NOT NULL DEFAULT false, -ADD COLUMN "lastAccessed" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, -ALTER COLUMN "companyId" SET NOT NULL; diff --git a/prisma/migrations/20240117213425_add_invited_email/migration.sql b/prisma/migrations/20240117213425_add_invited_email/migration.sql deleted file mode 100644 index 05ced1a77..000000000 --- a/prisma/migrations/20240117213425_add_invited_email/migration.sql +++ /dev/null @@ -1,18 +0,0 @@ -/* - Warnings: - - - A unique constraint covering the columns `[companyId,invitedEmail]` on the table `Membership` will be added. If there are existing duplicate values, this will fail. - - A unique constraint covering the columns `[userId]` on the table `Membership` will be added. If there are existing duplicate values, this will fail. - -*/ --- DropIndex -DROP INDEX "Membership_userId_companyId_key"; - --- AlterTable -ALTER TABLE "Membership" ADD COLUMN "invitedEmail" TEXT; - --- CreateIndex -CREATE UNIQUE INDEX "Membership_companyId_invitedEmail_key" ON "Membership"("companyId", "invitedEmail"); - --- CreateIndex -CREATE UNIQUE INDEX "Membership_userId_key" ON "Membership"("userId"); diff --git a/prisma/migrations/20240121190638_audit/migration.sql b/prisma/migrations/20240121190638_audit/migration.sql deleted file mode 100644 index 21ad07ed8..000000000 --- a/prisma/migrations/20240121190638_audit/migration.sql +++ /dev/null @@ -1,11 +0,0 @@ --- CreateTable -CREATE TABLE "Audit" ( - "id" TEXT NOT NULL, - "action" TEXT NOT NULL, - "occurredAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "actor" JSONB NOT NULL, - "target" JSONB[], - "context" JSONB NOT NULL, - - CONSTRAINT "Audit_pkey" PRIMARY KEY ("id") -); diff --git a/prisma/migrations/20240123073934_add_company_association_for_audit/migration.sql b/prisma/migrations/20240123073934_add_company_association_for_audit/migration.sql deleted file mode 100644 index 7292722fd..000000000 --- a/prisma/migrations/20240123073934_add_company_association_for_audit/migration.sql +++ /dev/null @@ -1,11 +0,0 @@ -/* - Warnings: - - - Added the required column `companyId` to the `Audit` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "Audit" ADD COLUMN "companyId" TEXT NOT NULL; - --- CreateIndex -CREATE INDEX "Audit_companyId_idx" ON "Audit"("companyId"); diff --git a/prisma/migrations/20240123080419_add_public_field_for_company/migration.sql b/prisma/migrations/20240123080419_add_public_field_for_company/migration.sql deleted file mode 100644 index e01178788..000000000 --- a/prisma/migrations/20240123080419_add_public_field_for_company/migration.sql +++ /dev/null @@ -1,12 +0,0 @@ -/* - Warnings: - - - A unique constraint covering the columns `[publicId]` on the table `Company` will be added. If there are existing duplicate values, this will fail. - - Added the required column `publicId` to the `Company` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "Company" ADD COLUMN "publicId" TEXT NOT NULL; - --- CreateIndex -CREATE UNIQUE INDEX "Company_publicId_key" ON "Company"("publicId"); diff --git a/prisma/migrations/20240123095815_remove_userid_unique_from_membership/migration.sql b/prisma/migrations/20240123095815_remove_userid_unique_from_membership/migration.sql deleted file mode 100644 index e4bef7fdb..000000000 --- a/prisma/migrations/20240123095815_remove_userid_unique_from_membership/migration.sql +++ /dev/null @@ -1,5 +0,0 @@ --- DropIndex -DROP INDEX "Membership_userId_key"; - --- CreateIndex -CREATE INDEX "Membership_userId_idx" ON "Membership"("userId"); diff --git a/prisma/migrations/20240124024329_/migration.sql b/prisma/migrations/20240124024329_/migration.sql deleted file mode 100644 index 04aa62483..000000000 --- a/prisma/migrations/20240124024329_/migration.sql +++ /dev/null @@ -1,32 +0,0 @@ -/* - Warnings: - - - The values [PENDING,ACCEPTED,DECLINED] on the enum `MEMBERHIP_STATUS` will be removed. If these variants are still used in the database, this will fail. - - The values [READ,WRITE,ADMIN] on the enum `MEMBERSHIP_ACCESS` will be removed. If these variants are still used in the database, this will fail. - -*/ --- AlterEnum -BEGIN; -CREATE TYPE "MEMBERHIP_STATUS_new" AS ENUM ('pending', 'accepted', 'declined'); -ALTER TABLE "Membership" ALTER COLUMN "status" DROP DEFAULT; -ALTER TABLE "Membership" ALTER COLUMN "status" TYPE "MEMBERHIP_STATUS_new" USING ("status"::text::"MEMBERHIP_STATUS_new"); -ALTER TYPE "MEMBERHIP_STATUS" RENAME TO "MEMBERHIP_STATUS_old"; -ALTER TYPE "MEMBERHIP_STATUS_new" RENAME TO "MEMBERHIP_STATUS"; -DROP TYPE "MEMBERHIP_STATUS_old"; -ALTER TABLE "Membership" ALTER COLUMN "status" SET DEFAULT 'pending'; -COMMIT; - --- AlterEnum -BEGIN; -CREATE TYPE "MEMBERSHIP_ACCESS_new" AS ENUM ('admin', 'stakeholder'); -ALTER TABLE "Membership" ALTER COLUMN "access" DROP DEFAULT; -ALTER TABLE "Membership" ALTER COLUMN "access" TYPE "MEMBERSHIP_ACCESS_new" USING ("access"::text::"MEMBERSHIP_ACCESS_new"); -ALTER TYPE "MEMBERSHIP_ACCESS" RENAME TO "MEMBERSHIP_ACCESS_old"; -ALTER TYPE "MEMBERSHIP_ACCESS_new" RENAME TO "MEMBERSHIP_ACCESS"; -DROP TYPE "MEMBERSHIP_ACCESS_old"; -ALTER TABLE "Membership" ALTER COLUMN "access" SET DEFAULT 'stakeholder'; -COMMIT; - --- AlterTable -ALTER TABLE "Membership" ALTER COLUMN "status" SET DEFAULT 'pending', -ALTER COLUMN "access" SET DEFAULT 'stakeholder'; diff --git a/prisma/migrations/20240126184544_update_migration/migration.sql b/prisma/migrations/20240126184544_update_migration/migration.sql deleted file mode 100644 index 5d5829bb0..000000000 --- a/prisma/migrations/20240126184544_update_migration/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- CreateIndex -CREATE INDEX "Membership_status_idx" ON "Membership"("status"); diff --git a/prisma/migrations/20240126192007_idx_member_status/migration.sql b/prisma/migrations/20240126192007_idx_member_status/migration.sql deleted file mode 100644 index fde787078..000000000 --- a/prisma/migrations/20240126192007_idx_member_status/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- DropIndex -DROP INDEX "Membership_status_idx"; diff --git a/prisma/migrations/20240126203821_missing_migration/migration.sql b/prisma/migrations/20240126203821_missing_migration/migration.sql deleted file mode 100644 index 5d5829bb0..000000000 --- a/prisma/migrations/20240126203821_missing_migration/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- CreateIndex -CREATE INDEX "Membership_status_idx" ON "Membership"("status"); diff --git a/prisma/migrations/20240203065505_add_summary_for_audit/migration.sql b/prisma/migrations/20240203065505_add_summary_for_audit/migration.sql deleted file mode 100644 index 323ad8703..000000000 --- a/prisma/migrations/20240203065505_add_summary_for_audit/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "Audit" ADD COLUMN "summary" TEXT; diff --git a/prisma/migrations/20240204035614_add_share_class_and_equity_plan/migration.sql b/prisma/migrations/20240204035614_add_share_class_and_equity_plan/migration.sql deleted file mode 100644 index 4abb03fd3..000000000 --- a/prisma/migrations/20240204035614_add_share_class_and_equity_plan/migration.sql +++ /dev/null @@ -1,57 +0,0 @@ --- CreateEnum -CREATE TYPE "ShareTypeEnum" AS ENUM ('common', 'preferred'); - --- CreateEnum -CREATE TYPE "SharePrefixEnum" AS ENUM ('CS', 'PS'); - --- CreateEnum -CREATE TYPE "CancellationBehaviorEnum" AS ENUM ('RETIRE', 'RETURN_TO_POOL', 'HOLD_AS_CAPITAL_STOCK', 'DEFINED_PER_PLAN_SECURITY'); - --- CreateTable -CREATE TABLE "ShareClass" ( - "id" TEXT NOT NULL, - "idx" TEXT NOT NULL, - "name" TEXT NOT NULL, - "classType" "ShareTypeEnum" NOT NULL DEFAULT 'common', - "prefix" "SharePrefixEnum" NOT NULL DEFAULT 'CS', - "initialSharesAuthorized" BIGINT NOT NULL, - "boardApprovalDate" TIMESTAMP(3) NOT NULL, - "stockholderApprovalDate" TIMESTAMP(3) NOT NULL, - "votesPerShare" INTEGER NOT NULL, - "parValue" DOUBLE PRECISION NOT NULL, - "pricePerShare" DOUBLE PRECISION NOT NULL, - "seniority" INTEGER NOT NULL, - "conversionRights" JSONB NOT NULL DEFAULT '{"convertsToFutureRound": null,"convertsToStockClassId": null}', - "liquidationPreferenceMultiple" DOUBLE PRECISION NOT NULL, - "participationCapMultiple" DOUBLE PRECISION NOT NULL, - "companyId" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "ShareClass_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "EquityPlan" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "boardApprovalDate" TIMESTAMP(3) NOT NULL, - "initialSharesReserved" BIGINT NOT NULL, - "defaultCancellatonBehavior" "CancellationBehaviorEnum" NOT NULL, - "comments" JSONB NOT NULL DEFAULT '[]', - "companyId" TEXT NOT NULL, - "shareClassId" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "EquityPlan_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "ShareClass_companyId_idx" ON "ShareClass"("companyId"); - --- CreateIndex -CREATE INDEX "EquityPlan_shareClassId_idx" ON "EquityPlan"("shareClassId"); - --- CreateIndex -CREATE INDEX "EquityPlan_companyId_idx" ON "EquityPlan"("companyId"); diff --git a/prisma/migrations/20240206030218_fix_invite_migration/migration.sql b/prisma/migrations/20240206030218_fix_invite_migration/migration.sql deleted file mode 100644 index e63e1aae1..000000000 --- a/prisma/migrations/20240206030218_fix_invite_migration/migration.sql +++ /dev/null @@ -1,17 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `invitedEmail` on the `Membership` table. All the data in the column will be lost. - - A unique constraint covering the columns `[companyId,userId]` on the table `Membership` will be added. If there are existing duplicate values, this will fail. - - Made the column `userId` on table `Membership` required. This step will fail if there are existing NULL values in that column. - -*/ --- DropIndex -DROP INDEX "Membership_companyId_invitedEmail_key"; - --- AlterTable -ALTER TABLE "Membership" DROP COLUMN "invitedEmail", -ALTER COLUMN "userId" SET NOT NULL; - --- CreateIndex -CREATE UNIQUE INDEX "Membership_companyId_userId_key" ON "Membership"("companyId", "userId"); diff --git a/prisma/migrations/20240206032010_add_missing_migration/migration.sql b/prisma/migrations/20240206032010_add_missing_migration/migration.sql deleted file mode 100644 index 11b69bb23..000000000 --- a/prisma/migrations/20240206032010_add_missing_migration/migration.sql +++ /dev/null @@ -1,12 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `conversionRights` on the `ShareClass` table. All the data in the column will be lost. - - Added the required column `convertsToFutureRound` to the `ShareClass` table without a default value. This is not possible if the table is not empty. - - Added the required column `convertsToShareClassId` to the `ShareClass` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "ShareClass" DROP COLUMN "conversionRights", -ADD COLUMN "convertsToFutureRound" BOOLEAN NOT NULL, -ADD COLUMN "convertsToShareClassId" TEXT NOT NULL; diff --git a/prisma/migrations/20240206042707_update_share_class_conversion_rights/migration.sql b/prisma/migrations/20240206042707_update_share_class_conversion_rights/migration.sql deleted file mode 100644 index 6e2236dec..000000000 --- a/prisma/migrations/20240206042707_update_share_class_conversion_rights/migration.sql +++ /dev/null @@ -1,12 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `convertsToFutureRound` on the `ShareClass` table. All the data in the column will be lost. - -*/ --- CreateEnum -CREATE TYPE "ConversionRightsEnum" AS ENUM ('convertsToFutureRound', 'convertsToShareClassId'); - --- AlterTable -ALTER TABLE "ShareClass" DROP COLUMN "convertsToFutureRound", -ADD COLUMN "conversionRights" "ConversionRightsEnum" NOT NULL DEFAULT 'convertsToFutureRound'; diff --git a/prisma/migrations/20240206230113_update_share_class_migration/migration.sql b/prisma/migrations/20240206230113_update_share_class_migration/migration.sql deleted file mode 100644 index b59b4d59c..000000000 --- a/prisma/migrations/20240206230113_update_share_class_migration/migration.sql +++ /dev/null @@ -1,13 +0,0 @@ -/* - Warnings: - - - A unique constraint covering the columns `[companyId,idx]` on the table `ShareClass` will be added. If there are existing duplicate values, this will fail. - - Changed the type of `idx` on the `ShareClass` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required. - -*/ --- AlterTable -ALTER TABLE "ShareClass" DROP COLUMN "idx", -ADD COLUMN "idx" INTEGER NOT NULL; - --- CreateIndex -CREATE UNIQUE INDEX "ShareClass_companyId_idx_key" ON "ShareClass"("companyId", "idx"); diff --git a/prisma/migrations/20240207035312_optional_converts_to_share_class_id/migration.sql b/prisma/migrations/20240207035312_optional_converts_to_share_class_id/migration.sql deleted file mode 100644 index 4bdfcd087..000000000 --- a/prisma/migrations/20240207035312_optional_converts_to_share_class_id/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "ShareClass" ALTER COLUMN "convertsToShareClassId" DROP NOT NULL; diff --git a/prisma/migrations/20240208060046_add_plan_effective_date/migration.sql b/prisma/migrations/20240208060046_add_plan_effective_date/migration.sql deleted file mode 100644 index 5a0462ee1..000000000 --- a/prisma/migrations/20240208060046_add_plan_effective_date/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "EquityPlan" ADD COLUMN "planEffectiveDate" TIMESTAMP(3); diff --git a/prisma/migrations/20240208062212_convert_comments_to_string/migration.sql b/prisma/migrations/20240208062212_convert_comments_to_string/migration.sql deleted file mode 100644 index 5c14d1cff..000000000 --- a/prisma/migrations/20240208062212_convert_comments_to_string/migration.sql +++ /dev/null @@ -1,4 +0,0 @@ --- AlterTable -ALTER TABLE "EquityPlan" ALTER COLUMN "comments" DROP NOT NULL, -ALTER COLUMN "comments" DROP DEFAULT, -ALTER COLUMN "comments" SET DATA TYPE TEXT; diff --git a/prisma/migrations/20240208081440_add_work_email/migration.sql b/prisma/migrations/20240208081440_add_work_email/migration.sql deleted file mode 100644 index b9edaaeea..000000000 --- a/prisma/migrations/20240208081440_add_work_email/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "Membership" ADD COLUMN "workEmail" TEXT; diff --git a/prisma/migrations/20240213070600_create_document/migration.sql b/prisma/migrations/20240213070600_create_document/migration.sql deleted file mode 100644 index 2d4b528f7..000000000 --- a/prisma/migrations/20240213070600_create_document/migration.sql +++ /dev/null @@ -1,20 +0,0 @@ --- CreateTable -CREATE TABLE "Document" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "type" TEXT NOT NULL, - "size" INTEGER NOT NULL, - "url" TEXT NOT NULL, - "companyId" TEXT NOT NULL, - "uploadedById" TEXT, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Document_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "Document_companyId_idx" ON "Document"("companyId"); - --- CreateIndex -CREATE INDEX "Document_uploadedById_idx" ON "Document"("uploadedById"); diff --git a/prisma/migrations/20240214010015_replace_document_url_with_key/migration.sql b/prisma/migrations/20240214010015_replace_document_url_with_key/migration.sql deleted file mode 100644 index df17309cb..000000000 --- a/prisma/migrations/20240214010015_replace_document_url_with_key/migration.sql +++ /dev/null @@ -1,10 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `url` on the `Document` table. All the data in the column will be lost. - - Added the required column `key` to the `Document` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "Document" DROP COLUMN "url", -ADD COLUMN "key" TEXT NOT NULL; diff --git a/prisma/migrations/20240214190435_modify_document_schema/migration.sql b/prisma/migrations/20240214190435_modify_document_schema/migration.sql deleted file mode 100644 index f8255d0e5..000000000 --- a/prisma/migrations/20240214190435_modify_document_schema/migration.sql +++ /dev/null @@ -1,76 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `uploadedById` on the `Document` table. All the data in the column will be lost. - - A unique constraint covering the columns `[publicId]` on the table `Document` will be added. If there are existing duplicate values, this will fail. - - Added the required column `mimeType` to the `Document` table without a default value. This is not possible if the table is not empty. - - Added the required column `publicId` to the `Document` table without a default value. This is not possible if the table is not empty. - - Added the required column `uploadProvider` to the `Document` table without a default value. This is not possible if the table is not empty. - - Added the required column `uploaderId` to the `Document` table without a default value. This is not possible if the table is not empty. - - Changed the type of `type` on the `Document` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required. - -*/ --- CreateEnum -CREATE TYPE "UploadProviders" AS ENUM ('S3', 'R2'); - --- CreateEnum -CREATE TYPE "DocumentType" AS ENUM ('SAFE', 'EQUITY', 'GENERIC'); - --- CreateEnum -CREATE TYPE "DocumentStatus" AS ENUM ('DRAFT', 'COMPLETED'); - --- CreateEnum -CREATE TYPE "DocumentFieldTypes" AS ENUM ('TEXT', 'TEXT_AREA', 'RADIO', 'CHECK_BOX', 'SIGNATURE', 'DATE', 'DATE_TIME', 'EMAIL'); - --- CreateEnum -CREATE TYPE "DocumentSigningStatus" AS ENUM ('NOT_SIGNED', 'SIGNED'); - --- DropIndex -DROP INDEX "Document_uploadedById_idx"; - --- AlterTable -ALTER TABLE "Document" DROP COLUMN "uploadedById", -ADD COLUMN "mimeType" TEXT NOT NULL, -ADD COLUMN "publicId" TEXT NOT NULL, -ADD COLUMN "status" "DocumentStatus" NOT NULL DEFAULT 'DRAFT', -ADD COLUMN "uploadProvider" "UploadProviders" NOT NULL, -ADD COLUMN "uploaderId" TEXT NOT NULL, -DROP COLUMN "type", -ADD COLUMN "type" "DocumentType" NOT NULL; - --- CreateTable -CREATE TABLE "DocumentFields" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "type" "DocumentFieldTypes" NOT NULL DEFAULT 'TEXT', - "placeholder" TEXT NOT NULL DEFAULT '', - "required" BOOLEAN NOT NULL DEFAULT false, - "documentId" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "DocumentFields_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "DocumentRecepients" ( - "id" TEXT NOT NULL, - "signedStatus" "DocumentSigningStatus" NOT NULL, - "membershipId" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "DocumentRecepients_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "DocumentFields_documentId_idx" ON "DocumentFields"("documentId"); - --- CreateIndex -CREATE INDEX "DocumentRecepients_membershipId_idx" ON "DocumentRecepients"("membershipId"); - --- CreateIndex -CREATE INDEX "Document_uploaderId_idx" ON "Document"("uploaderId"); - --- CreateIndex -CREATE UNIQUE INDEX "Document_publicId_key" ON "Document"("publicId"); diff --git a/prisma/migrations/20240215144007_add_bucket_and_template_models/migration.sql b/prisma/migrations/20240215144007_add_bucket_and_template_models/migration.sql deleted file mode 100644 index 439f84796..000000000 --- a/prisma/migrations/20240215144007_add_bucket_and_template_models/migration.sql +++ /dev/null @@ -1,128 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `key` on the `Document` table. All the data in the column will be lost. - - You are about to drop the column `mimeType` on the `Document` table. All the data in the column will be lost. - - You are about to drop the column `size` on the `Document` table. All the data in the column will be lost. - - You are about to drop the column `status` on the `Document` table. All the data in the column will be lost. - - You are about to drop the column `type` on the `Document` table. All the data in the column will be lost. - - You are about to drop the column `uploadProvider` on the `Document` table. All the data in the column will be lost. - - You are about to drop the `DocumentFields` table. If the table is not empty, all the data it contains will be lost. - - You are about to drop the `DocumentRecepients` table. If the table is not empty, all the data it contains will be lost. - - Added the required column `bucketId` to the `Document` table without a default value. This is not possible if the table is not empty. - -*/ --- CreateEnum -CREATE TYPE "FieldTypes" AS ENUM ('text', 'textArea', 'radio', 'checkBox', 'signature', 'date', 'dateTime', 'email'); - --- CreateEnum -CREATE TYPE "TemplateStatus" AS ENUM ('draft', 'completed'); - --- CreateEnum -CREATE TYPE "EsignRecipientStatus" AS ENUM ('notSigned', 'signed'); - --- AlterTable -ALTER TABLE "Document" DROP COLUMN "key", -DROP COLUMN "mimeType", -DROP COLUMN "size", -DROP COLUMN "status", -DROP COLUMN "type", -DROP COLUMN "uploadProvider", -ADD COLUMN "bucketId" TEXT NOT NULL; - --- DropTable -DROP TABLE "DocumentFields"; - --- DropTable -DROP TABLE "DocumentRecepients"; - --- DropEnum -DROP TYPE "DocumentFieldTypes"; - --- DropEnum -DROP TYPE "DocumentSigningStatus"; - --- DropEnum -DROP TYPE "DocumentStatus"; - --- DropEnum -DROP TYPE "DocumentType"; - --- DropEnum -DROP TYPE "UploadProviders"; - --- CreateTable -CREATE TABLE "Bucket" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "key" TEXT NOT NULL, - "mimeType" TEXT NOT NULL, - "size" INTEGER NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Bucket_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "TemplateField" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "type" "FieldTypes" NOT NULL DEFAULT 'text', - "placeholder" TEXT NOT NULL DEFAULT '', - "required" BOOLEAN NOT NULL DEFAULT false, - "positionX" DECIMAL(65,30) NOT NULL, - "positionY" DECIMAL(65,30) NOT NULL, - "width" DECIMAL(65,30) NOT NULL, - "height" DECIMAL(65,30) NOT NULL, - "templateId" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "TemplateField_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Template" ( - "id" TEXT NOT NULL, - "publicId" TEXT NOT NULL, - "name" TEXT NOT NULL, - "status" "TemplateStatus" NOT NULL DEFAULT 'draft', - "bucketId" TEXT NOT NULL, - "uploaderId" TEXT NOT NULL, - "companyId" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Template_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "EsignRecipient" ( - "id" TEXT NOT NULL, - "email" TEXT, - "status" "EsignRecipientStatus" NOT NULL, - "membershipId" TEXT, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "EsignRecipient_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "TemplateField_templateId_idx" ON "TemplateField"("templateId"); - --- CreateIndex -CREATE INDEX "Template_bucketId_idx" ON "Template"("bucketId"); - --- CreateIndex -CREATE INDEX "Template_uploaderId_idx" ON "Template"("uploaderId"); - --- CreateIndex -CREATE INDEX "Template_companyId_idx" ON "Template"("companyId"); - --- CreateIndex -CREATE INDEX "EsignRecipient_membershipId_idx" ON "EsignRecipient"("membershipId"); - --- CreateIndex -CREATE INDEX "Document_bucketId_idx" ON "Document"("bucketId"); diff --git a/prisma/migrations/20240215153900_add_new_fields/migration.sql b/prisma/migrations/20240215153900_add_new_fields/migration.sql deleted file mode 100644 index 4ad2a3982..000000000 --- a/prisma/migrations/20240215153900_add_new_fields/migration.sql +++ /dev/null @@ -1,15 +0,0 @@ -/* - Warnings: - - - Added the required column `verificationTokenToken` to the `EsignRecipient` table without a default value. This is not possible if the table is not empty. - - Added the required column `order` to the `TemplateField` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "EsignRecipient" ADD COLUMN "verificationTokenToken" TEXT NOT NULL; - --- AlterTable -ALTER TABLE "TemplateField" ADD COLUMN "order" INTEGER NOT NULL; - --- CreateIndex -CREATE INDEX "EsignRecipient_verificationTokenToken_idx" ON "EsignRecipient"("verificationTokenToken"); diff --git a/prisma/migrations/20240216224520_update_db_schema_and_enums/migration.sql b/prisma/migrations/20240216224520_update_db_schema_and_enums/migration.sql deleted file mode 100644 index 8ca8884c9..000000000 --- a/prisma/migrations/20240216224520_update_db_schema_and_enums/migration.sql +++ /dev/null @@ -1,123 +0,0 @@ -/* - Warnings: - - - The values [convertsToFutureRound,convertsToShareClassId] on the enum `ConversionRightsEnum` will be removed. If these variants are still used in the database, this will fail. - - The values [notSigned,signed] on the enum `EsignRecipientStatus` will be removed. If these variants are still used in the database, this will fail. - - The values [text,textArea,radio,checkBox,signature,date,dateTime,email] on the enum `FieldTypes` will be removed. If these variants are still used in the database, this will fail. - - The values [pending,accepted,declined] on the enum `MEMBERHIP_STATUS` will be removed. If these variants are still used in the database, this will fail. - - The values [admin,stakeholder] on the enum `MEMBERSHIP_ACCESS` will be removed. If these variants are still used in the database, this will fail. - - The values [common,preferred] on the enum `ShareTypeEnum` will be removed. If these variants are still used in the database, this will fail. - - The values [draft,completed] on the enum `TemplateStatus` will be removed. If these variants are still used in the database, this will fail. - - You are about to drop the column `verificationTokenToken` on the `EsignRecipient` table. All the data in the column will be lost. - -*/ --- CreateEnum -CREATE TYPE "StakeholderTypeEnum" AS ENUM ('INDIVIDUAL', 'INSTITUTION'); - --- AlterEnum -BEGIN; -CREATE TYPE "ConversionRightsEnum_new" AS ENUM ('CONVERTS_TO_FUTURE_ROUND', 'CONVERTS_TO_SHARE_CLASS_ID'); -ALTER TABLE "ShareClass" ALTER COLUMN "conversionRights" DROP DEFAULT; -ALTER TABLE "ShareClass" ALTER COLUMN "conversionRights" TYPE "ConversionRightsEnum_new" USING ("conversionRights"::text::"ConversionRightsEnum_new"); -ALTER TYPE "ConversionRightsEnum" RENAME TO "ConversionRightsEnum_old"; -ALTER TYPE "ConversionRightsEnum_new" RENAME TO "ConversionRightsEnum"; -DROP TYPE "ConversionRightsEnum_old"; -ALTER TABLE "ShareClass" ALTER COLUMN "conversionRights" SET DEFAULT 'CONVERTS_TO_FUTURE_ROUND'; -COMMIT; - --- AlterEnum -BEGIN; -CREATE TYPE "EsignRecipientStatus_new" AS ENUM ('SENT', 'SIGNED', 'PENDING'); -ALTER TABLE "EsignRecipient" ALTER COLUMN "status" TYPE "EsignRecipientStatus_new" USING ("status"::text::"EsignRecipientStatus_new"); -ALTER TYPE "EsignRecipientStatus" RENAME TO "EsignRecipientStatus_old"; -ALTER TYPE "EsignRecipientStatus_new" RENAME TO "EsignRecipientStatus"; -DROP TYPE "EsignRecipientStatus_old"; -COMMIT; - --- AlterEnum -BEGIN; -CREATE TYPE "FieldTypes_new" AS ENUM ('TEXT', 'RADIO', 'EMAIL', 'DATE', 'DATETIME', 'TEXTAREA', 'CHECKBOX', 'SIGNATURE'); -ALTER TABLE "TemplateField" ALTER COLUMN "type" DROP DEFAULT; -ALTER TABLE "TemplateField" ALTER COLUMN "type" TYPE "FieldTypes_new" USING ("type"::text::"FieldTypes_new"); -ALTER TYPE "FieldTypes" RENAME TO "FieldTypes_old"; -ALTER TYPE "FieldTypes_new" RENAME TO "FieldTypes"; -DROP TYPE "FieldTypes_old"; -ALTER TABLE "TemplateField" ALTER COLUMN "type" SET DEFAULT 'TEXT'; -COMMIT; - --- AlterEnum -BEGIN; -CREATE TYPE "MEMBERHIP_STATUS_new" AS ENUM ('PENDING', 'ACCEPTED', 'DECLINED'); -ALTER TABLE "Membership" ALTER COLUMN "status" DROP DEFAULT; -ALTER TABLE "Membership" ALTER COLUMN "status" TYPE "MEMBERHIP_STATUS_new" USING ("status"::text::"MEMBERHIP_STATUS_new"); -ALTER TYPE "MEMBERHIP_STATUS" RENAME TO "MEMBERHIP_STATUS_old"; -ALTER TYPE "MEMBERHIP_STATUS_new" RENAME TO "MEMBERHIP_STATUS"; -DROP TYPE "MEMBERHIP_STATUS_old"; -ALTER TABLE "Membership" ALTER COLUMN "status" SET DEFAULT 'PENDING'; -COMMIT; - --- AlterEnum -BEGIN; -CREATE TYPE "MEMBERSHIP_ACCESS_new" AS ENUM ('ADMIN', 'STAKEHOLDER'); -ALTER TABLE "Membership" ALTER COLUMN "access" DROP DEFAULT; -ALTER TABLE "Membership" ALTER COLUMN "access" TYPE "MEMBERSHIP_ACCESS_new" USING ("access"::text::"MEMBERSHIP_ACCESS_new"); -ALTER TYPE "MEMBERSHIP_ACCESS" RENAME TO "MEMBERSHIP_ACCESS_old"; -ALTER TYPE "MEMBERSHIP_ACCESS_new" RENAME TO "MEMBERSHIP_ACCESS"; -DROP TYPE "MEMBERSHIP_ACCESS_old"; -ALTER TABLE "Membership" ALTER COLUMN "access" SET DEFAULT 'ADMIN'; -COMMIT; - --- AlterEnum -BEGIN; -CREATE TYPE "ShareTypeEnum_new" AS ENUM ('COMMON', 'PREFERRED'); -ALTER TABLE "ShareClass" ALTER COLUMN "classType" DROP DEFAULT; -ALTER TABLE "ShareClass" ALTER COLUMN "classType" TYPE "ShareTypeEnum_new" USING ("classType"::text::"ShareTypeEnum_new"); -ALTER TYPE "ShareTypeEnum" RENAME TO "ShareTypeEnum_old"; -ALTER TYPE "ShareTypeEnum_new" RENAME TO "ShareTypeEnum"; -DROP TYPE "ShareTypeEnum_old"; -ALTER TABLE "ShareClass" ALTER COLUMN "classType" SET DEFAULT 'COMMON'; -COMMIT; - --- AlterEnum -BEGIN; -CREATE TYPE "TemplateStatus_new" AS ENUM ('DRAFT', 'COMPLETE'); -ALTER TABLE "Template" ALTER COLUMN "status" DROP DEFAULT; -ALTER TABLE "Template" ALTER COLUMN "status" TYPE "TemplateStatus_new" USING ("status"::text::"TemplateStatus_new"); -ALTER TYPE "TemplateStatus" RENAME TO "TemplateStatus_old"; -ALTER TYPE "TemplateStatus_new" RENAME TO "TemplateStatus"; -DROP TYPE "TemplateStatus_old"; -ALTER TABLE "Template" ALTER COLUMN "status" SET DEFAULT 'DRAFT'; -COMMIT; - --- DropIndex -DROP INDEX "EsignRecipient_verificationTokenToken_idx"; - --- AlterTable -ALTER TABLE "EsignRecipient" DROP COLUMN "verificationTokenToken", -ALTER COLUMN "status" SET DEFAULT 'PENDING'; - --- AlterTable -ALTER TABLE "Membership" ALTER COLUMN "status" SET DEFAULT 'PENDING', -ALTER COLUMN "access" SET DEFAULT 'ADMIN'; - --- AlterTable -ALTER TABLE "ShareClass" ALTER COLUMN "classType" SET DEFAULT 'COMMON', -ALTER COLUMN "conversionRights" SET DEFAULT 'CONVERTS_TO_FUTURE_ROUND'; - --- AlterTable -ALTER TABLE "Template" ALTER COLUMN "status" SET DEFAULT 'DRAFT'; - --- AlterTable -ALTER TABLE "TemplateField" ALTER COLUMN "type" SET DEFAULT 'TEXT'; - --- CreateTable -CREATE TABLE "Stakeholder" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "email" TEXT NOT NULL, - "type" "StakeholderTypeEnum" NOT NULL DEFAULT 'INSTITUTION', - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Stakeholder_pkey" PRIMARY KEY ("id") -); diff --git a/prisma/migrations/20240217134858_rename_position_field/migration.sql b/prisma/migrations/20240217134858_rename_position_field/migration.sql deleted file mode 100644 index 8f709999f..000000000 --- a/prisma/migrations/20240217134858_rename_position_field/migration.sql +++ /dev/null @@ -1,14 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `positionX` on the `TemplateField` table. All the data in the column will be lost. - - You are about to drop the column `positionY` on the `TemplateField` table. All the data in the column will be lost. - - Added the required column `left` to the `TemplateField` table without a default value. This is not possible if the table is not empty. - - Added the required column `top` to the `TemplateField` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "TemplateField" DROP COLUMN "positionX", -DROP COLUMN "positionY", -ADD COLUMN "left" DECIMAL(65,30) NOT NULL, -ADD COLUMN "top" DECIMAL(65,30) NOT NULL; diff --git a/prisma/migrations/20240217135154_remove_order/migration.sql b/prisma/migrations/20240217135154_remove_order/migration.sql deleted file mode 100644 index 765464c7e..000000000 --- a/prisma/migrations/20240217135154_remove_order/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `order` on the `TemplateField` table. All the data in the column will be lost. - -*/ --- AlterTable -ALTER TABLE "TemplateField" DROP COLUMN "order"; diff --git a/prisma/migrations/20240217170744_change_data_type/migration.sql b/prisma/migrations/20240217170744_change_data_type/migration.sql deleted file mode 100644 index 6e96d5d94..000000000 --- a/prisma/migrations/20240217170744_change_data_type/migration.sql +++ /dev/null @@ -1,14 +0,0 @@ -/* - Warnings: - - - You are about to alter the column `width` on the `TemplateField` table. The data in that column could be lost. The data in that column will be cast from `Decimal(65,30)` to `Integer`. - - You are about to alter the column `height` on the `TemplateField` table. The data in that column could be lost. The data in that column will be cast from `Decimal(65,30)` to `Integer`. - - You are about to alter the column `left` on the `TemplateField` table. The data in that column could be lost. The data in that column will be cast from `Decimal(65,30)` to `Integer`. - - You are about to alter the column `top` on the `TemplateField` table. The data in that column could be lost. The data in that column will be cast from `Decimal(65,30)` to `Integer`. - -*/ --- AlterTable -ALTER TABLE "TemplateField" ALTER COLUMN "width" SET DATA TYPE INTEGER, -ALTER COLUMN "height" SET DATA TYPE INTEGER, -ALTER COLUMN "left" SET DATA TYPE INTEGER, -ALTER COLUMN "top" SET DATA TYPE INTEGER; diff --git a/prisma/migrations/20240218214308_add_team_table/migration.sql b/prisma/migrations/20240218214308_add_team_table/migration.sql deleted file mode 100644 index 303a6562d..000000000 --- a/prisma/migrations/20240218214308_add_team_table/migration.sql +++ /dev/null @@ -1,28 +0,0 @@ --- CreateEnum -CREATE TYPE "TeamStatus" AS ENUM ('PENDING', 'ACCEPTED'); - --- CreateTable -CREATE TABLE "Team" ( - "id" TEXT NOT NULL, - "status" "TeamStatus" NOT NULL DEFAULT 'PENDING', - "active" BOOLEAN NOT NULL DEFAULT true, - "isOnboarded" BOOLEAN NOT NULL DEFAULT false, - "userId" TEXT NOT NULL, - "companyId" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - "inviteAt" TIMESTAMP(3), - "acceptedAt" TIMESTAMP(3), - "accessedAt" TIMESTAMP(3), - - CONSTRAINT "Team_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "Team_userId_idx" ON "Team"("userId"); - --- CreateIndex -CREATE INDEX "Team_companyId_idx" ON "Team"("companyId"); - --- CreateIndex -CREATE UNIQUE INDEX "Team_companyId_userId_key" ON "Team"("companyId", "userId"); diff --git a/prisma/migrations/20240218215510_add_title_to_team/migration.sql b/prisma/migrations/20240218215510_add_title_to_team/migration.sql deleted file mode 100644 index 0ac750ab0..000000000 --- a/prisma/migrations/20240218215510_add_title_to_team/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - Added the required column `title` to the `Team` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "Team" ADD COLUMN "title" TEXT NOT NULL; diff --git a/prisma/migrations/20240218230234_update_team_schema/migration.sql b/prisma/migrations/20240218230234_update_team_schema/migration.sql deleted file mode 100644 index 5285c0ac0..000000000 --- a/prisma/migrations/20240218230234_update_team_schema/migration.sql +++ /dev/null @@ -1,20 +0,0 @@ -/* - Warnings: - - - The values [ACCEPTED] on the enum `TeamStatus` will be removed. If these variants are still used in the database, this will fail. - - You are about to drop the column `active` on the `Team` table. All the data in the column will be lost. - -*/ --- AlterEnum -BEGIN; -CREATE TYPE "TeamStatus_new" AS ENUM ('ACTIVE', 'PENDING', 'INACTIVE'); -ALTER TABLE "Team" ALTER COLUMN "status" DROP DEFAULT; -ALTER TABLE "Team" ALTER COLUMN "status" TYPE "TeamStatus_new" USING ("status"::text::"TeamStatus_new"); -ALTER TYPE "TeamStatus" RENAME TO "TeamStatus_old"; -ALTER TYPE "TeamStatus_new" RENAME TO "TeamStatus"; -DROP TYPE "TeamStatus_old"; -ALTER TABLE "Team" ALTER COLUMN "status" SET DEFAULT 'PENDING'; -COMMIT; - --- AlterTable -ALTER TABLE "Team" DROP COLUMN "active"; diff --git a/prisma/migrations/20240218235419_update_enums/migration.sql b/prisma/migrations/20240218235419_update_enums/migration.sql deleted file mode 100644 index b6af0cca6..000000000 --- a/prisma/migrations/20240218235419_update_enums/migration.sql +++ /dev/null @@ -1,34 +0,0 @@ -/* - Warnings: - - - The `status` column on the `Membership` table would be dropped and recreated. This will lead to data loss if there is data in the column. - - The `access` column on the `Membership` table would be dropped and recreated. This will lead to data loss if there is data in the column. - - You are about to drop the `Team` table. If the table is not empty, all the data it contains will be lost. - -*/ --- CreateEnum -CREATE TYPE "MembershipStatusEnum" AS ENUM ('PENDING', 'ACCEPTED', 'DECLINED'); - --- CreateEnum -CREATE TYPE "MembershipAccessEnum" AS ENUM ('ADMIN', 'STAKEHOLDER'); - --- AlterTable -ALTER TABLE "Membership" DROP COLUMN "status", -ADD COLUMN "status" "MembershipStatusEnum" NOT NULL DEFAULT 'PENDING', -DROP COLUMN "access", -ADD COLUMN "access" "MembershipAccessEnum" NOT NULL DEFAULT 'ADMIN'; - --- DropTable -DROP TABLE "Team"; - --- DropEnum -DROP TYPE "MEMBERHIP_STATUS"; - --- DropEnum -DROP TYPE "MEMBERSHIP_ACCESS"; - --- DropEnum -DROP TYPE "TeamStatus"; - --- CreateIndex -CREATE INDEX "Membership_status_idx" ON "Membership"("status"); diff --git a/prisma/migrations/20240219002354_/migration.sql b/prisma/migrations/20240219002354_/migration.sql deleted file mode 100644 index c7afb3e3b..000000000 --- a/prisma/migrations/20240219002354_/migration.sql +++ /dev/null @@ -1,25 +0,0 @@ -/* - Warnings: - - - The values [ACCEPTED,DECLINED] on the enum `MembershipStatusEnum` will be removed. If these variants are still used in the database, this will fail. - - You are about to drop the column `access` on the `Membership` table. All the data in the column will be lost. - - You are about to drop the column `active` on the `Membership` table. All the data in the column will be lost. - -*/ --- AlterEnum -BEGIN; -CREATE TYPE "MembershipStatusEnum_new" AS ENUM ('ACTIVE', 'INACTIVE', 'PENDING'); -ALTER TABLE "Membership" ALTER COLUMN "status" DROP DEFAULT; -ALTER TABLE "Membership" ALTER COLUMN "status" TYPE "MembershipStatusEnum_new" USING ("status"::text::"MembershipStatusEnum_new"); -ALTER TYPE "MembershipStatusEnum" RENAME TO "MembershipStatusEnum_old"; -ALTER TYPE "MembershipStatusEnum_new" RENAME TO "MembershipStatusEnum"; -DROP TYPE "MembershipStatusEnum_old"; -ALTER TABLE "Membership" ALTER COLUMN "status" SET DEFAULT 'PENDING'; -COMMIT; - --- AlterTable -ALTER TABLE "Membership" DROP COLUMN "access", -DROP COLUMN "active"; - --- DropEnum -DROP TYPE "MembershipAccessEnum"; diff --git a/prisma/migrations/20240219083043_rename_membership_to_member/migration.sql b/prisma/migrations/20240219083043_rename_membership_to_member/migration.sql deleted file mode 100644 index a39be9a6a..000000000 --- a/prisma/migrations/20240219083043_rename_membership_to_member/migration.sql +++ /dev/null @@ -1,53 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `membershipId` on the `EsignRecipient` table. All the data in the column will be lost. - - You are about to drop the `Membership` table. If the table is not empty, all the data it contains will be lost. - -*/ --- CreateEnum -CREATE TYPE "MemberStatusEnum" AS ENUM ('ACTIVE', 'INACTIVE', 'PENDING'); - --- DropIndex -DROP INDEX "EsignRecipient_membershipId_idx"; - --- AlterTable -ALTER TABLE "EsignRecipient" DROP COLUMN "membershipId", -ADD COLUMN "memberId" TEXT; - --- DropTable -DROP TABLE "Membership"; - --- DropEnum -DROP TYPE "MembershipStatusEnum"; - --- CreateTable -CREATE TABLE "Member" ( - "id" TEXT NOT NULL, - "title" TEXT, - "status" "MemberStatusEnum" NOT NULL DEFAULT 'PENDING', - "isOnboarded" BOOLEAN NOT NULL DEFAULT false, - "workEmail" TEXT, - "lastAccessed" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - "userId" TEXT NOT NULL, - "companyId" TEXT NOT NULL, - - CONSTRAINT "Member_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "Member_companyId_idx" ON "Member"("companyId"); - --- CreateIndex -CREATE INDEX "Member_status_idx" ON "Member"("status"); - --- CreateIndex -CREATE INDEX "Member_userId_idx" ON "Member"("userId"); - --- CreateIndex -CREATE UNIQUE INDEX "Member_companyId_userId_key" ON "Member"("companyId", "userId"); - --- CreateIndex -CREATE INDEX "EsignRecipient_memberId_idx" ON "EsignRecipient"("memberId"); diff --git a/prisma/migrations/20240222042734_add_stakeholder/migration.sql b/prisma/migrations/20240222042734_add_stakeholder/migration.sql deleted file mode 100644 index 50f04b427..000000000 --- a/prisma/migrations/20240222042734_add_stakeholder/migration.sql +++ /dev/null @@ -1,24 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `type` on the `Stakeholder` table. All the data in the column will be lost. - - Added the required column `companyId` to the `Stakeholder` table without a default value. This is not possible if the table is not empty. - -*/ --- CreateEnum -CREATE TYPE "StakeholderRelationshipEnum" AS ENUM ('ADVISOR', 'BOARD_MEMBER', 'CONSULTANT', 'EMPLOYEE', 'EX_ADVISOR', 'EX_CONSULTANT', 'EX_EMPLOYEE', 'EXECUTIVE', 'FOUNDER', 'INVESTOR', 'NON_US_EMPLOYEE', 'OFFICER', 'OTHER'); - --- AlterTable -ALTER TABLE "Stakeholder" DROP COLUMN "type", -ADD COLUMN "city" TEXT, -ADD COLUMN "companyId" TEXT NOT NULL, -ADD COLUMN "currentRelationship" "StakeholderRelationshipEnum" NOT NULL DEFAULT 'EMPLOYEE', -ADD COLUMN "institutionName" TEXT, -ADD COLUMN "stakeholder_type" "StakeholderTypeEnum" NOT NULL DEFAULT 'INDIVIDUAL', -ADD COLUMN "state" TEXT, -ADD COLUMN "streetAddress" TEXT, -ADD COLUMN "taxId" TEXT, -ADD COLUMN "zipcode" TEXT; - --- CreateIndex -CREATE INDEX "Stakeholder_companyId_idx" ON "Stakeholder"("companyId"); diff --git a/prisma/migrations/20240226162609_add_new_viewport_field/migration.sql b/prisma/migrations/20240226162609_add_new_viewport_field/migration.sql deleted file mode 100644 index d7b508cce..000000000 --- a/prisma/migrations/20240226162609_add_new_viewport_field/migration.sql +++ /dev/null @@ -1,10 +0,0 @@ -/* - Warnings: - - - Added the required column `viewportHeight` to the `TemplateField` table without a default value. This is not possible if the table is not empty. - - Added the required column `viewportWidth` to the `TemplateField` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "TemplateField" ADD COLUMN "viewportHeight" INTEGER NOT NULL, -ADD COLUMN "viewportWidth" INTEGER NOT NULL; diff --git a/prisma/migrations/20240227052735_create_investment_table/migration.sql b/prisma/migrations/20240227052735_create_investment_table/migration.sql deleted file mode 100644 index cdd7fb820..000000000 --- a/prisma/migrations/20240227052735_create_investment_table/migration.sql +++ /dev/null @@ -1,24 +0,0 @@ --- CreateTable -CREATE TABLE "Investment" ( - "id" TEXT NOT NULL, - "amount" DOUBLE PRECISION NOT NULL, - "shares" BIGINT NOT NULL, - "date" TIMESTAMP(3) NOT NULL, - "comments" TEXT, - "shareClassId" TEXT NOT NULL, - "companyId" TEXT NOT NULL, - "stakeholderId" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Investment_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "Investment_companyId_idx" ON "Investment"("companyId"); - --- CreateIndex -CREATE INDEX "Investment_stakeholderId_idx" ON "Investment"("stakeholderId"); - --- CreateIndex -CREATE INDEX "Investment_shareClassId_idx" ON "Investment"("shareClassId"); diff --git a/prisma/migrations/20240228095749_add_page_field/migration.sql b/prisma/migrations/20240228095749_add_page_field/migration.sql deleted file mode 100644 index 1d563b811..000000000 --- a/prisma/migrations/20240228095749_add_page_field/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - Added the required column `page` to the `TemplateField` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "TemplateField" ADD COLUMN "page" INTEGER NOT NULL; diff --git a/prisma/migrations/20240301064354_update_stakeholder/migration.sql b/prisma/migrations/20240301064354_update_stakeholder/migration.sql deleted file mode 100644 index cb2bf2cd7..000000000 --- a/prisma/migrations/20240301064354_update_stakeholder/migration.sql +++ /dev/null @@ -1,13 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `stakeholder_type` on the `Stakeholder` table. All the data in the column will be lost. - - A unique constraint covering the columns `[email]` on the table `Stakeholder` will be added. If there are existing duplicate values, this will fail. - -*/ --- AlterTable -ALTER TABLE "Stakeholder" DROP COLUMN "stakeholder_type", -ADD COLUMN "stakeholderType" "StakeholderTypeEnum" NOT NULL DEFAULT 'INDIVIDUAL'; - --- CreateIndex -CREATE UNIQUE INDEX "Stakeholder_email_key" ON "Stakeholder"("email"); diff --git a/prisma/migrations/20240304075022_remove_waitlist_table/migration.sql b/prisma/migrations/20240304075022_remove_waitlist_table/migration.sql deleted file mode 100644 index 152b88804..000000000 --- a/prisma/migrations/20240304075022_remove_waitlist_table/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - You are about to drop the `WaitlistUser` table. If the table is not empty, all the data it contains will be lost. - -*/ --- DropTable -DROP TABLE "WaitlistUser"; diff --git a/prisma/migrations/20240305033321_create_share/migration.sql b/prisma/migrations/20240305033321_create_share/migration.sql deleted file mode 100644 index c77776a6b..000000000 --- a/prisma/migrations/20240305033321_create_share/migration.sql +++ /dev/null @@ -1,50 +0,0 @@ --- CreateEnum -CREATE TYPE "SecuritiesStatusEnum" AS ENUM ('ACTIVE', 'DRAFT', 'SIGNED', 'PENDING'); - --- CreateEnum -CREATE TYPE "VestingScheduleEnum" AS ENUM ('VESTING_0_0_0', 'VESTING_0_0_1', 'VESTING_4_1_0', 'VESTING_4_1_1', 'VESTING_4_3_1', 'VESTING_4_6_1', 'VESTING_4_12_1'); - --- CreateEnum -CREATE TYPE "ShareLegendsEnum" AS ENUM ('US_SECURITIES_ACT', 'SALE_AND_ROFR', 'TRANSFER_RESTRICTIONS'); - --- AlterTable -ALTER TABLE "Document" ADD COLUMN "shareId" TEXT; - --- CreateTable -CREATE TABLE "Share" ( - "id" TEXT NOT NULL, - "status" "SecuritiesStatusEnum" NOT NULL DEFAULT 'DRAFT', - "notes" TEXT, - "certificateId" TEXT NOT NULL, - "quantity" DOUBLE PRECISION NOT NULL, - "pricePerShare" DOUBLE PRECISION, - "capitalContribution" DOUBLE PRECISION, - "ipContribution" DOUBLE PRECISION, - "debtCancelled" DOUBLE PRECISION, - "otherContributions" DOUBLE PRECISION, - "vestingSchedule" "VestingScheduleEnum" NOT NULL, - "companyLegends" "ShareLegendsEnum"[], - "issueDate" TIMESTAMP(3) NOT NULL, - "rule144Date" TIMESTAMP(3), - "vestingStartDate" TIMESTAMP(3), - "boardApprovalDate" TIMESTAMP(3) NOT NULL, - "stakeholderId" TEXT NOT NULL, - "companyId" TEXT NOT NULL, - "shareClassId" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Share_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "Share_companyId_idx" ON "Share"("companyId"); - --- CreateIndex -CREATE INDEX "Share_shareClassId_idx" ON "Share"("shareClassId"); - --- CreateIndex -CREATE INDEX "Share_stakeholderId_idx" ON "Share"("stakeholderId"); - --- CreateIndex -CREATE INDEX "Document_shareId_idx" ON "Document"("shareId"); diff --git a/prisma/migrations/20240305040106_create_options/migration.sql b/prisma/migrations/20240305040106_create_options/migration.sql deleted file mode 100644 index f73b2c72d..000000000 --- a/prisma/migrations/20240305040106_create_options/migration.sql +++ /dev/null @@ -1,52 +0,0 @@ -/* - Warnings: - - - You are about to alter the column `quantity` on the `Share` table. The data in that column could be lost. The data in that column will be cast from `DoublePrecision` to `Integer`. - -*/ --- CreateEnum -CREATE TYPE "OptionTypeEnum" AS ENUM ('STOCK_OPTION', 'WARRANT'); - --- CreateEnum -CREATE TYPE "OptionStatusEnum" AS ENUM ('DRAFT', 'ACTIVE', 'EXERCISED', 'EXPIRED', 'CANCELLED'); - --- AlterTable -ALTER TABLE "Document" ADD COLUMN "optionId" TEXT; - --- AlterTable -ALTER TABLE "Share" ALTER COLUMN "quantity" SET DATA TYPE INTEGER; - --- CreateTable -CREATE TABLE "Option" ( - "id" TEXT NOT NULL, - "notes" TEXT, - "quantity" INTEGER NOT NULL, - "exercisePrice" DOUBLE PRECISION NOT NULL, - "type" "OptionTypeEnum" NOT NULL, - "status" "OptionStatusEnum" NOT NULL DEFAULT 'DRAFT', - "vestingSchedule" "VestingScheduleEnum" NOT NULL, - "issueDate" TIMESTAMP(3) NOT NULL, - "expirationDate" TIMESTAMP(3) NOT NULL, - "vestingStartDate" TIMESTAMP(3) NOT NULL, - "boardApprovalDate" TIMESTAMP(3) NOT NULL, - "rule144Date" TIMESTAMP(3) NOT NULL, - "stakeholderId" TEXT NOT NULL, - "companyId" TEXT NOT NULL, - "equityPlanId" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Option_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "Option_companyId_idx" ON "Option"("companyId"); - --- CreateIndex -CREATE INDEX "Option_equityPlanId_idx" ON "Option"("equityPlanId"); - --- CreateIndex -CREATE INDEX "Option_stakeholderId_idx" ON "Option"("stakeholderId"); - --- CreateIndex -CREATE INDEX "Document_optionId_idx" ON "Document"("optionId"); diff --git a/prisma/migrations/20240305040535_update_option_types/migration.sql b/prisma/migrations/20240305040535_update_option_types/migration.sql deleted file mode 100644 index 3a3a3c3b9..000000000 --- a/prisma/migrations/20240305040535_update_option_types/migration.sql +++ /dev/null @@ -1,14 +0,0 @@ -/* - Warnings: - - - The values [STOCK_OPTION,WARRANT] on the enum `OptionTypeEnum` will be removed. If these variants are still used in the database, this will fail. - -*/ --- AlterEnum -BEGIN; -CREATE TYPE "OptionTypeEnum_new" AS ENUM ('ISO', 'NSO', 'RSU'); -ALTER TABLE "Option" ALTER COLUMN "type" TYPE "OptionTypeEnum_new" USING ("type"::text::"OptionTypeEnum_new"); -ALTER TYPE "OptionTypeEnum" RENAME TO "OptionTypeEnum_old"; -ALTER TYPE "OptionTypeEnum_new" RENAME TO "OptionTypeEnum"; -DROP TYPE "OptionTypeEnum_old"; -COMMIT; diff --git a/prisma/migrations/20240306212205_add_convertibles/migration.sql b/prisma/migrations/20240306212205_add_convertibles/migration.sql deleted file mode 100644 index 82ad2548c..000000000 --- a/prisma/migrations/20240306212205_add_convertibles/migration.sql +++ /dev/null @@ -1,108 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `notes` on the `Option` table. All the data in the column will be lost. - - You are about to drop the column `notes` on the `Share` table. All the data in the column will be lost. - -*/ --- CreateEnum -CREATE TYPE "SafeTypeEnum" AS ENUM ('PRE_MONEY', 'POST_MONEY', 'UNCAPPED'); - --- CreateEnum -CREATE TYPE "SafeStatusEnum" AS ENUM ('DRAFT', 'ACTIVE', 'PENDING', 'EXPIRED', 'CANCELLED'); - --- CreateEnum -CREATE TYPE "ConvertibleStatusEnum" AS ENUM ('DRAFT', 'ACTIVE', 'PENDING', 'EXPIRED', 'CANCELLED'); - --- CreateEnum -CREATE TYPE "ConvertibleTypeEnum" AS ENUM ('CCD', 'OCD', 'NOTE'); - --- CreateEnum -CREATE TYPE "ConvertibleInterestMethodEnum" AS ENUM ('SIMPLE', 'COMPOUND'); - --- CreateEnum -CREATE TYPE "ConvertibleInterestAccrualEnum" AS ENUM ('DAILY', 'MONTHLY', 'SEMI_ANNUALLY', 'ANNUALLY', 'YEARLY', 'CONTINUOUSLY'); - --- CreateEnum -CREATE TYPE "ConvertibleInterestPaymentScheduleEnum" AS ENUM ('DEFERRED', 'PAY_AT_MATURITY'); - --- AlterTable -ALTER TABLE "Document" ADD COLUMN "convertibleNoteId" TEXT, -ADD COLUMN "safeId" TEXT; - --- AlterTable -ALTER TABLE "Option" DROP COLUMN "notes"; - --- AlterTable -ALTER TABLE "Share" DROP COLUMN "notes"; - --- CreateTable -CREATE TABLE "Safe" ( - "id" TEXT NOT NULL, - "publicId" TEXT NOT NULL, - "type" "SafeTypeEnum" NOT NULL, - "status" "SafeStatusEnum" NOT NULL DEFAULT 'DRAFT', - "capital" DOUBLE PRECISION NOT NULL, - "valuationCap" DOUBLE PRECISION, - "discountRate" DOUBLE PRECISION, - "mfn" BOOLEAN, - "proRata" BOOLEAN, - "additionalTerms" TEXT, - "stakeholderId" TEXT NOT NULL, - "companyId" TEXT NOT NULL, - "issueDate" TIMESTAMP(3) NOT NULL, - "boardApprovalDate" TIMESTAMP(3) NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Safe_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "ConvertibleNote" ( - "id" TEXT NOT NULL, - "publicId" TEXT NOT NULL, - "status" "ConvertibleStatusEnum" NOT NULL DEFAULT 'DRAFT', - "type" "ConvertibleTypeEnum" NOT NULL DEFAULT 'NOTE', - "capital" DOUBLE PRECISION NOT NULL, - "conversionCap" DOUBLE PRECISION, - "discountRate" DOUBLE PRECISION, - "mfn" BOOLEAN, - "additionalTerms" TEXT, - "interestRate" DOUBLE PRECISION, - "interestMethod" "ConvertibleInterestMethodEnum", - "interestAccrual" "ConvertibleInterestAccrualEnum", - "interestPaymentSchedule" "ConvertibleInterestPaymentScheduleEnum", - "stakeholderId" TEXT NOT NULL, - "companyId" TEXT NOT NULL, - "issueDate" TIMESTAMP(3) NOT NULL, - "boardApprovalDate" TIMESTAMP(3) NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "ConvertibleNote_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "Safe_companyId_idx" ON "Safe"("companyId"); - --- CreateIndex -CREATE INDEX "Safe_stakeholderId_idx" ON "Safe"("stakeholderId"); - --- CreateIndex -CREATE UNIQUE INDEX "Safe_publicId_companyId_key" ON "Safe"("publicId", "companyId"); - --- CreateIndex -CREATE INDEX "ConvertibleNote_companyId_idx" ON "ConvertibleNote"("companyId"); - --- CreateIndex -CREATE INDEX "ConvertibleNote_stakeholderId_idx" ON "ConvertibleNote"("stakeholderId"); - --- CreateIndex -CREATE UNIQUE INDEX "ConvertibleNote_publicId_companyId_key" ON "ConvertibleNote"("publicId", "companyId"); - --- CreateIndex -CREATE INDEX "Document_safeId_idx" ON "Document"("safeId"); - --- CreateIndex -CREATE INDEX "Document_convertibleNoteId_idx" ON "Document"("convertibleNoteId"); diff --git a/prisma/migrations/20240313161813_added_grant_id_in_options/migration.sql b/prisma/migrations/20240313161813_added_grant_id_in_options/migration.sql deleted file mode 100644 index a7ae757ff..000000000 --- a/prisma/migrations/20240313161813_added_grant_id_in_options/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - Added the required column `grantId` to the `Option` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "Option" ADD COLUMN "grantId" TEXT NOT NULL; diff --git a/prisma/migrations/20240314200619_unique_grant_id_per_company/migration.sql b/prisma/migrations/20240314200619_unique_grant_id_per_company/migration.sql deleted file mode 100644 index 2000f78f3..000000000 --- a/prisma/migrations/20240314200619_unique_grant_id_per_company/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - A unique constraint covering the columns `[companyId,grantId]` on the table `Option` will be added. If there are existing duplicate values, this will fail. - -*/ --- CreateIndex -CREATE UNIQUE INDEX "Option_companyId_grantId_key" ON "Option"("companyId", "grantId"); diff --git a/prisma/migrations/20240316044930_add_safe_templates/migration.sql b/prisma/migrations/20240316044930_add_safe_templates/migration.sql deleted file mode 100644 index 14e680166..000000000 --- a/prisma/migrations/20240316044930_add_safe_templates/migration.sql +++ /dev/null @@ -1,26 +0,0 @@ -/* - Warnings: - - - The values [UNCAPPED] on the enum `SafeTypeEnum` will be removed. If these variants are still used in the database, this will fail. - - Made the column `mfn` on table `Safe` required. This step will fail if there are existing NULL values in that column. - - Made the column `proRata` on table `Safe` required. This step will fail if there are existing NULL values in that column. - -*/ --- CreateEnum -CREATE TYPE "YCSafeEnum" AS ENUM ('Valuation Cap, no Discount', 'Discount, no Valuation Cap', 'MFN, no Valuation Cap, no Discount', 'Valuation Cap, no Discount, include Pro Rata Rights', 'Discount, no Valuation Cap, include Pro Rata Rights', 'MFN, no Valuation Cap, no Discount, include Pro Rata Rights'); - --- AlterEnum -BEGIN; -CREATE TYPE "SafeTypeEnum_new" AS ENUM ('PRE_MONEY', 'POST_MONEY'); -ALTER TABLE "Safe" ALTER COLUMN "type" TYPE "SafeTypeEnum_new" USING ("type"::text::"SafeTypeEnum_new"); -ALTER TYPE "SafeTypeEnum" RENAME TO "SafeTypeEnum_old"; -ALTER TYPE "SafeTypeEnum_new" RENAME TO "SafeTypeEnum"; -DROP TYPE "SafeTypeEnum_old"; -COMMIT; - --- AlterTable -ALTER TABLE "Safe" ADD COLUMN "ycTemplate" "YCSafeEnum", -ALTER COLUMN "mfn" SET NOT NULL, -ALTER COLUMN "mfn" SET DEFAULT false, -ALTER COLUMN "proRata" SET NOT NULL, -ALTER COLUMN "proRata" SET DEFAULT false; diff --git a/prisma/migrations/20240316054731_make_post_money_default/migration.sql b/prisma/migrations/20240316054731_make_post_money_default/migration.sql deleted file mode 100644 index e96102a75..000000000 --- a/prisma/migrations/20240316054731_make_post_money_default/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "Safe" ALTER COLUMN "type" SET DEFAULT 'POST_MONEY'; diff --git a/prisma/migrations/20240316062444_support_custom_safe_template/migration.sql b/prisma/migrations/20240316062444_support_custom_safe_template/migration.sql deleted file mode 100644 index 45f6764cd..000000000 --- a/prisma/migrations/20240316062444_support_custom_safe_template/migration.sql +++ /dev/null @@ -1,15 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `ycTemplate` on the `Safe` table. All the data in the column will be lost. - -*/ --- CreateEnum -CREATE TYPE "SafeTemplateEnum" AS ENUM ('Valuation Cap, no Discount', 'Discount, no Valuation Cap', 'MFN, no Valuation Cap, no Discount', 'Valuation Cap, no Discount, include Pro Rata Rights', 'Discount, no Valuation Cap, include Pro Rata Rights', 'MFN, no Valuation Cap, no Discount, include Pro Rata Rights', 'Custom'); - --- AlterTable -ALTER TABLE "Safe" DROP COLUMN "ycTemplate", -ADD COLUMN "safeTemplate" "SafeTemplateEnum"; - --- DropEnum -DROP TYPE "YCSafeEnum"; diff --git a/prisma/migrations/20240317081008_add_default_value_and_read_only/migration.sql b/prisma/migrations/20240317081008_add_default_value_and_read_only/migration.sql deleted file mode 100644 index 4e5af4e18..000000000 --- a/prisma/migrations/20240317081008_add_default_value_and_read_only/migration.sql +++ /dev/null @@ -1,10 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `placeholder` on the `TemplateField` table. All the data in the column will be lost. - -*/ --- AlterTable -ALTER TABLE "TemplateField" DROP COLUMN "placeholder", -ADD COLUMN "defaultValue" TEXT NOT NULL DEFAULT '', -ADD COLUMN "readOnly" BOOLEAN NOT NULL DEFAULT false; diff --git a/prisma/migrations/20240319052020_add_default_country/migration.sql b/prisma/migrations/20240319052020_add_default_country/migration.sql deleted file mode 100644 index 4545e2346..000000000 --- a/prisma/migrations/20240319052020_add_default_country/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "Stakeholder" ADD COLUMN "country" TEXT NOT NULL DEFAULT 'US'; diff --git a/prisma/migrations/20240321052430_create_updates/migration.sql b/prisma/migrations/20240321052430_create_updates/migration.sql deleted file mode 100644 index a4327f5a2..000000000 --- a/prisma/migrations/20240321052430_create_updates/migration.sql +++ /dev/null @@ -1,47 +0,0 @@ --- CreateEnum -CREATE TYPE "UpdateEmailStatusEnum" AS ENUM ('SENT', 'PENDING', 'FAILED'); - --- CreateTable -CREATE TABLE "Updates" ( - "id" TEXT NOT NULL, - "publicId" TEXT NOT NULL, - "title" TEXT NOT NULL, - "content" JSONB NOT NULL, - "public" BOOLEAN NOT NULL DEFAULT false, - "companyId" TEXT NOT NULL, - "authorId" TEXT NOT NULL, - "sharedAt" TIMESTAMP(3), - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Updates_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "UpdateRecipient" ( - "id" TEXT NOT NULL, - "stakeholderId" TEXT NOT NULL, - "updateId" TEXT NOT NULL, - "status" "UpdateEmailStatusEnum" NOT NULL DEFAULT 'PENDING', - "sentAt" TIMESTAMP(3), - "readAt" TIMESTAMP(3), - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "UpdateRecipient_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "Updates_publicId_idx" ON "Updates"("publicId"); - --- CreateIndex -CREATE INDEX "Updates_authorId_idx" ON "Updates"("authorId"); - --- CreateIndex -CREATE INDEX "Updates_companyId_idx" ON "Updates"("companyId"); - --- CreateIndex -CREATE INDEX "UpdateRecipient_updateId_idx" ON "UpdateRecipient"("updateId"); - --- CreateIndex -CREATE INDEX "UpdateRecipient_stakeholderId_idx" ON "UpdateRecipient"("stakeholderId"); diff --git a/prisma/migrations/20240321061035_add_html_to_updates/migration.sql b/prisma/migrations/20240321061035_add_html_to_updates/migration.sql deleted file mode 100644 index f7cbd7d31..000000000 --- a/prisma/migrations/20240321061035_add_html_to_updates/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - Added the required column `html` to the `Updates` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "Updates" ADD COLUMN "html" TEXT NOT NULL; diff --git a/prisma/migrations/20240321063823_rename_public_to_is_public/migration.sql b/prisma/migrations/20240321063823_rename_public_to_is_public/migration.sql deleted file mode 100644 index 13257a1f2..000000000 --- a/prisma/migrations/20240321063823_rename_public_to_is_public/migration.sql +++ /dev/null @@ -1,9 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `public` on the `Updates` table. All the data in the column will be lost. - -*/ --- AlterTable -ALTER TABLE "Updates" DROP COLUMN "public", -ADD COLUMN "isPublic" BOOLEAN NOT NULL DEFAULT false; diff --git a/prisma/migrations/20240321064350_rename_updates_to_update/migration.sql b/prisma/migrations/20240321064350_rename_updates_to_update/migration.sql deleted file mode 100644 index a9826ffb7..000000000 --- a/prisma/migrations/20240321064350_rename_updates_to_update/migration.sql +++ /dev/null @@ -1,34 +0,0 @@ -/* - Warnings: - - - You are about to drop the `Updates` table. If the table is not empty, all the data it contains will be lost. - -*/ --- DropTable -DROP TABLE "Updates"; - --- CreateTable -CREATE TABLE "Update" ( - "id" TEXT NOT NULL, - "publicId" TEXT NOT NULL, - "title" TEXT NOT NULL, - "content" JSONB NOT NULL, - "html" TEXT NOT NULL, - "isPublic" BOOLEAN NOT NULL DEFAULT false, - "companyId" TEXT NOT NULL, - "authorId" TEXT NOT NULL, - "sharedAt" TIMESTAMP(3), - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Update_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "Update_publicId_idx" ON "Update"("publicId"); - --- CreateIndex -CREATE INDEX "Update_authorId_idx" ON "Update"("authorId"); - --- CreateIndex -CREATE INDEX "Update_companyId_idx" ON "Update"("companyId"); diff --git a/prisma/migrations/20240322062022_make_public_id_uniq/migration.sql b/prisma/migrations/20240322062022_make_public_id_uniq/migration.sql deleted file mode 100644 index 01a5b6e68..000000000 --- a/prisma/migrations/20240322062022_make_public_id_uniq/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - A unique constraint covering the columns `[publicId]` on the table `Update` will be added. If there are existing duplicate values, this will fail. - -*/ --- CreateIndex -CREATE UNIQUE INDEX "Update_publicId_key" ON "Update"("publicId"); diff --git a/prisma/migrations/20240323033041_add_company_logo/migration.sql b/prisma/migrations/20240323033041_add_company_logo/migration.sql deleted file mode 100644 index 258c08efb..000000000 --- a/prisma/migrations/20240323033041_add_company_logo/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "Company" ADD COLUMN "logo" TEXT; diff --git a/prisma/migrations/20240331065543_update_shared_at_to_sent_at/migration.sql b/prisma/migrations/20240331065543_update_shared_at_to_sent_at/migration.sql deleted file mode 100644 index 1da10eaf8..000000000 --- a/prisma/migrations/20240331065543_update_shared_at_to_sent_at/migration.sql +++ /dev/null @@ -1,9 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `sharedAt` on the `Update` table. All the data in the column will be lost. - -*/ --- AlterTable -ALTER TABLE "Update" DROP COLUMN "sharedAt", -ADD COLUMN "sentAt" TIMESTAMP(3); diff --git a/prisma/migrations/20240401072542_update_status_enum/migration.sql b/prisma/migrations/20240401072542_update_status_enum/migration.sql deleted file mode 100644 index eaad374b8..000000000 --- a/prisma/migrations/20240401072542_update_status_enum/migration.sql +++ /dev/null @@ -1,12 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `isPublic` on the `Update` table. All the data in the column will be lost. - -*/ --- CreateEnum -CREATE TYPE "UpdateStatusEnum" AS ENUM ('DRAFT', 'PUBLIC', 'PRIVATE'); - --- AlterTable -ALTER TABLE "Update" DROP COLUMN "isPublic", -ADD COLUMN "status" "UpdateStatusEnum" NOT NULL DEFAULT 'DRAFT'; diff --git a/prisma/migrations/20240402041757_add_document_share/migration.sql b/prisma/migrations/20240402041757_add_document_share/migration.sql deleted file mode 100644 index 4b7c7c9f3..000000000 --- a/prisma/migrations/20240402041757_add_document_share/migration.sql +++ /dev/null @@ -1,13 +0,0 @@ --- CreateTable -CREATE TABLE "DocumentShare" ( - "id" TEXT NOT NULL, - "link" TEXT NOT NULL, - "expiresAt" TIMESTAMP(3) NOT NULL, - "recipients" JSONB, - "emailProtected" BOOLEAN NOT NULL DEFAULT false, - "documentId" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "DocumentShare_pkey" PRIMARY KEY ("id") -); diff --git a/prisma/migrations/20240402050447_change_recipients_column_in_document_share/migration.sql b/prisma/migrations/20240402050447_change_recipients_column_in_document_share/migration.sql deleted file mode 100644 index 28b77352b..000000000 --- a/prisma/migrations/20240402050447_change_recipients_column_in_document_share/migration.sql +++ /dev/null @@ -1,9 +0,0 @@ -/* - Warnings: - - - The `recipients` column on the `DocumentShare` table would be dropped and recreated. This will lead to data loss if there is data in the column. - -*/ --- AlterTable -ALTER TABLE "DocumentShare" DROP COLUMN "recipients", -ADD COLUMN "recipients" TEXT[] DEFAULT ARRAY[]::TEXT[]; diff --git a/prisma/migrations/20240402050900_change_expires_at_to_link_expires_at_share_document/migration.sql b/prisma/migrations/20240402050900_change_expires_at_to_link_expires_at_share_document/migration.sql deleted file mode 100644 index 4e8bf5b29..000000000 --- a/prisma/migrations/20240402050900_change_expires_at_to_link_expires_at_share_document/migration.sql +++ /dev/null @@ -1,10 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `expiresAt` on the `DocumentShare` table. All the data in the column will be lost. - - Added the required column `linkExpiresAt` to the `DocumentShare` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "DocumentShare" DROP COLUMN "expiresAt", -ADD COLUMN "linkExpiresAt" TIMESTAMP(3) NOT NULL; diff --git a/prisma/migrations/20240407064117_add_public_id_to_document_share_table/migration.sql b/prisma/migrations/20240407064117_add_public_id_to_document_share_table/migration.sql deleted file mode 100644 index 611d333b9..000000000 --- a/prisma/migrations/20240407064117_add_public_id_to_document_share_table/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - Added the required column `publicId` to the `DocumentShare` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "DocumentShare" ADD COLUMN "publicId" TEXT NOT NULL; diff --git a/prisma/migrations/20240412090141_add_missing_index/migration.sql b/prisma/migrations/20240412090141_add_missing_index/migration.sql deleted file mode 100644 index 0be4fb609..000000000 --- a/prisma/migrations/20240412090141_add_missing_index/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- CreateIndex -CREATE INDEX "DocumentShare_documentId_idx" ON "DocumentShare"("documentId"); diff --git a/prisma/migrations/20240412204835_add_dataroom/migration.sql b/prisma/migrations/20240412204835_add_dataroom/migration.sql deleted file mode 100644 index 81793e0c8..000000000 --- a/prisma/migrations/20240412204835_add_dataroom/migration.sql +++ /dev/null @@ -1,52 +0,0 @@ --- CreateTable -CREATE TABLE "DataRoom" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "publicId" TEXT NOT NULL, - "public" BOOLEAN NOT NULL DEFAULT false, - "companyId" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "DataRoom_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "DataRoomDocument" ( - "id" TEXT NOT NULL, - "dataRoomId" TEXT NOT NULL, - "documentId" TEXT NOT NULL, - - CONSTRAINT "DataRoomDocument_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "DataRoomRecipient" ( - "id" TEXT NOT NULL, - "email" TEXT NOT NULL, - "dataRoomId" TEXT NOT NULL, - "stakeholderId" TEXT, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - "expiresAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "DataRoomRecipient_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "DataRoom_companyId_idx" ON "DataRoom"("companyId"); - --- CreateIndex -CREATE UNIQUE INDEX "DataRoom_publicId_key" ON "DataRoom"("publicId"); - --- CreateIndex -CREATE INDEX "DataRoomDocument_dataRoomId_idx" ON "DataRoomDocument"("dataRoomId"); - --- CreateIndex -CREATE INDEX "DataRoomDocument_documentId_idx" ON "DataRoomDocument"("documentId"); - --- CreateIndex -CREATE INDEX "DataRoomRecipient_dataRoomId_idx" ON "DataRoomRecipient"("dataRoomId"); - --- CreateIndex -CREATE INDEX "DataRoomRecipient_stakeholderId_idx" ON "DataRoomRecipient"("stakeholderId"); diff --git a/prisma/migrations/20240414050202_add_website_to_company/migration.sql b/prisma/migrations/20240414050202_add_website_to_company/migration.sql deleted file mode 100644 index 8504ebbc1..000000000 --- a/prisma/migrations/20240414050202_add_website_to_company/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "Company" ADD COLUMN "website" TEXT; diff --git a/prisma/migrations/20240414052328_make_data_room_name_uniq_for_a_company/migration.sql b/prisma/migrations/20240414052328_make_data_room_name_uniq_for_a_company/migration.sql deleted file mode 100644 index 57b437a30..000000000 --- a/prisma/migrations/20240414052328_make_data_room_name_uniq_for_a_company/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - A unique constraint covering the columns `[companyId,name]` on the table `DataRoom` will be added. If there are existing duplicate values, this will fail. - -*/ --- CreateIndex -CREATE UNIQUE INDEX "DataRoom_companyId_name_key" ON "DataRoom"("companyId", "name"); diff --git a/prisma/migrations/20240414065518_add_member_to_data_room/migration.sql b/prisma/migrations/20240414065518_add_member_to_data_room/migration.sql deleted file mode 100644 index f757d5c3a..000000000 --- a/prisma/migrations/20240414065518_add_member_to_data_room/migration.sql +++ /dev/null @@ -1,5 +0,0 @@ --- AlterTable -ALTER TABLE "DataRoomRecipient" ADD COLUMN "memberId" TEXT; - --- CreateIndex -CREATE INDEX "DataRoomRecipient_memberId_idx" ON "DataRoomRecipient"("memberId"); diff --git a/prisma/migrations/20240416074225_data_room_created_timestamp/migration.sql b/prisma/migrations/20240416074225_data_room_created_timestamp/migration.sql deleted file mode 100644 index 26b0539e3..000000000 --- a/prisma/migrations/20240416074225_data_room_created_timestamp/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "DataRoomDocument" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP; diff --git a/prisma/migrations/20240416221402_uniq_data_room_documents/migration.sql b/prisma/migrations/20240416221402_uniq_data_room_documents/migration.sql deleted file mode 100644 index 422d0db93..000000000 --- a/prisma/migrations/20240416221402_uniq_data_room_documents/migration.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - Warnings: - - - A unique constraint covering the columns `[dataRoomId,documentId]` on the table `DataRoomDocument` will be added. If there are existing duplicate values, this will fail. - -*/ --- CreateIndex -CREATE UNIQUE INDEX "DataRoomDocument_dataRoomId_documentId_key" ON "DataRoomDocument"("dataRoomId", "documentId"); diff --git a/prisma/migrations/20240416221945_make_expires_at_optional/migration.sql b/prisma/migrations/20240416221945_make_expires_at_optional/migration.sql deleted file mode 100644 index fc3017385..000000000 --- a/prisma/migrations/20240416221945_make_expires_at_optional/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "DataRoomRecipient" ALTER COLUMN "expiresAt" DROP NOT NULL; diff --git a/prisma/migrations/20240421083719_implement_email_password_login_feature/migration.sql b/prisma/migrations/20240421083719_implement_email_password_login_feature/migration.sql deleted file mode 100644 index 02deccd25..000000000 --- a/prisma/migrations/20240421083719_implement_email_password_login_feature/migration.sql +++ /dev/null @@ -1,28 +0,0 @@ -/* - Warnings: - - - The required column `id` was added to the `VerificationToken` table with a prisma-level default value. This is not possible if the table is not empty. Please add this column as optional, then populate it before making it required. - -*/ --- AlterTable -ALTER TABLE "User" ADD COLUMN "password" TEXT; - --- AlterTable -ALTER TABLE "VerificationToken" ADD COLUMN "id" TEXT NOT NULL, -ADD CONSTRAINT "VerificationToken_pkey" PRIMARY KEY ("id"); - --- CreateTable -CREATE TABLE "PasswordResetToken" ( - "id" TEXT NOT NULL, - "email" TEXT NOT NULL, - "token" TEXT NOT NULL, - "expires" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "PasswordResetToken_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE UNIQUE INDEX "PasswordResetToken_token_key" ON "PasswordResetToken"("token"); - --- CreateIndex -CREATE UNIQUE INDEX "PasswordResetToken_email_token_key" ON "PasswordResetToken"("email", "token"); diff --git a/prisma/migrations/20240427153534_improve_esign_workflow/migration.sql b/prisma/migrations/20240427153534_improve_esign_workflow/migration.sql deleted file mode 100644 index 60e5bdf4a..000000000 --- a/prisma/migrations/20240427153534_improve_esign_workflow/migration.sql +++ /dev/null @@ -1,29 +0,0 @@ -/* - Warnings: - - - Added the required column `templateId` to the `EsignRecipient` table without a default value. This is not possible if the table is not empty. - - Made the column `email` on table `EsignRecipient` required. This step will fail if there are existing NULL values in that column. - - Added the required column `recipientId` to the `TemplateField` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "Document" ALTER COLUMN "uploaderId" DROP NOT NULL; - --- AlterTable -ALTER TABLE "EsignRecipient" ADD COLUMN "name" TEXT, -ADD COLUMN "templateId" TEXT NOT NULL, -ALTER COLUMN "email" SET NOT NULL; - --- AlterTable -ALTER TABLE "Template" ADD COLUMN "completedOn" TIMESTAMP(3), -ADD COLUMN "orderedDelivery" BOOLEAN NOT NULL DEFAULT false; - --- AlterTable -ALTER TABLE "TemplateField" ADD COLUMN "prefilledValue" TEXT, -ADD COLUMN "recipientId" TEXT NOT NULL; - --- CreateIndex -CREATE INDEX "EsignRecipient_templateId_idx" ON "EsignRecipient"("templateId"); - --- CreateIndex -CREATE INDEX "TemplateField_recipientId_idx" ON "TemplateField"("recipientId"); diff --git a/prisma/migrations/20240430070047_update_data_room_recipient/migration.sql b/prisma/migrations/20240430070047_update_data_room_recipient/migration.sql deleted file mode 100644 index e7513dbb6..000000000 --- a/prisma/migrations/20240430070047_update_data_room_recipient/migration.sql +++ /dev/null @@ -1,14 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `expiresAt` on the `DataRoomRecipient` table. All the data in the column will be lost. - - A unique constraint covering the columns `[dataRoomId,email]` on the table `DataRoomRecipient` will be added. If there are existing duplicate values, this will fail. - - Added the required column `name` to the `DataRoomRecipient` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "DataRoomRecipient" DROP COLUMN "expiresAt", -ADD COLUMN "name" TEXT NOT NULL; - --- CreateIndex -CREATE UNIQUE INDEX "DataRoomRecipient_dataRoomId_email_key" ON "DataRoomRecipient"("dataRoomId", "email"); diff --git a/prisma/migrations/20240430070149_make_name_optional/migration.sql b/prisma/migrations/20240430070149_make_name_optional/migration.sql deleted file mode 100644 index 71a57c6f9..000000000 --- a/prisma/migrations/20240430070149_make_name_optional/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "DataRoomRecipient" ALTER COLUMN "name" DROP NOT NULL; diff --git a/prisma/migrations/20240501052622_index_public_id/migration.sql b/prisma/migrations/20240501052622_index_public_id/migration.sql deleted file mode 100644 index 72653cf18..000000000 --- a/prisma/migrations/20240501052622_index_public_id/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- CreateIndex -CREATE INDEX "DataRoom_publicId_idx" ON "DataRoom"("publicId"); diff --git a/prisma/migrations/20240501122457_esign_logs/migration.sql b/prisma/migrations/20240501122457_esign_logs/migration.sql deleted file mode 100644 index ec95bcba7..000000000 --- a/prisma/migrations/20240501122457_esign_logs/migration.sql +++ /dev/null @@ -1,25 +0,0 @@ --- CreateTable -CREATE TABLE "EsignAudit" ( - "id" TEXT NOT NULL, - "companyId" TEXT NOT NULL, - "templateId" TEXT NOT NULL, - "recipientId" TEXT NOT NULL, - "action" TEXT NOT NULL, - "ip" TEXT NOT NULL, - "userAgent" TEXT NOT NULL, - "location" TEXT NOT NULL, - "summary" TEXT NOT NULL, - "occurredAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "EsignAudit_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE INDEX "EsignAudit_companyId_idx" ON "EsignAudit"("companyId"); - --- CreateIndex -CREATE INDEX "EsignAudit_templateId_idx" ON "EsignAudit"("templateId"); - --- CreateIndex -CREATE INDEX "EsignAudit_recipientId_idx" ON "EsignAudit"("recipientId"); diff --git a/prisma/migrations/20240503082232_index_id_and_dataroomid/migration.sql b/prisma/migrations/20240503082232_index_id_and_dataroomid/migration.sql deleted file mode 100644 index af90e37bf..000000000 --- a/prisma/migrations/20240503082232_index_id_and_dataroomid/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- CreateIndex -CREATE INDEX "DataRoomRecipient_id_dataRoomId_idx" ON "DataRoomRecipient"("id", "dataRoomId"); diff --git a/prisma/migrations/20240504055008_optional_recipient/migration.sql b/prisma/migrations/20240504055008_optional_recipient/migration.sql deleted file mode 100644 index dfa035ddf..000000000 --- a/prisma/migrations/20240504055008_optional_recipient/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "EsignAudit" ALTER COLUMN "recipientId" DROP NOT NULL; diff --git a/prisma/migrations/20240504130551_add_message_column_at_template/migration.sql b/prisma/migrations/20240504130551_add_message_column_at_template/migration.sql deleted file mode 100644 index c135fbf13..000000000 --- a/prisma/migrations/20240504130551_add_message_column_at_template/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "Template" ADD COLUMN "message" TEXT; diff --git a/prisma/migrations/20240505021110_add_select/migration.sql b/prisma/migrations/20240505021110_add_select/migration.sql deleted file mode 100644 index 75a2acdf8..000000000 --- a/prisma/migrations/20240505021110_add_select/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterEnum -ALTER TYPE "FieldTypes" ADD VALUE 'SELECT'; diff --git a/prisma/migrations/20240507010943_add_meta_field/migration.sql b/prisma/migrations/20240507010943_add_meta_field/migration.sql deleted file mode 100644 index 47b79f305..000000000 --- a/prisma/migrations/20240507010943_add_meta_field/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "TemplateField" ADD COLUMN "meta" JSONB NOT NULL DEFAULT '{}'; diff --git a/prisma/migrations/20240507044842_re_create_update_recipient/migration.sql b/prisma/migrations/20240507044842_re_create_update_recipient/migration.sql deleted file mode 100644 index 38fbc7765..000000000 --- a/prisma/migrations/20240507044842_re_create_update_recipient/migration.sql +++ /dev/null @@ -1,34 +0,0 @@ -/* - Warnings: - - - You are about to drop the column `sentAt` on the `Update` table. All the data in the column will be lost. - - You are about to drop the column `readAt` on the `UpdateRecipient` table. All the data in the column will be lost. - - You are about to drop the column `sentAt` on the `UpdateRecipient` table. All the data in the column will be lost. - - You are about to drop the column `status` on the `UpdateRecipient` table. All the data in the column will be lost. - - A unique constraint covering the columns `[updateId,email]` on the table `UpdateRecipient` will be added. If there are existing duplicate values, this will fail. - - Added the required column `email` to the `UpdateRecipient` table without a default value. This is not possible if the table is not empty. - -*/ --- AlterTable -ALTER TABLE "Update" DROP COLUMN "sentAt"; - --- AlterTable -ALTER TABLE "UpdateRecipient" DROP COLUMN "readAt", -DROP COLUMN "sentAt", -DROP COLUMN "status", -ADD COLUMN "email" TEXT NOT NULL, -ADD COLUMN "memberId" TEXT, -ADD COLUMN "name" TEXT, -ALTER COLUMN "stakeholderId" DROP NOT NULL; - --- DropEnum -DROP TYPE "UpdateEmailStatusEnum"; - --- CreateIndex -CREATE INDEX "UpdateRecipient_id_updateId_idx" ON "UpdateRecipient"("id", "updateId"); - --- CreateIndex -CREATE INDEX "UpdateRecipient_memberId_idx" ON "UpdateRecipient"("memberId"); - --- CreateIndex -CREATE UNIQUE INDEX "UpdateRecipient_updateId_email_key" ON "UpdateRecipient"("updateId", "email"); diff --git a/prisma/migrations/20240512165126_passkey_setup/migration.sql b/prisma/migrations/20240512165126_passkey_setup/migration.sql deleted file mode 100644 index 80fc92777..000000000 --- a/prisma/migrations/20240512165126_passkey_setup/migration.sql +++ /dev/null @@ -1,62 +0,0 @@ -/* - Warnings: - - - The primary key for the `VerificationToken` table will be changed. If it partially fails, the table could be left without primary key constraint. - - The `id` column on the `VerificationToken` table would be dropped and recreated. This will lead to data loss if there is data in the column. - - A unique constraint covering the columns `[secondaryId]` on the table `VerificationToken` will be added. If there are existing duplicate values, this will fail. - - The required column `secondaryId` was added to the `VerificationToken` table with a prisma-level default value. This is not possible if the table is not empty. Please add this column as optional, then populate it before making it required. - - Added the required column `userId` to the `VerificationToken` table without a default value. This is not possible if the table is not empty. - -*/ --- CreateEnum -CREATE TYPE "CredentialDeviceTypeEnum" AS ENUM ('SINGLE_DEVICE', 'MULTI_DEVICE'); - --- AlterTable -ALTER TABLE "User" ADD COLUMN "identityProvider" TEXT, -ADD COLUMN "lastSignedIn" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP; - --- AlterTable -ALTER TABLE "VerificationToken" DROP CONSTRAINT "VerificationToken_pkey", -ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, -ADD COLUMN "secondaryId" TEXT NOT NULL, -ADD COLUMN "userId" TEXT NOT NULL, -DROP COLUMN "id", -ADD COLUMN "id" SERIAL NOT NULL, -ADD CONSTRAINT "VerificationToken_pkey" PRIMARY KEY ("id"); - --- CreateTable -CREATE TABLE "Passkey" ( - "id" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "name" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "lastUsedAt" TIMESTAMP(3), - "credentialId" BYTEA NOT NULL, - "credentialPublicKey" BYTEA NOT NULL, - "counter" BIGINT NOT NULL, - "credentialDeviceType" "CredentialDeviceTypeEnum" NOT NULL, - "credentialBackedUp" BOOLEAN NOT NULL, - "transports" TEXT[], - - CONSTRAINT "Passkey_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "PasskeyVerificationToken" ( - "id" TEXT NOT NULL, - "token" TEXT NOT NULL, - "expiresAt" TIMESTAMP(3) NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - - CONSTRAINT "PasskeyVerificationToken_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE UNIQUE INDEX "PasskeyVerificationToken_id_key" ON "PasskeyVerificationToken"("id"); - --- CreateIndex -CREATE UNIQUE INDEX "PasskeyVerificationToken_token_key" ON "PasskeyVerificationToken"("token"); - --- CreateIndex -CREATE UNIQUE INDEX "VerificationToken_secondaryId_key" ON "VerificationToken"("secondaryId"); diff --git a/prisma/migrations/20240513040603_make_user_id_optional_in_verification_token_model/migration.sql b/prisma/migrations/20240513040603_make_user_id_optional_in_verification_token_model/migration.sql deleted file mode 100644 index 732d13ccd..000000000 --- a/prisma/migrations/20240513040603_make_user_id_optional_in_verification_token_model/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterTable -ALTER TABLE "VerificationToken" ALTER COLUMN "userId" DROP NOT NULL; diff --git a/prisma/migrations/20240513073506_add_missing_index/migration.sql b/prisma/migrations/20240513073506_add_missing_index/migration.sql deleted file mode 100644 index 3d207e40d..000000000 --- a/prisma/migrations/20240513073506_add_missing_index/migration.sql +++ /dev/null @@ -1,5 +0,0 @@ --- CreateIndex -CREATE INDEX "Passkey_userId_idx" ON "Passkey"("userId"); - --- CreateIndex -CREATE INDEX "VerificationToken_userId_idx" ON "VerificationToken"("userId"); diff --git a/prisma/migrations/20240519093430_clean_migration/migration.sql b/prisma/migrations/20240519093430_clean_migration/migration.sql new file mode 100644 index 000000000..97500fc65 --- /dev/null +++ b/prisma/migrations/20240519093430_clean_migration/migration.sql @@ -0,0 +1,827 @@ +-- CreateEnum +CREATE TYPE "CredentialDeviceTypeEnum" AS ENUM ('SINGLE_DEVICE', 'MULTI_DEVICE'); + +-- CreateEnum +CREATE TYPE "MemberStatusEnum" AS ENUM ('ACTIVE', 'INACTIVE', 'PENDING'); + +-- CreateEnum +CREATE TYPE "StakeholderTypeEnum" AS ENUM ('INDIVIDUAL', 'INSTITUTION'); + +-- CreateEnum +CREATE TYPE "StakeholderRelationshipEnum" AS ENUM ('ADVISOR', 'BOARD_MEMBER', 'CONSULTANT', 'EMPLOYEE', 'EX_ADVISOR', 'EX_CONSULTANT', 'EX_EMPLOYEE', 'EXECUTIVE', 'FOUNDER', 'INVESTOR', 'NON_US_EMPLOYEE', 'OFFICER', 'OTHER'); + +-- CreateEnum +CREATE TYPE "ShareTypeEnum" AS ENUM ('COMMON', 'PREFERRED'); + +-- CreateEnum +CREATE TYPE "SharePrefixEnum" AS ENUM ('CS', 'PS'); + +-- CreateEnum +CREATE TYPE "ConversionRightsEnum" AS ENUM ('CONVERTS_TO_FUTURE_ROUND', 'CONVERTS_TO_SHARE_CLASS_ID'); + +-- CreateEnum +CREATE TYPE "CancellationBehaviorEnum" AS ENUM ('RETIRE', 'RETURN_TO_POOL', 'HOLD_AS_CAPITAL_STOCK', 'DEFINED_PER_PLAN_SECURITY'); + +-- CreateEnum +CREATE TYPE "FieldTypes" AS ENUM ('TEXT', 'RADIO', 'EMAIL', 'DATE', 'DATETIME', 'TEXTAREA', 'CHECKBOX', 'SIGNATURE', 'SELECT'); + +-- CreateEnum +CREATE TYPE "TemplateStatus" AS ENUM ('DRAFT', 'COMPLETE'); + +-- CreateEnum +CREATE TYPE "EsignRecipientStatus" AS ENUM ('SENT', 'SIGNED', 'PENDING'); + +-- CreateEnum +CREATE TYPE "SecuritiesStatusEnum" AS ENUM ('ACTIVE', 'DRAFT', 'SIGNED', 'PENDING'); + +-- CreateEnum +CREATE TYPE "VestingScheduleEnum" AS ENUM ('VESTING_0_0_0', 'VESTING_0_0_1', 'VESTING_4_1_0', 'VESTING_4_1_1', 'VESTING_4_3_1', 'VESTING_4_6_1', 'VESTING_4_12_1'); + +-- CreateEnum +CREATE TYPE "ShareLegendsEnum" AS ENUM ('US_SECURITIES_ACT', 'SALE_AND_ROFR', 'TRANSFER_RESTRICTIONS'); + +-- CreateEnum +CREATE TYPE "OptionTypeEnum" AS ENUM ('ISO', 'NSO', 'RSU'); + +-- CreateEnum +CREATE TYPE "OptionStatusEnum" AS ENUM ('DRAFT', 'ACTIVE', 'EXERCISED', 'EXPIRED', 'CANCELLED'); + +-- CreateEnum +CREATE TYPE "SafeTypeEnum" AS ENUM ('PRE_MONEY', 'POST_MONEY'); + +-- CreateEnum +CREATE TYPE "SafeStatusEnum" AS ENUM ('DRAFT', 'ACTIVE', 'PENDING', 'EXPIRED', 'CANCELLED'); + +-- CreateEnum +CREATE TYPE "SafeTemplateEnum" AS ENUM ('Valuation Cap, no Discount', 'Discount, no Valuation Cap', 'MFN, no Valuation Cap, no Discount', 'Valuation Cap, no Discount, include Pro Rata Rights', 'Discount, no Valuation Cap, include Pro Rata Rights', 'MFN, no Valuation Cap, no Discount, include Pro Rata Rights', 'Custom'); + +-- CreateEnum +CREATE TYPE "ConvertibleStatusEnum" AS ENUM ('DRAFT', 'ACTIVE', 'PENDING', 'EXPIRED', 'CANCELLED'); + +-- CreateEnum +CREATE TYPE "ConvertibleTypeEnum" AS ENUM ('CCD', 'OCD', 'NOTE'); + +-- CreateEnum +CREATE TYPE "ConvertibleInterestMethodEnum" AS ENUM ('SIMPLE', 'COMPOUND'); + +-- CreateEnum +CREATE TYPE "ConvertibleInterestAccrualEnum" AS ENUM ('DAILY', 'MONTHLY', 'SEMI_ANNUALLY', 'ANNUALLY', 'YEARLY', 'CONTINUOUSLY'); + +-- CreateEnum +CREATE TYPE "ConvertibleInterestPaymentScheduleEnum" AS ENUM ('DEFERRED', 'PAY_AT_MATURITY'); + +-- CreateEnum +CREATE TYPE "UpdateStatusEnum" AS ENUM ('DRAFT', 'PUBLIC', 'PRIVATE'); + +-- CreateTable +CREATE TABLE "Account" ( + "id" TEXT NOT NULL, + "userId" TEXT 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" TEXT NOT NULL, + "sessionToken" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "expires" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Session_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "User" ( + "id" TEXT NOT NULL, + "name" TEXT, + "email" TEXT, + "password" TEXT, + "emailVerified" TIMESTAMP(3), + "image" TEXT, + "lastSignedIn" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "identityProvider" TEXT, + + CONSTRAINT "User_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Passkey" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "lastUsedAt" TIMESTAMP(3), + "credentialId" BYTEA NOT NULL, + "credentialPublicKey" BYTEA NOT NULL, + "counter" BIGINT NOT NULL, + "credentialDeviceType" "CredentialDeviceTypeEnum" NOT NULL, + "credentialBackedUp" BOOLEAN NOT NULL, + "transports" TEXT[], + "userId" TEXT NOT NULL, + + CONSTRAINT "Passkey_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "PasskeyVerificationToken" ( + "id" TEXT NOT NULL, + "token" TEXT NOT NULL, + "expiresAt" TIMESTAMP(3) NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "PasskeyVerificationToken_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "VerificationToken" ( + "id" SERIAL NOT NULL, + "secondaryId" TEXT NOT NULL, + "identifier" TEXT NOT NULL, + "token" TEXT NOT NULL, + "expires" TIMESTAMP(3) NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "userId" TEXT, + + CONSTRAINT "VerificationToken_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "PasswordResetToken" ( + "id" TEXT NOT NULL, + "email" TEXT NOT NULL, + "token" TEXT NOT NULL, + "expires" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "PasswordResetToken_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Company" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "logo" TEXT, + "publicId" TEXT NOT NULL, + "website" TEXT, + "incorporationType" TEXT NOT NULL, + "incorporationDate" TIMESTAMP(3) NOT NULL, + "incorporationCountry" TEXT NOT NULL, + "incorporationState" TEXT NOT NULL, + "streetAddress" TEXT NOT NULL, + "city" TEXT NOT NULL, + "state" TEXT NOT NULL, + "zipcode" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Company_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Member" ( + "id" TEXT NOT NULL, + "title" TEXT, + "status" "MemberStatusEnum" NOT NULL DEFAULT 'PENDING', + "isOnboarded" BOOLEAN NOT NULL DEFAULT false, + "workEmail" TEXT, + "lastAccessed" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + "userId" TEXT NOT NULL, + "companyId" TEXT NOT NULL, + + CONSTRAINT "Member_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Stakeholder" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "email" TEXT NOT NULL, + "institutionName" TEXT, + "stakeholderType" "StakeholderTypeEnum" NOT NULL DEFAULT 'INDIVIDUAL', + "currentRelationship" "StakeholderRelationshipEnum" NOT NULL DEFAULT 'EMPLOYEE', + "taxId" TEXT, + "streetAddress" TEXT, + "city" TEXT, + "state" TEXT, + "zipcode" TEXT, + "country" TEXT NOT NULL DEFAULT 'US', + "companyId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Stakeholder_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Audit" ( + "id" TEXT NOT NULL, + "companyId" TEXT NOT NULL, + "summary" TEXT, + "action" TEXT NOT NULL, + "occurredAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "actor" JSONB NOT NULL, + "target" JSONB[], + "context" JSONB NOT NULL, + + CONSTRAINT "Audit_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ShareClass" ( + "id" TEXT NOT NULL, + "idx" INTEGER NOT NULL, + "name" TEXT NOT NULL, + "classType" "ShareTypeEnum" NOT NULL DEFAULT 'COMMON', + "prefix" "SharePrefixEnum" NOT NULL DEFAULT 'CS', + "initialSharesAuthorized" BIGINT NOT NULL, + "boardApprovalDate" TIMESTAMP(3) NOT NULL, + "stockholderApprovalDate" TIMESTAMP(3) NOT NULL, + "votesPerShare" INTEGER NOT NULL, + "parValue" DOUBLE PRECISION NOT NULL, + "pricePerShare" DOUBLE PRECISION NOT NULL, + "seniority" INTEGER NOT NULL, + "conversionRights" "ConversionRightsEnum" NOT NULL DEFAULT 'CONVERTS_TO_FUTURE_ROUND', + "convertsToShareClassId" TEXT, + "liquidationPreferenceMultiple" DOUBLE PRECISION NOT NULL, + "participationCapMultiple" DOUBLE PRECISION NOT NULL, + "companyId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "ShareClass_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "EquityPlan" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "boardApprovalDate" TIMESTAMP(3) NOT NULL, + "planEffectiveDate" TIMESTAMP(3), + "initialSharesReserved" BIGINT NOT NULL, + "defaultCancellatonBehavior" "CancellationBehaviorEnum" NOT NULL, + "comments" TEXT, + "companyId" TEXT NOT NULL, + "shareClassId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "EquityPlan_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Bucket" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "key" TEXT NOT NULL, + "mimeType" TEXT NOT NULL, + "size" INTEGER NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Bucket_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Document" ( + "id" TEXT NOT NULL, + "publicId" TEXT NOT NULL, + "name" TEXT NOT NULL, + "bucketId" TEXT NOT NULL, + "uploaderId" TEXT, + "companyId" TEXT NOT NULL, + "shareId" TEXT, + "optionId" TEXT, + "safeId" TEXT, + "convertibleNoteId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Document_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "DataRoom" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "publicId" TEXT NOT NULL, + "public" BOOLEAN NOT NULL DEFAULT false, + "companyId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "DataRoom_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "DataRoomDocument" ( + "id" TEXT NOT NULL, + "dataRoomId" TEXT NOT NULL, + "documentId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "DataRoomDocument_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "DataRoomRecipient" ( + "id" TEXT NOT NULL, + "name" TEXT, + "email" TEXT NOT NULL, + "dataRoomId" TEXT NOT NULL, + "memberId" TEXT, + "stakeholderId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "DataRoomRecipient_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "UpdateRecipient" ( + "id" TEXT NOT NULL, + "name" TEXT, + "email" TEXT NOT NULL, + "updateId" TEXT NOT NULL, + "memberId" TEXT, + "stakeholderId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "UpdateRecipient_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "DocumentShare" ( + "id" TEXT NOT NULL, + "link" TEXT NOT NULL, + "publicId" TEXT NOT NULL, + "linkExpiresAt" TIMESTAMP(3) NOT NULL, + "recipients" TEXT[] DEFAULT ARRAY[]::TEXT[], + "emailProtected" BOOLEAN NOT NULL DEFAULT false, + "documentId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "DocumentShare_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "TemplateField" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "type" "FieldTypes" NOT NULL DEFAULT 'TEXT', + "defaultValue" TEXT NOT NULL DEFAULT '', + "readOnly" BOOLEAN NOT NULL DEFAULT false, + "required" BOOLEAN NOT NULL DEFAULT false, + "prefilledValue" TEXT, + "top" INTEGER NOT NULL, + "left" INTEGER NOT NULL, + "width" INTEGER NOT NULL, + "height" INTEGER NOT NULL, + "recipientId" TEXT NOT NULL, + "templateId" TEXT NOT NULL, + "viewportHeight" INTEGER NOT NULL, + "viewportWidth" INTEGER NOT NULL, + "page" INTEGER NOT NULL, + "meta" JSONB NOT NULL DEFAULT '{}', + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "TemplateField_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Template" ( + "id" TEXT NOT NULL, + "publicId" TEXT NOT NULL, + "name" TEXT NOT NULL, + "status" "TemplateStatus" NOT NULL DEFAULT 'DRAFT', + "orderedDelivery" BOOLEAN NOT NULL DEFAULT false, + "message" TEXT, + "bucketId" TEXT NOT NULL, + "uploaderId" TEXT NOT NULL, + "companyId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + "completedOn" TIMESTAMP(3), + + CONSTRAINT "Template_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "EsignRecipient" ( + "id" TEXT NOT NULL, + "email" TEXT NOT NULL, + "name" TEXT, + "templateId" TEXT NOT NULL, + "status" "EsignRecipientStatus" NOT NULL DEFAULT 'PENDING', + "memberId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "EsignRecipient_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Share" ( + "id" TEXT NOT NULL, + "status" "SecuritiesStatusEnum" NOT NULL DEFAULT 'DRAFT', + "certificateId" TEXT NOT NULL, + "quantity" INTEGER NOT NULL, + "pricePerShare" DOUBLE PRECISION, + "capitalContribution" DOUBLE PRECISION, + "ipContribution" DOUBLE PRECISION, + "debtCancelled" DOUBLE PRECISION, + "otherContributions" DOUBLE PRECISION, + "vestingSchedule" "VestingScheduleEnum" NOT NULL, + "companyLegends" "ShareLegendsEnum"[], + "issueDate" TIMESTAMP(3) NOT NULL, + "rule144Date" TIMESTAMP(3), + "vestingStartDate" TIMESTAMP(3), + "boardApprovalDate" TIMESTAMP(3) NOT NULL, + "stakeholderId" TEXT NOT NULL, + "companyId" TEXT NOT NULL, + "shareClassId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Share_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Option" ( + "id" TEXT NOT NULL, + "grantId" TEXT NOT NULL, + "quantity" INTEGER NOT NULL, + "exercisePrice" DOUBLE PRECISION NOT NULL, + "type" "OptionTypeEnum" NOT NULL, + "status" "OptionStatusEnum" NOT NULL DEFAULT 'DRAFT', + "vestingSchedule" "VestingScheduleEnum" NOT NULL, + "issueDate" TIMESTAMP(3) NOT NULL, + "expirationDate" TIMESTAMP(3) NOT NULL, + "vestingStartDate" TIMESTAMP(3) NOT NULL, + "boardApprovalDate" TIMESTAMP(3) NOT NULL, + "rule144Date" TIMESTAMP(3) NOT NULL, + "stakeholderId" TEXT NOT NULL, + "companyId" TEXT NOT NULL, + "equityPlanId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Option_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Investment" ( + "id" TEXT NOT NULL, + "amount" DOUBLE PRECISION NOT NULL, + "shares" BIGINT NOT NULL, + "date" TIMESTAMP(3) NOT NULL, + "comments" TEXT, + "shareClassId" TEXT NOT NULL, + "companyId" TEXT NOT NULL, + "stakeholderId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Investment_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Safe" ( + "id" TEXT NOT NULL, + "publicId" TEXT NOT NULL, + "type" "SafeTypeEnum" NOT NULL DEFAULT 'POST_MONEY', + "status" "SafeStatusEnum" NOT NULL DEFAULT 'DRAFT', + "capital" DOUBLE PRECISION NOT NULL, + "safeTemplate" "SafeTemplateEnum", + "valuationCap" DOUBLE PRECISION, + "discountRate" DOUBLE PRECISION, + "mfn" BOOLEAN NOT NULL DEFAULT false, + "proRata" BOOLEAN NOT NULL DEFAULT false, + "additionalTerms" TEXT, + "stakeholderId" TEXT NOT NULL, + "companyId" TEXT NOT NULL, + "issueDate" TIMESTAMP(3) NOT NULL, + "boardApprovalDate" TIMESTAMP(3) NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Safe_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ConvertibleNote" ( + "id" TEXT NOT NULL, + "publicId" TEXT NOT NULL, + "status" "ConvertibleStatusEnum" NOT NULL DEFAULT 'DRAFT', + "type" "ConvertibleTypeEnum" NOT NULL DEFAULT 'NOTE', + "capital" DOUBLE PRECISION NOT NULL, + "conversionCap" DOUBLE PRECISION, + "discountRate" DOUBLE PRECISION, + "mfn" BOOLEAN, + "additionalTerms" TEXT, + "interestRate" DOUBLE PRECISION, + "interestMethod" "ConvertibleInterestMethodEnum", + "interestAccrual" "ConvertibleInterestAccrualEnum", + "interestPaymentSchedule" "ConvertibleInterestPaymentScheduleEnum", + "stakeholderId" TEXT NOT NULL, + "companyId" TEXT NOT NULL, + "issueDate" TIMESTAMP(3) NOT NULL, + "boardApprovalDate" TIMESTAMP(3) NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "ConvertibleNote_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Update" ( + "id" TEXT NOT NULL, + "publicId" TEXT NOT NULL, + "title" TEXT NOT NULL, + "content" JSONB NOT NULL, + "html" TEXT NOT NULL, + "status" "UpdateStatusEnum" NOT NULL DEFAULT 'DRAFT', + "authorId" TEXT NOT NULL, + "companyId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Update_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "EsignAudit" ( + "id" TEXT NOT NULL, + "companyId" TEXT NOT NULL, + "templateId" TEXT NOT NULL, + "recipientId" TEXT, + "action" TEXT NOT NULL, + "ip" TEXT NOT NULL, + "userAgent" TEXT NOT NULL, + "location" TEXT NOT NULL, + "summary" TEXT NOT NULL, + "occurredAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "EsignAudit_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE INDEX "Account_userId_idx" ON "Account"("userId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Session_sessionToken_key" ON "Session"("sessionToken"); + +-- CreateIndex +CREATE INDEX "Session_userId_idx" ON "Session"("userId"); + +-- CreateIndex +CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); + +-- CreateIndex +CREATE INDEX "Passkey_userId_idx" ON "Passkey"("userId"); + +-- CreateIndex +CREATE UNIQUE INDEX "PasskeyVerificationToken_id_key" ON "PasskeyVerificationToken"("id"); + +-- CreateIndex +CREATE UNIQUE INDEX "PasskeyVerificationToken_token_key" ON "PasskeyVerificationToken"("token"); + +-- CreateIndex +CREATE UNIQUE INDEX "VerificationToken_secondaryId_key" ON "VerificationToken"("secondaryId"); + +-- CreateIndex +CREATE UNIQUE INDEX "VerificationToken_token_key" ON "VerificationToken"("token"); + +-- CreateIndex +CREATE INDEX "VerificationToken_userId_idx" ON "VerificationToken"("userId"); + +-- CreateIndex +CREATE UNIQUE INDEX "VerificationToken_identifier_token_key" ON "VerificationToken"("identifier", "token"); + +-- CreateIndex +CREATE UNIQUE INDEX "PasswordResetToken_token_key" ON "PasswordResetToken"("token"); + +-- CreateIndex +CREATE UNIQUE INDEX "PasswordResetToken_email_token_key" ON "PasswordResetToken"("email", "token"); + +-- CreateIndex +CREATE UNIQUE INDEX "Company_publicId_key" ON "Company"("publicId"); + +-- CreateIndex +CREATE INDEX "Member_companyId_idx" ON "Member"("companyId"); + +-- CreateIndex +CREATE INDEX "Member_status_idx" ON "Member"("status"); + +-- CreateIndex +CREATE INDEX "Member_userId_idx" ON "Member"("userId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Member_companyId_userId_key" ON "Member"("companyId", "userId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Stakeholder_email_key" ON "Stakeholder"("email"); + +-- CreateIndex +CREATE INDEX "Stakeholder_companyId_idx" ON "Stakeholder"("companyId"); + +-- CreateIndex +CREATE INDEX "Audit_companyId_idx" ON "Audit"("companyId"); + +-- CreateIndex +CREATE INDEX "ShareClass_companyId_idx" ON "ShareClass"("companyId"); + +-- CreateIndex +CREATE UNIQUE INDEX "ShareClass_companyId_idx_key" ON "ShareClass"("companyId", "idx"); + +-- CreateIndex +CREATE INDEX "EquityPlan_shareClassId_idx" ON "EquityPlan"("shareClassId"); + +-- CreateIndex +CREATE INDEX "EquityPlan_companyId_idx" ON "EquityPlan"("companyId"); + +-- CreateIndex +CREATE INDEX "Document_bucketId_idx" ON "Document"("bucketId"); + +-- CreateIndex +CREATE INDEX "Document_uploaderId_idx" ON "Document"("uploaderId"); + +-- CreateIndex +CREATE INDEX "Document_companyId_idx" ON "Document"("companyId"); + +-- CreateIndex +CREATE INDEX "Document_shareId_idx" ON "Document"("shareId"); + +-- CreateIndex +CREATE INDEX "Document_optionId_idx" ON "Document"("optionId"); + +-- CreateIndex +CREATE INDEX "Document_safeId_idx" ON "Document"("safeId"); + +-- CreateIndex +CREATE INDEX "Document_convertibleNoteId_idx" ON "Document"("convertibleNoteId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Document_publicId_key" ON "Document"("publicId"); + +-- CreateIndex +CREATE INDEX "DataRoom_publicId_idx" ON "DataRoom"("publicId"); + +-- CreateIndex +CREATE INDEX "DataRoom_companyId_idx" ON "DataRoom"("companyId"); + +-- CreateIndex +CREATE UNIQUE INDEX "DataRoom_publicId_key" ON "DataRoom"("publicId"); + +-- CreateIndex +CREATE UNIQUE INDEX "DataRoom_companyId_name_key" ON "DataRoom"("companyId", "name"); + +-- CreateIndex +CREATE INDEX "DataRoomDocument_dataRoomId_idx" ON "DataRoomDocument"("dataRoomId"); + +-- CreateIndex +CREATE INDEX "DataRoomDocument_documentId_idx" ON "DataRoomDocument"("documentId"); + +-- CreateIndex +CREATE UNIQUE INDEX "DataRoomDocument_dataRoomId_documentId_key" ON "DataRoomDocument"("dataRoomId", "documentId"); + +-- CreateIndex +CREATE INDEX "DataRoomRecipient_id_dataRoomId_idx" ON "DataRoomRecipient"("id", "dataRoomId"); + +-- CreateIndex +CREATE INDEX "DataRoomRecipient_memberId_idx" ON "DataRoomRecipient"("memberId"); + +-- CreateIndex +CREATE INDEX "DataRoomRecipient_dataRoomId_idx" ON "DataRoomRecipient"("dataRoomId"); + +-- CreateIndex +CREATE INDEX "DataRoomRecipient_stakeholderId_idx" ON "DataRoomRecipient"("stakeholderId"); + +-- CreateIndex +CREATE UNIQUE INDEX "DataRoomRecipient_dataRoomId_email_key" ON "DataRoomRecipient"("dataRoomId", "email"); + +-- CreateIndex +CREATE INDEX "UpdateRecipient_id_updateId_idx" ON "UpdateRecipient"("id", "updateId"); + +-- CreateIndex +CREATE INDEX "UpdateRecipient_memberId_idx" ON "UpdateRecipient"("memberId"); + +-- CreateIndex +CREATE INDEX "UpdateRecipient_updateId_idx" ON "UpdateRecipient"("updateId"); + +-- CreateIndex +CREATE INDEX "UpdateRecipient_stakeholderId_idx" ON "UpdateRecipient"("stakeholderId"); + +-- CreateIndex +CREATE UNIQUE INDEX "UpdateRecipient_updateId_email_key" ON "UpdateRecipient"("updateId", "email"); + +-- CreateIndex +CREATE INDEX "DocumentShare_documentId_idx" ON "DocumentShare"("documentId"); + +-- CreateIndex +CREATE INDEX "TemplateField_templateId_idx" ON "TemplateField"("templateId"); + +-- CreateIndex +CREATE INDEX "TemplateField_recipientId_idx" ON "TemplateField"("recipientId"); + +-- CreateIndex +CREATE INDEX "Template_bucketId_idx" ON "Template"("bucketId"); + +-- CreateIndex +CREATE INDEX "Template_uploaderId_idx" ON "Template"("uploaderId"); + +-- CreateIndex +CREATE INDEX "Template_companyId_idx" ON "Template"("companyId"); + +-- CreateIndex +CREATE INDEX "EsignRecipient_memberId_idx" ON "EsignRecipient"("memberId"); + +-- CreateIndex +CREATE INDEX "EsignRecipient_templateId_idx" ON "EsignRecipient"("templateId"); + +-- CreateIndex +CREATE INDEX "Share_companyId_idx" ON "Share"("companyId"); + +-- CreateIndex +CREATE INDEX "Share_shareClassId_idx" ON "Share"("shareClassId"); + +-- CreateIndex +CREATE INDEX "Share_stakeholderId_idx" ON "Share"("stakeholderId"); + +-- CreateIndex +CREATE INDEX "Option_companyId_idx" ON "Option"("companyId"); + +-- CreateIndex +CREATE INDEX "Option_equityPlanId_idx" ON "Option"("equityPlanId"); + +-- CreateIndex +CREATE INDEX "Option_stakeholderId_idx" ON "Option"("stakeholderId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Option_companyId_grantId_key" ON "Option"("companyId", "grantId"); + +-- CreateIndex +CREATE INDEX "Investment_companyId_idx" ON "Investment"("companyId"); + +-- CreateIndex +CREATE INDEX "Investment_stakeholderId_idx" ON "Investment"("stakeholderId"); + +-- CreateIndex +CREATE INDEX "Investment_shareClassId_idx" ON "Investment"("shareClassId"); + +-- CreateIndex +CREATE INDEX "Safe_companyId_idx" ON "Safe"("companyId"); + +-- CreateIndex +CREATE INDEX "Safe_stakeholderId_idx" ON "Safe"("stakeholderId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Safe_publicId_companyId_key" ON "Safe"("publicId", "companyId"); + +-- CreateIndex +CREATE INDEX "ConvertibleNote_companyId_idx" ON "ConvertibleNote"("companyId"); + +-- CreateIndex +CREATE INDEX "ConvertibleNote_stakeholderId_idx" ON "ConvertibleNote"("stakeholderId"); + +-- CreateIndex +CREATE UNIQUE INDEX "ConvertibleNote_publicId_companyId_key" ON "ConvertibleNote"("publicId", "companyId"); + +-- CreateIndex +CREATE INDEX "Update_publicId_idx" ON "Update"("publicId"); + +-- CreateIndex +CREATE INDEX "Update_authorId_idx" ON "Update"("authorId"); + +-- CreateIndex +CREATE INDEX "Update_companyId_idx" ON "Update"("companyId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Update_publicId_key" ON "Update"("publicId"); + +-- CreateIndex +CREATE INDEX "EsignAudit_companyId_idx" ON "EsignAudit"("companyId"); + +-- CreateIndex +CREATE INDEX "EsignAudit_templateId_idx" ON "EsignAudit"("templateId"); + +-- CreateIndex +CREATE INDEX "EsignAudit_recipientId_idx" ON "EsignAudit"("recipientId");