Releases: anchan828/nest-kysely
Releases · anchan828/nest-kysely
v0.7.0
Breaking changes
Migration functionality has been separated to @anchan828/kysely-migration. Import paths for all migrations have changed.
import { KyselyMigrationClassProvider } from "@anchan828/nest-kysely";
↓
import { KyselyMigrationClassProvider } from "@anchan828/kysely-migration";
What's Changed
- chore(deps): update all dependencies by @renovate in #337
- chore(deps): update dependency typescript-eslint to v8.4.0 by @renovate in #338
- chore(deps): update dependency @types/node to v20.16.4 by @renovate in #339
- chore(deps): update dependency @types/node to v20.16.5 by @renovate in #340
- chore(deps): update eslint to v9.10.0 by @renovate in #341
- feat: add migration packages by @anchan828 in #342
Full Changelog: v0.6.5...v0.7.0
v0.5.0
Repeatable Migrations
This is a feature to support migrations that need to be regenerated multiple times, such as views/functions/triggers/etc. Unlike migrations that are executed only once, it compares the checksum of the SQL to be executed to determine the need for migration.
KyselyModule.register({
dialect: createDialect(),
repeatableMigrations: {
migrationsRun: true,
migratorProps: {
provider: new KyselyRepeatableMigrationSqlFileProvider({
sqlFiles: [resolve(__dirname, "user-view.sql")],
sqlTexts: [{ name: "test", sql: "SELECT 1;" }],
}),
},
},
});
name | hash | timestamp |
---|---|---|
user-view | 6c7e36422f79696602e19079534b4076 | 2024-05-11T17:04:20.211Z |
test | e7d6c7d4d9b1b0b4c7f5d7b3d5e9d4d4 | 2024-05-11T17:04:20.211Z |
Note
- Once the file is renamed, the migration is executed even if the contents have not changed.
- Views/Functions/Triggers created by Repeatable Migration are not automatically deleted (or update/rename) by simply deleting the corresponding SQL, so please delete them using the normal migration function.
v0.4.0
v0.3.0
v0.2.0
Breaking Changes
There was a bug that KyselyMigrationProvider could not generate more than 10 migration files. This version fixes the problem, but the name does not match the name registered in the migration table. Therefore, if you have already run the migration, please fix it as follows.
const provider = new KyselyMigrationProvider(migrationClasses, {
prefixFn: (index) => {
if (index <= 9) {
return index.toString();
}
return `9${index}`.padEnd(8, "0");
},
});