upadte
This commit is contained in:
45
github/models/github.ts
Normal file
45
github/models/github.ts
Normal 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);
|
||||
// });
|
||||
Reference in New Issue
Block a user