Skip to content

Commit 7d540d1

Browse files
committed
init pg table
1 parent 93c0910 commit 7d540d1

18 files changed

Lines changed: 2448 additions & 1 deletion

‎apps/desktop/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
on{
1+
{
22
"name": "@executor/desktop",
33
"version": "1.4.0",
44
"private": true,

‎bun.lock‎

Lines changed: 180 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from "drizzle-kit";
2+
3+
export default defineConfig({
4+
schema: "./src/schema.ts",
5+
out: "./drizzle",
6+
dialect: "postgresql",
7+
});
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
CREATE TABLE "invitations" (
2+
"id" text PRIMARY KEY NOT NULL,
3+
"team_id" text NOT NULL,
4+
"email" text NOT NULL,
5+
"invited_by" text NOT NULL,
6+
"status" text NOT NULL,
7+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
8+
"expires_at" timestamp with time zone NOT NULL
9+
);
10+
--> statement-breakpoint
11+
CREATE TABLE "plugin_kv" (
12+
"team_id" text NOT NULL,
13+
"namespace" text NOT NULL,
14+
"key" text NOT NULL,
15+
"value" text NOT NULL,
16+
CONSTRAINT "plugin_kv_team_id_namespace_key_pk" PRIMARY KEY("team_id","namespace","key")
17+
);
18+
--> statement-breakpoint
19+
CREATE TABLE "policies" (
20+
"id" text NOT NULL,
21+
"team_id" text NOT NULL,
22+
"name" text NOT NULL,
23+
"action" text NOT NULL,
24+
"match_tool_pattern" text,
25+
"match_source_id" text,
26+
"priority" integer NOT NULL,
27+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
28+
CONSTRAINT "policies_id_team_id_pk" PRIMARY KEY("id","team_id")
29+
);
30+
--> statement-breakpoint
31+
CREATE TABLE "secrets" (
32+
"id" text NOT NULL,
33+
"team_id" text NOT NULL,
34+
"name" text NOT NULL,
35+
"purpose" text,
36+
"encrypted_value" "bytea" NOT NULL,
37+
"iv" "bytea" NOT NULL,
38+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
39+
CONSTRAINT "secrets_id_team_id_pk" PRIMARY KEY("id","team_id")
40+
);
41+
--> statement-breakpoint
42+
CREATE TABLE "sessions" (
43+
"id" text PRIMARY KEY NOT NULL,
44+
"user_id" text NOT NULL,
45+
"team_id" text NOT NULL,
46+
"expires_at" timestamp with time zone NOT NULL,
47+
"created_at" timestamp with time zone DEFAULT now() NOT NULL
48+
);
49+
--> statement-breakpoint
50+
CREATE TABLE "sources" (
51+
"id" text NOT NULL,
52+
"team_id" text NOT NULL,
53+
"name" text NOT NULL,
54+
"kind" text NOT NULL,
55+
"config" jsonb NOT NULL,
56+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
57+
CONSTRAINT "sources_id_team_id_pk" PRIMARY KEY("id","team_id")
58+
);
59+
--> statement-breakpoint
60+
CREATE TABLE "team_members" (
61+
"team_id" text NOT NULL,
62+
"user_id" text NOT NULL,
63+
"role" text NOT NULL,
64+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
65+
CONSTRAINT "team_members_team_id_user_id_pk" PRIMARY KEY("team_id","user_id")
66+
);
67+
--> statement-breakpoint
68+
CREATE TABLE "teams" (
69+
"id" text PRIMARY KEY NOT NULL,
70+
"name" text NOT NULL,
71+
"created_at" timestamp with time zone DEFAULT now() NOT NULL
72+
);
73+
--> statement-breakpoint
74+
CREATE TABLE "tool_definitions" (
75+
"name" text NOT NULL,
76+
"team_id" text NOT NULL,
77+
"schema" jsonb NOT NULL,
78+
CONSTRAINT "tool_definitions_name_team_id_pk" PRIMARY KEY("name","team_id")
79+
);
80+
--> statement-breakpoint
81+
CREATE TABLE "tools" (
82+
"id" text NOT NULL,
83+
"team_id" text NOT NULL,
84+
"source_id" text NOT NULL,
85+
"plugin_key" text NOT NULL,
86+
"name" text NOT NULL,
87+
"description" text,
88+
"may_elicit" boolean,
89+
"input_schema" jsonb,
90+
"output_schema" jsonb,
91+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
92+
CONSTRAINT "tools_id_team_id_pk" PRIMARY KEY("id","team_id")
93+
);
94+
--> statement-breakpoint
95+
CREATE TABLE "users" (
96+
"id" text PRIMARY KEY NOT NULL,
97+
"email" text NOT NULL,
98+
"name" text,
99+
"avatar_url" text,
100+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
101+
CONSTRAINT "users_email_unique" UNIQUE("email")
102+
);

0 commit comments

Comments
 (0)