"use strict";
module.exports = {
    async up (db, client) {
        const session = client.startSession();
        try {
            await session.withTransaction(async ()=>{
                const dbCollection = db.collection("users");
                await dbCollection.updateMany({}, {
                    $rename: {
                        password: "passwordHash"
                    }
                });
            });
        } finally{
            await session.endSession();
        }
    },
    async down (db, client) {
        const session = client.startSession();
        try {
            await session.withTransaction(async ()=>{
                const dbCollection = db.collection("users");
                await dbCollection.updateMany({}, {
                    $rename: {
                        passwordHash: "password"
                    }
                });
            });
        } finally{
            await session.endSession();
        }
    }
};

//# sourceMappingURL=20211029110742-user-password-passwordhash.js.map