You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Make sure to create the _hub_migrations table if it doesn't exist
114
-
awaitdatabase.prepare('CREATE TABLE IF NOT EXISTS _hub_migrations (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, created_at INTEGER NOT NULL)').run()
115
-
116
-
// Get applied migrations from database
117
-
const hubMigrations =awaitdatabase.prepare('SELECT * FROM _hub_migrations').all()
This solution is will create a `_hub_migrations` table in your database to keep track of the applied migrations. It will also run the migrations automatically in development mode.
116
+
Drizzle will create a `__drizzle_migrations` table in your database to keep track of the applied migrations. It will also run the migrations automatically in development mode.
117
+
::
118
+
119
+
To apply the migrations in staging or production, you can run the server using `npx nuxi dev --remote` command to connect your local server to the remote database, learn more about [remote storage](/docs/getting-started/remote-storage).
120
+
121
+
::note
122
+
We are planning to update this section to leverage [Nitro Tasks](https://nitro.unjs.io/guide/tasks) instead of a server plugin in the future.
0 commit comments