Merge branch 'master' into playlist-limit-config

This commit is contained in:
Thongrapee Panyapatiphan 2021-12-09 17:55:29 +07:00
commit d8086be5cf
No known key found for this signature in database
GPG key ID: 4B08AEC7F50F1967
31 changed files with 1214 additions and 753 deletions

14
src/models/file-cache.ts Normal file
View file

@ -0,0 +1,14 @@
import {Table, Column, PrimaryKey, Model} from 'sequelize-typescript';
@Table
export default class FileCache extends Model {
@PrimaryKey
@Column
hash!: string;
@Column
bytes!: number;
@Column
accessedAt!: Date;
}

View file

@ -1,9 +1,11 @@
import Cache from './cache.js';
import FileCache from './file-cache.js';
import KeyValueCache from './key-value-cache.js';
import Settings from './settings.js';
import Shortcut from './shortcut.js';
export {
Cache,
FileCache,
KeyValueCache,
Settings,
Shortcut,
};

View file

@ -2,7 +2,7 @@ import {Table, Column, PrimaryKey, Model} from 'sequelize-typescript';
import sequelize from 'sequelize';
@Table
export default class Cache extends Model<Cache> {
export default class KeyValueCache extends Model {
@PrimaryKey
@Column
key!: string;

View file

@ -1,7 +1,7 @@
import {Table, Column, PrimaryKey, Model, Default} from 'sequelize-typescript';
@Table
export default class Settings extends Model<Settings> {
export default class Settings extends Model {
@PrimaryKey
@Column
guildId!: string;

View file

@ -1,7 +1,7 @@
import {Table, Column, PrimaryKey, Model, AutoIncrement, Index} from 'sequelize-typescript';
@Table
export default class Shortcut extends Model<Shortcut> {
export default class Shortcut extends Model {
@PrimaryKey
@AutoIncrement
@Column