diff --git a/.changeset/tired-bushes-write.md b/.changeset/tired-bushes-write.md new file mode 100644 index 0000000000..af49530ef4 --- /dev/null +++ b/.changeset/tired-bushes-write.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend': patch +--- + +Update migrations to be reversible diff --git a/plugins/auth-backend/migrations/20200619125845_init.js b/plugins/auth-backend/migrations/20200619125845_init.js index d5fc08ce48..a53ac46ea9 100644 --- a/plugins/auth-backend/migrations/20200619125845_init.js +++ b/plugins/auth-backend/migrations/20200619125845_init.js @@ -42,5 +42,5 @@ exports.up = async function up(knex) { * @param {import('knex').Knex} knex */ exports.down = async function down(knex) { - return knex.schema.dropTable('auth_keystore'); + return knex.schema.dropTable('signing_keys'); }; diff --git a/plugins/auth-backend/migrations/20220321100910_timestamptz_again.js b/plugins/auth-backend/migrations/20220321100910_timestamptz_again.js index ab7e713b96..86a87ebe7c 100644 --- a/plugins/auth-backend/migrations/20220321100910_timestamptz_again.js +++ b/plugins/auth-backend/migrations/20220321100910_timestamptz_again.js @@ -48,7 +48,7 @@ exports.down = async function down(knex) { if (!knex.client.config.client.includes('sqlite3')) { await knex.schema.alterTable('signing_keys', table => { table - .timestamp('created_at', { useTz: false, precision: 0 }) + .timestamp('created_at', { useTz: true, precision: 0 }) .notNullable() .defaultTo(knex.fn.now()) .comment('The creation time of the key') diff --git a/plugins/auth-backend/report.sql.md b/plugins/auth-backend/report.sql.md index 4dc160a2bf..2da5473734 100644 --- a/plugins/auth-backend/report.sql.md +++ b/plugins/auth-backend/report.sql.md @@ -2,9 +2,6 @@ > Do not edit this file. It is a report generated by `yarn build:api-reports` -> [!WARNING] -> Failed to migrate down from '20220321100910_timestamptz_again.js' - ## Table `oauth_authorization_sessions` | Column | Type | Nullable | Max Length | Default |