Hello I need help with next-on-pages, I
Hello I need help with next-on-pages, I have a remote D1 database, and added it locally too. I did some migration with drizzle and everything worked fine and the data persisted locally to a sqlite file (say X). But when I follow the steps in next-on-pages/next-dev to use bindings inside next.js app, it does not use the file X, instead, it creates new file Y which has no migrations. Any solutions to his behavior? I tried to see if there is a way to make the next.js local binding use file X but I found nothing.
7 Replies
Was happening to me. I set
databaseName in the binding to be the database ID instead of the name and it worked@yeehow like this?
Yeah, whatever you have for
database_id in your wrangler.tomlFirst of all thank you! It worked but by setting
databaseName to the binding in the wrangler.toml I found this due to the way they generate those strings below
This will output the exact same .sqlite file nameSo you did
databaseName: "DB" ?yes
Oh cool! That is much easier