mirror of
https://github.com/sakaljurgis/kodi-api-server.git
synced 2026-07-08 20:37:41 +00:00
26 lines
631 B
TypeScript
26 lines
631 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class CreateTitlesTable1672729964237 implements MigrationInterface {
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`create table titles
|
|
(
|
|
id INTEGER
|
|
primary key,
|
|
title VARCHAR(512),
|
|
type VARCHAR(50)
|
|
);`,
|
|
);
|
|
|
|
await queryRunner.query(
|
|
`create unique index title_type
|
|
on titles (title, type);`,
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`DROP TABLE titles`);
|
|
}
|
|
|
|
}
|