fix colection create api (#766)

Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
Archer
2024-01-23 09:01:24 +08:00
committed by GitHub
parent aab6ee51eb
commit 379673cae1
143 changed files with 40737 additions and 274 deletions

View File

@@ -8,10 +8,6 @@ import {
} from '@fastgpt/global/support/user/team/constant';
const BillSchema = new Schema({
userId: {
type: Schema.Types.ObjectId,
ref: 'user'
},
teamId: {
type: Schema.Types.ObjectId,
ref: TeamCollectionName,
@@ -28,7 +24,7 @@ const BillSchema = new Schema({
},
appId: {
type: Schema.Types.ObjectId,
ref: 'model',
ref: 'apps',
required: false
},
time: {
@@ -52,7 +48,7 @@ const BillSchema = new Schema({
});
try {
BillSchema.index({ teamId: 1, time: -1 });
BillSchema.index({ teamId: 1, tmbId: 1, source: 1, time: -1 }, { background: true });
BillSchema.index({ time: 1 }, { expireAfterSeconds: 180 * 24 * 60 * 60 });
} catch (error) {
console.log(error);