chore: add more field types (#1141)
Adds a number of new field types and capabilities to existing fields. A massive change with far too many moving pieces to document in a single commit.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
-- AlterEnum
|
||||
-- This migration adds more than one value to an enum.
|
||||
-- With PostgreSQL versions 11 and earlier, this is not possible
|
||||
-- in a single migration. This can be worked around by creating
|
||||
-- multiple migrations, each migration adding only one value to
|
||||
-- the enum.
|
||||
|
||||
|
||||
ALTER TYPE "FieldType" ADD VALUE 'NUMBER';
|
||||
ALTER TYPE "FieldType" ADD VALUE 'RADIO';
|
||||
ALTER TYPE "FieldType" ADD VALUE 'CHECKBOX';
|
||||
ALTER TYPE "FieldType" ADD VALUE 'DROPDOWN';
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Field" ADD COLUMN "fieldMeta" JSONB;
|
||||
@@ -413,6 +413,10 @@ enum FieldType {
|
||||
EMAIL
|
||||
DATE
|
||||
TEXT
|
||||
NUMBER
|
||||
RADIO
|
||||
CHECKBOX
|
||||
DROPDOWN
|
||||
}
|
||||
|
||||
model Field {
|
||||
@@ -433,6 +437,7 @@ model Field {
|
||||
Template Template? @relation(fields: [templateId], references: [id], onDelete: Cascade)
|
||||
Recipient Recipient @relation(fields: [recipientId], references: [id], onDelete: Cascade)
|
||||
Signature Signature?
|
||||
fieldMeta Json?
|
||||
|
||||
@@index([documentId])
|
||||
@@index([templateId])
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { type TFieldMetaSchema as FieldMeta } from '@documenso/lib/types/field-meta';
|
||||
import type { Field, Signature } from '@documenso/prisma/client';
|
||||
|
||||
export type FieldWithSignatureAndFieldMeta = Field & {
|
||||
Signature?: Signature | null;
|
||||
fieldMeta: FieldMeta | null;
|
||||
};
|
||||
Reference in New Issue
Block a user