@@ -23,12 +23,12 @@ export const adder = defineAdderConfig({
23
23
options : availableOptions ,
24
24
integrationType : 'inline' ,
25
25
packages : [
26
- { name : 'drizzle-orm' , version : '^0.31.2 ' , dev : false } ,
26
+ { name : 'drizzle-orm' , version : '^0.33.0 ' , dev : false } ,
27
27
{ name : 'drizzle-kit' , version : '^0.22.0' , dev : true } ,
28
28
// MySQL
29
29
{
30
30
name : 'mysql2' ,
31
- version : '^3.9.8 ' ,
31
+ version : '^3.11.0 ' ,
32
32
dev : false ,
33
33
condition : ( { options } ) => options . mysql === 'mysql2'
34
34
} ,
@@ -41,7 +41,7 @@ export const adder = defineAdderConfig({
41
41
// PostgreSQL
42
42
{
43
43
name : '@neondatabase/serverless' ,
44
- version : '^0.9.3 ' ,
44
+ version : '^0.9.4 ' ,
45
45
dev : false ,
46
46
condition : ( { options } ) => options . postgresql === 'neon'
47
47
} ,
@@ -54,19 +54,19 @@ export const adder = defineAdderConfig({
54
54
// SQLite
55
55
{
56
56
name : 'better-sqlite3' ,
57
- version : '^10.0.0 ' ,
57
+ version : '^11.1.2 ' ,
58
58
dev : false ,
59
59
condition : ( { options } ) => options . sqlite === 'better-sqlite3'
60
60
} ,
61
61
{
62
62
name : '@types/better-sqlite3' ,
63
- version : '^7.6.10 ' ,
63
+ version : '^7.6.11 ' ,
64
64
dev : true ,
65
65
condition : ( { options } ) => options . sqlite === 'better-sqlite3'
66
66
} ,
67
67
{
68
68
name : '@libsql/client' ,
69
- version : '^0.6.1 ' ,
69
+ version : '^0.9.0 ' ,
70
70
dev : false ,
71
71
condition : ( { options } ) => options . sqlite === 'libsql' || options . sqlite === 'turso'
72
72
}
@@ -147,7 +147,9 @@ export const adder = defineAdderConfig({
147
147
content : ( { content } ) => {
148
148
if ( content . length === 0 ) return content ;
149
149
150
- if ( ! content . includes ( '\n*.db' ) ) content = content . trimEnd ( ) + '\n*.db' ;
150
+ if ( ! content . includes ( '\n*.db' ) ) {
151
+ content = content . trimEnd ( ) + '\n\n# SQLite\n*.db' ;
152
+ }
151
153
return content ;
152
154
}
153
155
} ,
@@ -210,7 +212,6 @@ export const adder = defineAdderConfig({
210
212
211
213
userSchemaExpression = common . expressionFromString ( `sqliteTable('user', {
212
214
id: integer('id').primaryKey(),
213
- name: text('name').notNull(),
214
215
age: integer('age')
215
216
})` ) ;
216
217
}
@@ -223,8 +224,7 @@ export const adder = defineAdderConfig({
223
224
} ) ;
224
225
225
226
userSchemaExpression = common . expressionFromString ( `mysqlTable('user', {
226
- id: serial("id").primaryKey(),
227
- name: text('name').notNull(),
227
+ id: serial('id').primaryKey(),
228
228
age: int('age'),
229
229
})` ) ;
230
230
}
@@ -238,7 +238,6 @@ export const adder = defineAdderConfig({
238
238
239
239
userSchemaExpression = common . expressionFromString ( `pgTable('user', {
240
240
id: serial('id').primaryKey(),
241
- name: text('name').notNull(),
242
241
age: integer('age'),
243
242
})` ) ;
244
243
}
@@ -257,7 +256,7 @@ export const adder = defineAdderConfig({
257
256
258
257
// env var checks
259
258
const dbURLCheck = common . statementFromString (
260
- ' if (!env.DATABASE_URL) throw new Error(" DATABASE_URL is not set");'
259
+ ` if (!env.DATABASE_URL) throw new Error(' DATABASE_URL is not set');`
261
260
) ;
262
261
common . addStatement ( ast , dbURLCheck ) ;
263
262
@@ -277,7 +276,7 @@ export const adder = defineAdderConfig({
277
276
imports . addNamed ( ast , '$app/environment' , { dev : 'dev' } ) ;
278
277
// auth token check in prod
279
278
const authTokenCheck = common . statementFromString (
280
- ' if (!dev && !env.DATABASE_AUTH_TOKEN) throw new Error(" DATABASE_AUTH_TOKEN is not set");'
279
+ ` if (!dev && !env.DATABASE_AUTH_TOKEN) throw new Error(' DATABASE_AUTH_TOKEN is not set');`
281
280
) ;
282
281
common . addStatement ( ast , authTokenCheck ) ;
283
282
@@ -329,8 +328,15 @@ export const adder = defineAdderConfig({
329
328
}
330
329
}
331
330
] ,
332
- nextSteps : ( ) => {
333
- const steps = [ 'You will need to set DATABASE_URL in your production environment' ] ;
331
+ nextSteps : ( { options, colors } ) => {
332
+ const highlight = ( str : string ) => colors . bold ( colors . cyan ( str ) ) ;
333
+ const steps = [
334
+ `You will need to set ${ colors . yellow ( 'DATABASE_URL' ) } in your production environment`
335
+ ] ;
336
+ if ( options . docker ) {
337
+ steps . push ( `Run ${ highlight ( 'npm run db:start' ) } to start the docker container` ) ;
338
+ }
339
+ steps . push ( `To update your DB schema, run ${ highlight ( 'npm run db:push' ) } ` ) ;
334
340
335
341
return steps ;
336
342
}
0 commit comments