mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-16 16:04:34 +00:00
50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
import { connectionMongo, getMongoModel } from '../../../common/mongo';
|
|
const { Schema } = connectionMongo;
|
|
import { type AppVersionSchemaType } from '@fastgpt/global/core/app/version';
|
|
import { AppCollectionName, chatConfigType } from '../schema';
|
|
import { TeamMemberCollectionName } from '@fastgpt/global/support/user/team/constant';
|
|
|
|
export const AppVersionCollectionName = 'app_versions';
|
|
|
|
const AppVersionSchema = new Schema(
|
|
{
|
|
tmbId: {
|
|
type: String,
|
|
ref: TeamMemberCollectionName,
|
|
required: true
|
|
},
|
|
appId: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: AppCollectionName,
|
|
required: true
|
|
},
|
|
time: {
|
|
type: Date,
|
|
default: () => new Date()
|
|
},
|
|
nodes: {
|
|
type: Array,
|
|
default: []
|
|
},
|
|
edges: {
|
|
type: Array,
|
|
default: []
|
|
},
|
|
chatConfig: {
|
|
type: chatConfigType
|
|
},
|
|
isPublish: Boolean,
|
|
versionName: String
|
|
},
|
|
{
|
|
minimize: false
|
|
}
|
|
);
|
|
|
|
AppVersionSchema.index({ appId: 1, _id: -1 });
|
|
|
|
export const MongoAppVersion = getMongoModel<AppVersionSchemaType>(
|
|
AppVersionCollectionName,
|
|
AppVersionSchema
|
|
);
|