@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, 06:00 UTC

main
json 158 lines 4.98 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 \"createdAt\" timestamptz DEFAULT (now()) NOT NULL,\n \"excerpt\" text NOT NULL,\n \"id\" text NOT NULL,\n \"title\" text NOT NULL,\n \"userId\" 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\" text 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": "index.post.post_userId_idx_a489d58a",
91 "label": "Create index \"post_userId_idx_a489d58a\" on \"post\"",
92 "operationClass": "additive",
93 "target": {
94 "id": "postgres",
95 "details": {
96 "schema": "public",
97 "objectType": "index",
98 "name": "post_userId_idx_a489d58a",
99 "table": "post"
100 }
101 },
102 "precheck": [
103 {
104 "description": "ensure index \"post_userId_idx_a489d58a\" does not exist",
105 "sql": "SELECT (to_regclass($1)) IS NULL AS \"result\"",
106 "params": ["\"public\".\"post_userId_idx_a489d58a\""]
107 }
108 ],
109 "execute": [
110 {
111 "description": "create index \"post_userId_idx_a489d58a\"",
112 "sql": "CREATE INDEX \"post_userId_idx_a489d58a\" ON \"public\".\"post\" (\"userId\")",
113 "params": []
114 }
115 ],
116 "postcheck": [
117 {
118 "description": "verify index \"post_userId_idx_a489d58a\" exists",
119 "sql": "SELECT (to_regclass($1)) IS NOT NULL AS \"result\"",
120 "params": ["\"public\".\"post_userId_idx_a489d58a\""]
121 }
122 ]
123 },
124 {
125 "id": "foreignKey.post.post_userId_fkey",
126 "label": "Add foreign key \"post_userId_fkey\" on \"post\"",
127 "operationClass": "additive",
128 "target": {
129 "id": "postgres",
130 "details": {
131 "schema": "public",
132 "objectType": "foreignKey",
133 "name": "post_userId_fkey",
134 "table": "post"
135 }
136 },
137 "precheck": [
138 {
139 "description": "ensure FK \"post_userId_fkey\" does not exist",
140 "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\"",
141 "params": ["post_userId_fkey", "public", "\"public\".\"post\""]
142 }
143 ],
144 "execute": [
145 {
146 "description": "add FK \"post_userId_fkey\"",
147 "sql": "ALTER TABLE \"public\".\"post\"\nADD CONSTRAINT \"post_userId_fkey\"\nFOREIGN KEY (\"userId\")\nREFERENCES \"public\".\"user\" (\"id\")"
148 }
149 ],
150 "postcheck": [
151 {
152 "description": "verify FK \"post_userId_fkey\" exists",
153 "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\"",
154 "params": ["post_userId_fkey", "public", "\"public\".\"post\""]
155 }
156 ]
157 }
158 ]