SQLite migrations are not being applied
First time using SQLite and drizzleORM, so forgive me if this is a stupid question. I've been trying to set this up for an hour now.
I have installed drizzleORM and drizzle-kit, I've added the setup from the docs and I have ran my first migration with
drizzle-kit generate:sqlite
. I have a db file in my root and folder with the migration that creates a users
table.
I get an error when I try query the users
table, saying it does not exist.18 Replies
this is my folder structure:
This is my code so far:
When I run
getUsers()
I get an error that the users table does not exist.
You generated the migrations. Now you have to actually apply them to the DB.
Does this not do that for me?
Yeah, it should
No errors when I start the server, so it seems to do something right.
@Andrii Sherman help needed
👀
I can make the repo public if that helps. It's just boilerplate code right now so no big deal
yeah, would be great
will help me a lot
GitHub
GitHub - sandervspl/prime-env
Contribute to sandervspl/prime-env development by creating an account on GitHub.
okey, could you please remove migrations folder and run
generate:sqlite
1 more time?
and then run your scriptsure
yeah that worked 🤔
"did you try turning it off and on again"
lmao yep
I guess it didnt add the migration to the entries in the journal?
thats what I see in the git diff
case was that
_journal
for some reason was empty
I guess you tried to run migration firstly and did have some problems with that, so journal remained empty
yes
We will add this part to backlog
so drizzle-kit will chek journal
and warn you if needed
thanks for the great case!Okay! Thanks for the help 🙂
I read that as "warm you if needed"
could be a useful feature
Haha my struggle is not for nothing