nuxt-hub / core

Build full-stack applications with Nuxt on CloudFlare, with zero configuration.
https://hub.nuxt.com
Apache License 2.0
993 stars 57 forks source link

_hub_migrations table not created on dev/local env #340

Closed kido1611 closed 3 weeks ago

kido1611 commented 3 weeks ago

Describe the bug Got an error no such table _hub_migrations when running npx nuxt dev

 ERROR  [nitro] [unhandledRejection] D1_ERROR: no such table: _hub_migrations: SQLITE_ERROR

  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at applyMigrations (node_modules/.pnpm/@nuxthub+core@0.8.0_ioredis@5.4.1_magicast@0.3.5_rollup@4.24.0_vite@5.4.8_@types+node@22.7.5__mmi5pjmiqd25qwhgrgntsw64k4/node_modules/@nuxthub/core/dist/runtime/database/server/utils/migrations/migrations.js:7:30)
  at <anonymous> (node_modules/.pnpm/@nuxthub+core@0.8.0_ioredis@5.4.1_magicast@0.3.5_rollup@4.24.0_vite@5.4.8_@types+node@22.7.5__mmi5pjmiqd25qwhgrgntsw64k4/node_modules/@nuxthub/core/dist/runtime/database/server/plugins/migrations.dev.js:13:7)
  at async Promise.all (index 0)
  at <anonymous> (node_modules/.pnpm/@nuxthub+core@0.8.0_ioredis@5.4.1_magicast@0.3.5_rollup@4.24.0_vite@5.4.8_@types+node@22.7.5__mmi5pjmiqd25qwhgrgntsw64k4/node_modules/@nuxthub/core/dist/runtime/ready.dev.js:5:3)

Steps to reproduce

  1. Create nuxt app with latest version of nuxthub (0.8.0)
  2. Enable nuxthub database
  3. Create a sql migration
  4. Run npx nuxt dev / pnpm dev

Or using this repository: https://github.com/kido1611/nuxthub-error-auto-migrations

Expected behavior _hub_migrations should be automatically created if not exist in local environment.

atinux commented 3 weeks ago

It's fixed in https://github.com/nuxt-hub/core/releases/tag/v0.8.1

Thank you for the quick reproduction and bug report 🙏