Skip to content

Commit 99dfe19

Browse files
authored
Fix the migration with journal reference (#493)
1 parent 17848a3 commit 99dfe19

File tree

3 files changed

+299
-2
lines changed

3 files changed

+299
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ALTER TABLE `config` ADD `openrouter_api_key` text;
1+
ALTER TABLE `config` ADD `openrouter_api_key` text;
Lines changed: 290 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,290 @@
1+
{
2+
"version": "6",
3+
"dialect": "sqlite",
4+
"id": "f20efb4d-77a9-41b3-9aa0-43192b59caef",
5+
"prevId": "e4b05cbe-90d2-41a7-96fc-2130bd54bc16",
6+
"tables": {
7+
"apps": {
8+
"name": "apps",
9+
"columns": {
10+
"id": {
11+
"name": "id",
12+
"type": "integer",
13+
"primaryKey": true,
14+
"notNull": true,
15+
"autoincrement": false
16+
},
17+
"name": {
18+
"name": "name",
19+
"type": "text",
20+
"primaryKey": false,
21+
"notNull": true,
22+
"autoincrement": false
23+
},
24+
"external_id": {
25+
"name": "external_id",
26+
"type": "text",
27+
"primaryKey": false,
28+
"notNull": true,
29+
"autoincrement": false
30+
},
31+
"history": {
32+
"name": "history",
33+
"type": "text",
34+
"primaryKey": false,
35+
"notNull": true,
36+
"autoincrement": false,
37+
"default": "'[]'"
38+
},
39+
"history_version": {
40+
"name": "history_version",
41+
"type": "integer",
42+
"primaryKey": false,
43+
"notNull": true,
44+
"autoincrement": false,
45+
"default": 1
46+
},
47+
"created_at": {
48+
"name": "created_at",
49+
"type": "integer",
50+
"primaryKey": false,
51+
"notNull": true,
52+
"autoincrement": false,
53+
"default": "(unixepoch())"
54+
},
55+
"updated_at": {
56+
"name": "updated_at",
57+
"type": "integer",
58+
"primaryKey": false,
59+
"notNull": true,
60+
"autoincrement": false,
61+
"default": "(unixepoch())"
62+
}
63+
},
64+
"indexes": {
65+
"apps_external_id_unique": {
66+
"name": "apps_external_id_unique",
67+
"columns": [
68+
"external_id"
69+
],
70+
"isUnique": true
71+
}
72+
},
73+
"foreignKeys": {},
74+
"compositePrimaryKeys": {},
75+
"uniqueConstraints": {}
76+
},
77+
"config": {
78+
"name": "config",
79+
"columns": {
80+
"base_dir": {
81+
"name": "base_dir",
82+
"type": "text",
83+
"primaryKey": false,
84+
"notNull": true,
85+
"autoincrement": false
86+
},
87+
"default_language": {
88+
"name": "default_language",
89+
"type": "text",
90+
"primaryKey": false,
91+
"notNull": true,
92+
"autoincrement": false,
93+
"default": "'typescript'"
94+
},
95+
"openai_api_key": {
96+
"name": "openai_api_key",
97+
"type": "text",
98+
"primaryKey": false,
99+
"notNull": false,
100+
"autoincrement": false
101+
},
102+
"anthropic_api_key": {
103+
"name": "anthropic_api_key",
104+
"type": "text",
105+
"primaryKey": false,
106+
"notNull": false,
107+
"autoincrement": false
108+
},
109+
"xai_api_key": {
110+
"name": "xai_api_key",
111+
"type": "text",
112+
"primaryKey": false,
113+
"notNull": false,
114+
"autoincrement": false
115+
},
116+
"gemini_api_key": {
117+
"name": "gemini_api_key",
118+
"type": "text",
119+
"primaryKey": false,
120+
"notNull": false,
121+
"autoincrement": false
122+
},
123+
"openrouter_api_key": {
124+
"name": "openrouter_api_key",
125+
"type": "text",
126+
"primaryKey": false,
127+
"notNull": false,
128+
"autoincrement": false
129+
},
130+
"custom_api_key": {
131+
"name": "custom_api_key",
132+
"type": "text",
133+
"primaryKey": false,
134+
"notNull": false,
135+
"autoincrement": false
136+
},
137+
"enabled_analytics": {
138+
"name": "enabled_analytics",
139+
"type": "integer",
140+
"primaryKey": false,
141+
"notNull": true,
142+
"autoincrement": false,
143+
"default": true
144+
},
145+
"srcbook_installation_id": {
146+
"name": "srcbook_installation_id",
147+
"type": "text",
148+
"primaryKey": false,
149+
"notNull": true,
150+
"autoincrement": false,
151+
"default": "'s6qi7h4bk4014r3sm1kuvfrfac'"
152+
},
153+
"ai_provider": {
154+
"name": "ai_provider",
155+
"type": "text",
156+
"primaryKey": false,
157+
"notNull": true,
158+
"autoincrement": false,
159+
"default": "'openai'"
160+
},
161+
"ai_model": {
162+
"name": "ai_model",
163+
"type": "text",
164+
"primaryKey": false,
165+
"notNull": false,
166+
"autoincrement": false,
167+
"default": "'gpt-4o'"
168+
},
169+
"ai_base_url": {
170+
"name": "ai_base_url",
171+
"type": "text",
172+
"primaryKey": false,
173+
"notNull": false,
174+
"autoincrement": false
175+
},
176+
"subscription_email": {
177+
"name": "subscription_email",
178+
"type": "text",
179+
"primaryKey": false,
180+
"notNull": false,
181+
"autoincrement": false
182+
}
183+
},
184+
"indexes": {},
185+
"foreignKeys": {},
186+
"compositePrimaryKeys": {},
187+
"uniqueConstraints": {}
188+
},
189+
"secrets": {
190+
"name": "secrets",
191+
"columns": {
192+
"id": {
193+
"name": "id",
194+
"type": "integer",
195+
"primaryKey": true,
196+
"notNull": true,
197+
"autoincrement": false
198+
},
199+
"name": {
200+
"name": "name",
201+
"type": "text",
202+
"primaryKey": false,
203+
"notNull": true,
204+
"autoincrement": false
205+
},
206+
"value": {
207+
"name": "value",
208+
"type": "text",
209+
"primaryKey": false,
210+
"notNull": true,
211+
"autoincrement": false
212+
}
213+
},
214+
"indexes": {
215+
"secrets_name_unique": {
216+
"name": "secrets_name_unique",
217+
"columns": [
218+
"name"
219+
],
220+
"isUnique": true
221+
}
222+
},
223+
"foreignKeys": {},
224+
"compositePrimaryKeys": {},
225+
"uniqueConstraints": {}
226+
},
227+
"secrets_to_sessions": {
228+
"name": "secrets_to_sessions",
229+
"columns": {
230+
"id": {
231+
"name": "id",
232+
"type": "integer",
233+
"primaryKey": true,
234+
"notNull": true,
235+
"autoincrement": false
236+
},
237+
"session_id": {
238+
"name": "session_id",
239+
"type": "text",
240+
"primaryKey": false,
241+
"notNull": true,
242+
"autoincrement": false
243+
},
244+
"secret_id": {
245+
"name": "secret_id",
246+
"type": "integer",
247+
"primaryKey": false,
248+
"notNull": true,
249+
"autoincrement": false
250+
}
251+
},
252+
"indexes": {
253+
"secrets_to_sessions_session_id_secret_id_unique": {
254+
"name": "secrets_to_sessions_session_id_secret_id_unique",
255+
"columns": [
256+
"session_id",
257+
"secret_id"
258+
],
259+
"isUnique": true
260+
}
261+
},
262+
"foreignKeys": {
263+
"secrets_to_sessions_secret_id_secrets_id_fk": {
264+
"name": "secrets_to_sessions_secret_id_secrets_id_fk",
265+
"tableFrom": "secrets_to_sessions",
266+
"tableTo": "secrets",
267+
"columnsFrom": [
268+
"secret_id"
269+
],
270+
"columnsTo": [
271+
"id"
272+
],
273+
"onDelete": "no action",
274+
"onUpdate": "no action"
275+
}
276+
},
277+
"compositePrimaryKeys": {},
278+
"uniqueConstraints": {}
279+
}
280+
},
281+
"enums": {},
282+
"_meta": {
283+
"schemas": {},
284+
"tables": {},
285+
"columns": {}
286+
},
287+
"internal": {
288+
"indexes": {}
289+
}
290+
}

packages/api/drizzle/meta/_journal.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@
113113
"when": 1737324288698,
114114
"tag": "0015_add_custom_api_key",
115115
"breakpoints": true
116+
},
117+
{
118+
"idx": 16,
119+
"version": "6",
120+
"when": 1743191674243,
121+
"tag": "0016_add_openrouter_api_key",
122+
"breakpoints": true
116123
}
117124
]
118-
}
125+
}

0 commit comments

Comments
 (0)