-
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
10 changed files
with
252 additions
and
62 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
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
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
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,10 @@ | ||
// @generated | ||
// This file is automatically generated by Kanel. Do not modify manually. | ||
|
||
/** Represents the enum public.ActionRunStatus */ | ||
enum ActionRunStatus { | ||
success = "success", | ||
failure = "failure", | ||
} | ||
|
||
export default ActionRunStatus; |
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,39 @@ | ||
// @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 ActionInstancesId } from "./ActionInstances"; | ||
import { type default as ActionRunStatus } from "./ActionRunStatus"; | ||
import { type default as Event } from "./Event"; | ||
import { type PubsId } from "./Pubs"; | ||
|
||
/** Identifier type for public.action_runs */ | ||
export type ActionRunsId = string & { __brand: "ActionRunsId" }; | ||
|
||
/** Represents the table public.action_runs */ | ||
export default interface ActionRunsTable { | ||
id: ColumnType<ActionRunsId, ActionRunsId | undefined, ActionRunsId>; | ||
|
||
action_instance_id: ColumnType<ActionInstancesId, ActionInstancesId, ActionInstancesId>; | ||
|
||
config: ColumnType<unknown | null, unknown | null, unknown | null>; | ||
|
||
event: ColumnType<Event | null, Event | null, Event | null>; | ||
|
||
params: ColumnType<unknown | null, unknown | null, unknown | null>; | ||
|
||
status: ColumnType<ActionRunStatus, ActionRunStatus, ActionRunStatus>; | ||
|
||
created_at: ColumnType<Date, Date | string | undefined, Date | string>; | ||
|
||
updated_at: ColumnType<Date, Date | string | undefined, Date | string>; | ||
|
||
pub_id: ColumnType<PubsId, PubsId, PubsId>; | ||
} | ||
|
||
export type ActionRuns = Selectable<ActionRunsTable>; | ||
|
||
export type NewActionRuns = Insertable<ActionRunsTable>; | ||
|
||
export type ActionRunsUpdate = Updateable<ActionRunsTable>; |
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
19 changes: 19 additions & 0 deletions
19
core/prisma/migrations/20240509160714_add_action_runs/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,19 @@ | ||
-- CreateEnum | ||
CREATE TYPE "ActionRunStatus" AS ENUM ('success', 'failure'); | ||
|
||
-- CreateTable | ||
CREATE TABLE "ActionRun" ( | ||
"id" TEXT NOT NULL DEFAULT gen_random_uuid(), | ||
"action_instance_id" TEXT NOT NULL, | ||
"config" JSONB, | ||
"event" "Event", | ||
"params" JSONB, | ||
"status" "ActionRunStatus" NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "ActionRun_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "ActionRun" ADD CONSTRAINT "ActionRun_action_instance_id_fkey" FOREIGN KEY ("action_instance_id") REFERENCES "action_instances"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
28 changes: 28 additions & 0 deletions
28
core/prisma/migrations/20240509161114_rename_action_runs/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,28 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the `ActionRun` table. If the table is not empty, all the data it contains will be lost. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "ActionRun" DROP CONSTRAINT "ActionRun_action_instance_id_fkey"; | ||
|
||
-- DropTable | ||
DROP TABLE "ActionRun"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "action_runs" ( | ||
"id" TEXT NOT NULL DEFAULT gen_random_uuid(), | ||
"action_instance_id" TEXT NOT NULL, | ||
"config" JSONB, | ||
"event" "Event", | ||
"params" JSONB, | ||
"status" "ActionRunStatus" NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "action_runs_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "action_runs" ADD CONSTRAINT "action_runs_action_instance_id_fkey" FOREIGN KEY ("action_instance_id") REFERENCES "action_instances"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
11 changes: 11 additions & 0 deletions
11
core/prisma/migrations/20240509195649_add_pub_to_action_runs/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,11 @@ | ||
/* | ||
Warnings: | ||
- Added the required column `pub_id` to the `action_runs` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "action_runs" ADD COLUMN "pub_id" TEXT NOT NULL; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "action_runs" ADD CONSTRAINT "action_runs_pub_id_fkey" FOREIGN KEY ("pub_id") REFERENCES "pubs"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
Oops, something went wrong.