db: increase files.size column size to bigint

This commit is contained in:
Alice Gaudon 2020-06-15 10:16:28 +02:00
parent e84f45b812
commit c53ba1972d
2 changed files with 14 additions and 0 deletions

View File

@ -33,6 +33,7 @@ import AuthToken from "./models/AuthToken";
import {MagicLinkActionType} from "./controllers/MagicLinkActionType";
import {Request} from "express";
import CreateFilesTable from "./migrations/CreateFilesTable";
import IncreaseFilesSizeField from "./migrations/IncreaseFilesSizeField";
export default class App extends Application {
private readonly port: number;
@ -51,6 +52,7 @@ export default class App extends Application {
CreateMagicLinksTable,
CreateAuthTokensTable,
CreateFilesTable,
IncreaseFilesSizeField,
];
}

View File

@ -0,0 +1,12 @@
import Migration from "wms-core/db/Migration";
import {Connection} from "mysql";
export default class IncreaseFilesSizeField extends Migration {
public async install(connection: Connection): Promise<void> {
await this.query('ALTER TABLE files MODIFY size BIGINT UNSIGNED', connection);
}
public async rollback(connection: Connection): Promise<void> {
await this.query('ALTER TABLE files MODIFY size INT UNSIGNED', connection);
}
}