9781cd9ed2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19 lines
600 B
TypeScript
19 lines
600 B
TypeScript
import { AssetPriceModel } from "@/models/asset-price";
|
||
import { InKindDebtModel } from "@/models/in-kind-debt";
|
||
import type { Migration } from "./types";
|
||
|
||
export const migration: Migration = {
|
||
name: "008-in-kind",
|
||
description: "assetPrices ve inKindDebts index'leri; işlemlerde aynî borç alanları",
|
||
async up(db) {
|
||
await db
|
||
.collection("transactions")
|
||
.updateMany(
|
||
{ inKindDebtId: { $exists: false } },
|
||
{ $set: { inKindDebtId: null, inKindRole: null } },
|
||
);
|
||
await AssetPriceModel.createIndexes();
|
||
await InKindDebtModel.createIndexes();
|
||
},
|
||
};
|