-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
121 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// @generated | ||
// This file is automatically generated by Kanel. Do not modify manually. | ||
|
||
import { type ColumnType, type Insertable, type Selectable, type Updateable } from "kysely"; | ||
|
||
import { type FormsId } from "./Forms"; | ||
import { type PubFieldsId } from "./PubFields"; | ||
|
||
/** Identifier type for public.form_inputs */ | ||
export type FormInputsId = string & { __brand: "FormInputsId" }; | ||
|
||
/** Represents the table public.form_inputs */ | ||
export default interface FormInputsTable { | ||
id: ColumnType<FormInputsId, FormInputsId | undefined, FormInputsId>; | ||
|
||
field_id: ColumnType<PubFieldsId, PubFieldsId, PubFieldsId>; | ||
|
||
form_id: ColumnType<FormsId, FormsId, FormsId>; | ||
|
||
order: ColumnType<string, string, string>; | ||
|
||
label: ColumnType<string, string, string>; | ||
|
||
required: ColumnType<boolean, boolean, boolean>; | ||
|
||
is_submit: ColumnType<boolean, boolean, boolean>; | ||
} | ||
|
||
export type FormInputs = Selectable<FormInputsTable>; | ||
|
||
export type NewFormInputs = Insertable<FormInputsTable>; | ||
|
||
export type FormInputsUpdate = Updateable<FormInputsTable>; |
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,24 @@ | ||
// @generated | ||
// This file is automatically generated by Kanel. Do not modify manually. | ||
|
||
import { type ColumnType, type Insertable, type Selectable, type Updateable } from "kysely"; | ||
|
||
import { type PubTypesId } from "./PubTypes"; | ||
|
||
/** Identifier type for public.forms */ | ||
export type FormsId = string & { __brand: "FormsId" }; | ||
|
||
/** Represents the table public.forms */ | ||
export default interface FormsTable { | ||
id: ColumnType<FormsId, FormsId | undefined, FormsId>; | ||
|
||
name: ColumnType<string, string, string>; | ||
|
||
pub_type_id: ColumnType<PubTypesId, PubTypesId, PubTypesId>; | ||
} | ||
|
||
export type Forms = Selectable<FormsTable>; | ||
|
||
export type NewForms = Insertable<FormsTable>; | ||
|
||
export type FormsUpdate = Updateable<FormsTable>; |
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
30 changes: 30 additions & 0 deletions
30
core/prisma/migrations/20240529145416_add_forms/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,30 @@ | ||
-- CreateTable | ||
CREATE TABLE "forms" ( | ||
"id" TEXT NOT NULL DEFAULT gen_random_uuid(), | ||
"name" TEXT NOT NULL, | ||
"pub_type_id" TEXT NOT NULL, | ||
|
||
CONSTRAINT "forms_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "form_inputs" ( | ||
"id" TEXT NOT NULL DEFAULT gen_random_uuid(), | ||
"field_id" TEXT NOT NULL, | ||
"form_id" TEXT NOT NULL, | ||
"order" TEXT NOT NULL, | ||
"label" TEXT NOT NULL, | ||
"required" BOOLEAN NOT NULL, | ||
"is_submit" BOOLEAN NOT NULL, | ||
|
||
CONSTRAINT "form_inputs_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "forms" ADD CONSTRAINT "forms_pub_type_id_fkey" FOREIGN KEY ("pub_type_id") REFERENCES "pub_types"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "form_inputs" ADD CONSTRAINT "form_inputs_field_id_fkey" FOREIGN KEY ("field_id") REFERENCES "pub_fields"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "form_inputs" ADD CONSTRAINT "form_inputs_form_id_fkey" FOREIGN KEY ("form_id") REFERENCES "forms"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
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