veramo
veramo copied to clipboard
Migrations fail on new install
Bug severity 3
Describe the bug Migrations fail to execute due to missing table 'PreMigrationKey'
To Reproduce Create new DataSource using dbOptions set to use migrations from /data-store and migrationsRun:true. And initialize();
Observed behaviour 2.SimplifyRelations fails at line 16 - migrationGetExistingTableByName(queryRunner, 'PreMigrationKey', true) throws error as table does not exist.
Expected behaviour Exepect migrations to run and DB tables to be created.
Versions (please complete the following information):
- Veramo: 5.5.4 (@veramo/data-store": "^5.5.4-next.25)
- Browser Chrome and Firefox
- Node Version 18
Any updates on this issue?
I wasn't able to reproduce the issue. Can you provide a minimal project where this problem manifests?
We also experienced this issue. Specifically, an error occurs in our production build (NEXT.js, implementing Veramo version 6.0.0).
The issue, as far as I can tell - at least in our case - occurs as a result of the minifying of code resulting in abbreviated classnames, which are then used in the database schemas.
This is perhaps better explained through the use of the below visuals, whereby we print the keys in the database appear as follows:
Production Build (Minified Build)
Development Build (no minifying of code)
The screenshot with the list of truncated keys occurs in where the build is in production (and webpack is minifying the build output).
In NEXT.js for example, you can disable minifying the output bundle as follows:
// next.config.js
const nextConfig = {
...yourExistingConfigSettings,
webpack: (config, { dev }) => {
if (!dev) config.optimization.minimize = false;
return config;
},
};
I hope this helps.