chore: set as non-nullable after migration has completed

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2024-10-25 13:54:04 +02:00
parent fb62dd18d3
commit 7fbfd11389
2 changed files with 8 additions and 1 deletions
@@ -38,6 +38,13 @@ exports.up = async function up(knex) {
.where('r.entity_id', knex.raw('f.entity_id')),
})
.table('final_entities as f');
// SQLite does not support ALTER COLUMN.
if (!knex.client.config.client.includes('sqlite3')) {
await knex.schema.alterTable('final_entities', table => {
table.text('entity_ref').notNullable().alter({ alterNullable: true });
});
}
};
/**
@@ -179,7 +179,7 @@ export type DbFinalEntitiesRow = {
stitch_ticket: string;
final_entity?: string;
last_updated_at?: string | Date;
entity_ref?: string;
entity_ref: string;
};
export type DbSearchRow = {