-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/share class and equity plan schema (#93)
* feat: add schema for share class and equity plan * feat: create migration file
- Loading branch information
Showing
3 changed files
with
130 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
prisma/migrations/20240204035614_add_share_class_and_equity_plan/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
-- 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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters