File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -47,15 +47,14 @@ export default definePreset({
4747 async setupNitro ( nitroConfig , options ) {
4848 const { nuxt } = options as unknown as { nuxt : Nuxt & { options : { hub : { db ?: boolean | object , database ?: boolean } } } }
4949 const hubConfig = nuxt . options . runtimeConfig . hub as unknown as { db : unknown & { applyMigrationsDuringBuild ?: boolean } , dir : string }
50- const nuxthubVersion = nuxt . options . hub ?. database === true ? 0.9 : 0.10
5150 // NuxtHub <= 0.9
52- if ( nuxthubVersion <= 0.9 ) {
51+ if ( nuxt . options . hub ?. database === true ) {
5352 if ( nitroConfig . runtimeConfig ?. content ?. database ?. type === 'sqlite' ) {
5453 logger . warn ( 'Deploying with NuxtHub < 1 requires using D1 database, switching to D1 database with binding `DB`.' )
5554 nitroConfig . runtimeConfig ! . content ! . database = { type : 'd1' , bindingName : 'DB' }
5655 }
5756 }
58- else if ( nuxthubVersion >= 0.10 ) {
57+ else if ( typeof nuxt . options . hub ?. db === 'string' && typeof hubConfig . db === 'object' ) {
5958 const hubDb = hubConfig . db as unknown as { driver : string , connection : object }
6059 if ( hubDb . driver === 'd1' ) {
6160 nitroConfig . runtimeConfig ! . content ! . database ||= { type : 'd1' , bindingName : 'DB' }
You can’t perform that action at this time.
0 commit comments