1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Server: Fix migrations

This commit is contained in:
Laurent Cozic 2021-08-13 22:19:20 +01:00
parent f518549cfe
commit a9961ae3ec

View File

@ -2,9 +2,13 @@ import { Knex } from 'knex';
import { DbConnection } from '../db';
export async function up(db: DbConnection): Promise<any> {
await db.schema.alterTable('emails', function(table: Knex.CreateTableBuilder) {
table.text('key', 'mediumtext').defaultTo('').notNullable();
});
try {
await db.schema.alterTable('emails', function(table: Knex.CreateTableBuilder) {
table.text('key', 'mediumtext').defaultTo('').notNullable();
});
} catch (error) {
console.warn('Could not add "emails.key" column', error);
}
// await db.schema.alterTable('emails', function(table: Knex.CreateTableBuilder) {
// table.unique(['recipient_email', 'key']);