Ich benutze sqlite. Ich muss eine date
Spalte not nullable
erstellen. Ich versuche es, aber nicht funktioniert.Wie erstelle ich eine Datumsspalte, die nicht nullbar ist?
return knex.schema.table("my_table", (table) => {
table.date("important_day").notNullable().defaultTo(knex.fn.now());
});
Mit diesem Code erhielt ich diese Fehlermeldung:
Unhandled rejection Error:
SQLITE_ERROR
: Cannot add a column with non-constant default. Knex:warning - migrations failed with error: alter tableminisermao
add columndiaminisermao
date not null defaultCURRENT_TIMESTAMP - SQLITE_ERROR
: Cannot add a column with non-constant default
Wie es zu beheben?