fix(auth): user_created_at migration non constant defaults to remedy SQLiteError
Signed-off-by: Justin Bryant <justintbry@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-auth-backend': minor
|
||||
---
|
||||
|
||||
Fix user_created_at migration causing SQLiteError regarding use of non-constants for defaults
|
||||
@@ -22,7 +22,19 @@
|
||||
exports.up = async function up(knex) {
|
||||
await knex.schema.alterTable('user_info', table => {
|
||||
table.renameColumn('exp', 'updated_at');
|
||||
table.timestamp('created_at').notNullable().defaultTo(knex.fn.now());
|
||||
table.timestamp('created_at').nullable();
|
||||
});
|
||||
|
||||
await knex('user_info').update({
|
||||
created_at: knex.fn.now(),
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('user_info', table => {
|
||||
table
|
||||
.timestamp('created_at')
|
||||
.notNullable()
|
||||
.defaultTo(knex.fn.now())
|
||||
.alter();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user