mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-14 23:22:22 +00:00
fix: version schema ref error (#5518)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { connectionMongo, getMongoModel, type Model } from '../../../common/mongo';
|
||||
const { Schema, model, models } = connectionMongo;
|
||||
import { connectionMongo, getMongoModel } from '../../../common/mongo';
|
||||
const { Schema } = connectionMongo;
|
||||
import { type AppVersionSchemaType } from '@fastgpt/global/core/app/version';
|
||||
import { chatConfigType } from '../schema';
|
||||
import { AppCollectionName, chatConfigType } from '../schema';
|
||||
import { TeamMemberCollectionName } from '@fastgpt/global/support/user/team/constant';
|
||||
|
||||
export const AppVersionCollectionName = 'app_versions';
|
||||
@@ -15,7 +15,7 @@ const AppVersionSchema = new Schema(
|
||||
},
|
||||
appId: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: AppVersionCollectionName,
|
||||
ref: AppCollectionName,
|
||||
required: true
|
||||
},
|
||||
time: {
|
||||
@@ -41,11 +41,7 @@ const AppVersionSchema = new Schema(
|
||||
}
|
||||
);
|
||||
|
||||
try {
|
||||
AppVersionSchema.index({ appId: 1, time: -1 });
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
AppVersionSchema.index({ appId: 1, _id: -1 });
|
||||
|
||||
export const MongoAppVersion = getMongoModel<AppVersionSchemaType>(
|
||||
AppVersionCollectionName,
|
||||
|
Reference in New Issue
Block a user