Unable to upgrade migrations if there are ones that do not change state but manipulate data

Hi! I have 0.16.x migrations. At some point, I needed to manipulate the data without changing the db structure, so I just made a copy of the latest migration, assigned new ID in snapshot.json and added my sql code. It worked fine, but when I moved to [email protected] and tried to upgrade the migrations, I got the following errors:
Everything's fine :dog::fire:
{
code: 'invalid_type',
expected: 'array',
received: 'undefined',
path: [ 'deletedSchemas' ],
message: 'Required'
}
...More validation errors here
/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:17324
throw new Error();
^

Error
at fullfillpg (/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:17324:15)
at fullfill (/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:17300:16)
at /home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:17593:29
at Array.forEach (<anonymous>)
at upgradeFolders (/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:17584:19)
at Command2.<anonymous> (/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:49584:3)
at Command2.listener [as _actionHandler] (/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:856:21)
at /home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:1284:69
at Command2._chainOrCall (/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:1216:16)
at Command2._parseCommand (/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:1284:31)
Everything's fine :dog::fire:
{
code: 'invalid_type',
expected: 'array',
received: 'undefined',
path: [ 'deletedSchemas' ],
message: 'Required'
}
...More validation errors here
/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:17324
throw new Error();
^

Error
at fullfillpg (/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:17324:15)
at fullfill (/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:17300:16)
at /home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:17593:29
at Array.forEach (<anonymous>)
at upgradeFolders (/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:17584:19)
at Command2.<anonymous> (/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:49584:3)
at Command2.listener [as _actionHandler] (/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:856:21)
at /home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:1284:69
at Command2._chainOrCall (/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:1216:16)
at Command2._parseCommand (/home/robert/Projects/my-project/node_modules/drizzle-kit/index.js:1284:31)
If I delete the one I created (20230214133201) and fix ids in previous and next, then upgrade works as expected. How can I solve this without removing the migration?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server