This commit is contained in:
2025-12-30 00:45:54 +08:00
commit 3ab2184a43
5 changed files with 145 additions and 0 deletions

45
github/models/github.ts Normal file
View File

@@ -0,0 +1,45 @@
import { sequelize } from '../../../modules/sequelize.ts';
import { DataTypes, Model } from 'sequelize';
export type Github = Partial<InstanceType<typeof GithubModel>>;
/**
* 用户代码容器
*/
export class GithubModel extends Model {
declare id: string;
declare title: string;
declare githubToken: string;
declare uid: string;
}
GithubModel.init(
{
id: {
type: DataTypes.UUID,
primaryKey: true,
defaultValue: DataTypes.UUIDV4,
comment: 'id',
},
title: {
type: DataTypes.STRING,
defaultValue: '',
},
githubToken: {
type: DataTypes.STRING,
defaultValue: '',
},
uid: {
type: DataTypes.UUID,
allowNull: true,
},
},
{
sequelize,
tableName: 'kv_github',
paranoid: true,
},
);
// GithubModel.sync({ alter: true, logging: false }).catch((e) => {
// console.error('GithubModel sync', e);
// });