How can I reset migrations timestamp

I am using drizzle in one of my projects and somehow the timestamp of migrations were wrong. Trying to fix it, I edited, by hand, the timestamp value in meta/_journal.json, increasing the timestamp value present in when key. The value I put there is far in the future, and because of that, every new migration that I create is not running due to that inconsistency. So my question is: Can I fix it? How? My meta/_journal.json looks like this:
{
"version": "5",
"dialect": "pg",
"entries": [
{
"idx": 0,
"version": "5",
"when": 1714512333166,
"tag": "0000_pale_bushwacker",
"breakpoints": true
},
{
"idx": 0,
"version": "5",
"when": 1814512333166,
"tag": "0001_insert_accounts_subaccounts",
"breakpoints": true
},
{
"idx": 1,
"version": "5",
"when": 1915460163263,
"tag": "0001_square_nighthawk",
"breakpoints": true
},
{
"idx": 2,
"version": "5",
"when": 2015641951701,
"tag": "0002_light_blonde_phantom",
"breakpoints": true
},
{
"idx": 3,
"version": "5",
"when": 2115641951701,
"tag": "0003_closed_vision",
"breakpoints": true
},
{
"idx": 4,
"version": "5",
"when": 1721225335701,
"tag": "0004_vengeful_wildside",
"breakpoints": true
},
{
"idx": 5,
"version": "5",
"when": 1721931317327,
"tag": "0005_overjoyed_marvel_apes",
"breakpoints": true
}
]
}
{
"version": "5",
"dialect": "pg",
"entries": [
{
"idx": 0,
"version": "5",
"when": 1714512333166,
"tag": "0000_pale_bushwacker",
"breakpoints": true
},
{
"idx": 0,
"version": "5",
"when": 1814512333166,
"tag": "0001_insert_accounts_subaccounts",
"breakpoints": true
},
{
"idx": 1,
"version": "5",
"when": 1915460163263,
"tag": "0001_square_nighthawk",
"breakpoints": true
},
{
"idx": 2,
"version": "5",
"when": 2015641951701,
"tag": "0002_light_blonde_phantom",
"breakpoints": true
},
{
"idx": 3,
"version": "5",
"when": 2115641951701,
"tag": "0003_closed_vision",
"breakpoints": true
},
{
"idx": 4,
"version": "5",
"when": 1721225335701,
"tag": "0004_vengeful_wildside",
"breakpoints": true
},
{
"idx": 5,
"version": "5",
"when": 1721931317327,
"tag": "0005_overjoyed_marvel_apes",
"breakpoints": true
}
]
}
1 Reply
matheus
matheusOP5mo ago
I figured it out. I need to update created_at timestamp at the database, where drizzle stores and check if the oldest migration is older than the newest one.
Want results from more Discord servers?
Add your server