mirror of
https://github.com/sakaljurgis/kodi-api-server.git
synced 2026-07-08 20:37:41 +00:00
add migrations (package, config, migrations), add exceptions filter for kodi, start VideoFiles module
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class CreateFilesTable1672729641013 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`create table files
|
||||
(
|
||||
id INTEGER
|
||||
primary key autoincrement,
|
||||
path VARCHAR(512),
|
||||
deleted TINYINT,
|
||||
size INTEGER,
|
||||
file_name VARCHAR(512),
|
||||
infos TEXT,
|
||||
info TEXT,
|
||||
title_id INTEGER,
|
||||
season INTEGER default NULL,
|
||||
duration REAL,
|
||||
transmission INTEGER default NULL,
|
||||
lm INTEGER default NULL
|
||||
);`,
|
||||
);
|
||||
|
||||
await queryRunner.query(
|
||||
`create unique index path
|
||||
on files (path);`,
|
||||
);
|
||||
|
||||
await queryRunner.query(
|
||||
`create index season
|
||||
on files (season);`,
|
||||
);
|
||||
|
||||
await queryRunner.query(
|
||||
`create index title_id
|
||||
on files (title_id);`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`DROP TABLE files`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
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`);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class CreateLrtCategoriesTable1672730402752
|
||||
implements MigrationInterface
|
||||
{
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`create table lrt_categories
|
||||
(
|
||||
category_url TEXT,
|
||||
category_id TEXT
|
||||
);`,
|
||||
);
|
||||
|
||||
await queryRunner.query(
|
||||
`create index lrt_categories_category_url_index
|
||||
on lrt_categories (category_url);`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`DROP TABLE lrt_categories`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user