@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 07:15 UTC

main
json 123 lines 3.79 KB
Raw
1 [
2 {
3 "id": "schema.public",
4 "label": "Create schema \"public\"",
5 "operationClass": "additive",
6 "target": {
7 "id": "postgres"
8 },
9 "precheck": [],
10 "execute": [
11 {
12 "description": "Create schema \"public\"",
13 "sql": "CREATE SCHEMA IF NOT EXISTS \"public\"",
14 "params": []
15 }
16 ],
17 "postcheck": []
18 },
19 {
20 "id": "table.Post",
21 "label": "Create table \"Post\"",
22 "summary": "Creates table \"Post\"",
23 "operationClass": "additive",
24 "target": {
25 "id": "postgres",
26 "details": {
27 "schema": "public",
28 "objectType": "table",
29 "name": "Post"
30 }
31 },
32 "precheck": [
33 {
34 "description": "ensure table \"Post\" does not exist",
35 "sql": "SELECT (to_regclass($1)) IS NULL AS \"result\"",
36 "params": ["\"public\".\"Post\""]
37 }
38 ],
39 "execute": [
40 {
41 "description": "create table \"Post\"",
42 "sql": "CREATE TABLE \"public\".\"Post\" (\n \"authorId\" uuid NOT NULL,\n \"id\" uuid NOT NULL,\n \"title\" text NOT NULL,\n PRIMARY KEY (\"id\")\n)",
43 "params": []
44 }
45 ],
46 "postcheck": [
47 {
48 "description": "verify table \"Post\" exists",
49 "sql": "SELECT (to_regclass($1)) IS NOT NULL AS \"result\"",
50 "params": ["\"public\".\"Post\""]
51 }
52 ]
53 },
54 {
55 "id": "table.User",
56 "label": "Create table \"User\"",
57 "summary": "Creates table \"User\"",
58 "operationClass": "additive",
59 "target": {
60 "id": "postgres",
61 "details": {
62 "schema": "public",
63 "objectType": "table",
64 "name": "User"
65 }
66 },
67 "precheck": [
68 {
69 "description": "ensure table \"User\" does not exist",
70 "sql": "SELECT (to_regclass($1)) IS NULL AS \"result\"",
71 "params": ["\"public\".\"User\""]
72 }
73 ],
74 "execute": [
75 {
76 "description": "create table \"User\"",
77 "sql": "CREATE TABLE \"public\".\"User\" (\n \"createdAt\" timestamptz DEFAULT (now()) NOT NULL,\n \"email\" text NOT NULL,\n \"id\" uuid NOT NULL,\n \"name\" text NOT NULL,\n PRIMARY KEY (\"id\")\n)",
78 "params": []
79 }
80 ],
81 "postcheck": [
82 {
83 "description": "verify table \"User\" exists",
84 "sql": "SELECT (to_regclass($1)) IS NOT NULL AS \"result\"",
85 "params": ["\"public\".\"User\""]
86 }
87 ]
88 },
89 {
90 "id": "unique.User.User_email_key",
91 "label": "Add unique constraint on \"User\" (email)",
92 "operationClass": "additive",
93 "target": {
94 "id": "postgres",
95 "details": {
96 "schema": "public",
97 "objectType": "unique",
98 "name": "User_email_key",
99 "table": "User"
100 }
101 },
102 "precheck": [
103 {
104 "description": "ensure constraint \"User_email_key\" does not exist",
105 "sql": "SELECT NOT EXISTS (SELECT 1 AS \"one\" FROM \"pg_constraint\" AS \"c\" INNER JOIN \"pg_namespace\" AS \"n\" ON \"n\".\"oid\" = \"c\".\"connamespace\" WHERE (\"c\".\"conname\" = $1 AND \"n\".\"nspname\" = $2 AND \"c\".\"conrelid\" = to_regclass($3))) AS \"result\"",
106 "params": ["User_email_key", "public", "\"public\".\"User\""]
107 }
108 ],
109 "execute": [
110 {
111 "description": "add unique constraint \"User_email_key\"",
112 "sql": "ALTER TABLE \"public\".\"User\" ADD CONSTRAINT \"User_email_key\" UNIQUE (\"email\")"
113 }
114 ],
115 "postcheck": [
116 {
117 "description": "verify constraint \"User_email_key\" exists",
118 "sql": "SELECT EXISTS (SELECT 1 AS \"one\" FROM \"pg_constraint\" AS \"c\" INNER JOIN \"pg_namespace\" AS \"n\" ON \"n\".\"oid\" = \"c\".\"connamespace\" WHERE (\"c\".\"conname\" = $1 AND \"n\".\"nspname\" = $2 AND \"c\".\"conrelid\" = to_regclass($3))) AS \"result\"",
119 "params": ["User_email_key", "public", "\"public\".\"User\""]
120 }
121 ]
122 }
123 ]