mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
19 lines
499 B
TypeScript
19 lines
499 B
TypeScript
|
|
import { MigrationInterface, QueryRunner, TableColumn } from "typeorm";
|
||
|
|
|
||
|
|
export class AddUpdatedAtColumnes0000000000006 implements MigrationInterface {
|
||
|
|
async up(queryRunner: QueryRunner): Promise<void> {
|
||
|
|
await queryRunner.addColumn(
|
||
|
|
"artist",
|
||
|
|
new TableColumn({
|
||
|
|
name: "updatedAt",
|
||
|
|
type: "timestamp",
|
||
|
|
default: "NOW()",
|
||
|
|
})
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
async down(queryRunner: QueryRunner): Promise<void> {
|
||
|
|
await queryRunner.dropColumn("artist", "updatedAt");
|
||
|
|
}
|
||
|
|
}
|