[Bug] Postgres migrations are broken on 0.23.10

Re-running the same postgres migration twice just throws an error that a particular table already exists. It looks like its always trying to deploy the first migration instead of using drizzle migrations table to reference and compare hashes
13 Replies
rushil1o1
rushil1o1OP2y ago
@bloberenober @Andrii Sherman can you let me know if this is a regression - not sure whats going on...
Andrii Sherman
@rushil1o1 would be great if you can share a content of meta._journal,json and drizzle.__drizzle_migrations table There shouldn't be any sensitive info, but will help a bit to find a cause
rushil1o1
rushil1o1OP2y ago
For sure
{
"version": "5",
"dialect": "pg",
"entries": [
{
"idx": 0,
"version": "5",
"when": 1680193173067,
"tag": "0000_init"
},
{
"idx": 1,
"version": "5",
"when": 1680547351935,
"tag": "0001_add_reward_index"
},
{
"idx": 2,
"version": "5",
"when": 1680742115908,
"tag": "0002_add_card_art"
},
{
"idx": 3,
"version": "5",
"when": 1680747020431,
"tag": "0003_add_dispute_id_transaction"
}
]
}
{
"version": "5",
"dialect": "pg",
"entries": [
{
"idx": 0,
"version": "5",
"when": 1680193173067,
"tag": "0000_init"
},
{
"idx": 1,
"version": "5",
"when": 1680547351935,
"tag": "0001_add_reward_index"
},
{
"idx": 2,
"version": "5",
"when": 1680742115908,
"tag": "0002_add_card_art"
},
{
"idx": 3,
"version": "5",
"when": 1680747020431,
"tag": "0003_add_dispute_id_transaction"
}
]
}
rushil1o1
rushil1o1OP2y ago
Andrii Sherman
thanks!
rushil1o1
rushil1o1OP2y ago
FYI: its easily reproducible for us -- re-running the migration command twice will throw an error instead of just succeeding
Dan
Dan2y ago
Could you enable the query logging by passing {logger: true} to the drizzle() call and post the queries that the migrator runs? (you can filter out your actual migrations from the logs, I'm just interested in the queries added by the migrator)
rushil1o1
rushil1o1OP2y ago
Andrii Sherman
one last question I guess what driver do you use for migration? pg or postgres.js? also did this issue appear after some update? or you never run migrations previously
rushil1o1
rushil1o1OP2y ago
drizzle-orm/node-postgres/migrator happened from 0.23.8 -> 0.23.9/10
Andrii Sherman
ok, great thanks for all the info. Checking it now @rushil1o1 just found going to release fix and add tests for that asap [email protected] please try this out
rushil1o1
rushil1o1OP2y ago
Perfect will try soon yup - all good, works @Andrii Sherman - thank you!
Andrii Sherman
Thank you also. It was a critical one for everyone using Postgres You helped us to find a problem faster
Want results from more Discord servers?
Add your server