index products
Build and Deploy / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-07-07 21:38:02 +03:30
parent 67e34bb753
commit f5a803d86f
3 changed files with 13 additions and 0 deletions
@@ -65,6 +65,10 @@ const productVariantSchema = new Schema<IProductVariant>(
{ timestamps: true, toObject: { virtuals: true, versionKey: false }, toJSON: { virtuals: true, versionKey: false }, id: false },
);
productVariantSchema.index({ product: 1, deleted: 1 });
productVariantSchema.index({ shop: 1, product: 1, deleted: 1 });
productVariantSchema.index({ market_status: 1, deleted: 1 });
productVariantSchema.pre("save", function (next) {
if (this.price) {
if (this.price.retailPrice) {