04a17d2775
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
646 B
TypeScript
18 lines
646 B
TypeScript
import { RecurringRuleModel } from "@/models/recurring-rule";
|
||
import { TransactionModel } from "@/models/transaction";
|
||
import type { Migration } from "./types";
|
||
|
||
export const migration: Migration = {
|
||
name: "005-recurring",
|
||
description: "recurringRules index'leri; işlemlerde tekrar alanları ve benzersiz tekrar index'i",
|
||
async up(db) {
|
||
const tx = db.collection("transactions");
|
||
await tx.updateMany(
|
||
{ occurrenceIndex: { $exists: false } },
|
||
{ $set: { occurrenceIndex: null, detached: false, isEstimate: false } },
|
||
);
|
||
await RecurringRuleModel.createIndexes();
|
||
await TransactionModel.createIndexes();
|
||
},
|
||
};
|