import { sequelize } from '../../../modules/sequelize.ts'; import { DataTypes, Model } from 'sequelize'; export type Github = Partial>; /** * 用户代码容器 */ 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); // });