https://project.mdnd-it.cc/work_packages/94
This commit is contained in:
2025-08-23 04:25:28 +02:00
parent 725516ad6c
commit 19cfa031d0
25823 changed files with 1095587 additions and 2801760 deletions
@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddMaxOrganizationalDecksToOrganization1692712800000 = void 0;
const typeorm_1 = require("typeorm");
class AddMaxOrganizationalDecksToOrganization1692712800000 {
constructor() {
this.name = 'AddMaxOrganizationalDecksToOrganization1692712800000';
}
async up(queryRunner) {
// Add maxOrganizationalDecks column to Organizations table
await queryRunner.addColumn('Organizations', new typeorm_1.TableColumn({
name: 'maxOrganizationalDecks',
type: 'int',
isNullable: true, // No default - set by admin
comment: 'Maximum number of organizational decks a premium user can create in this organization'
}));
// Add performance indexes for deck filtering queries
await queryRunner.query(`CREATE INDEX "IDX_DECK_USER_STATE_CTYPE" ON "Decks" ("user_id", "state", "ctype")`);
await queryRunner.query(`CREATE INDEX "IDX_DECK_ORG_CTYPE_STATE" ON "Decks" ("organization_id", "ctype", "state")`);
}
async down(queryRunner) {
// Drop indexes
await queryRunner.query(`DROP INDEX "IDX_DECK_ORG_CTYPE_STATE"`);
await queryRunner.query(`DROP INDEX "IDX_DECK_USER_STATE_CTYPE"`);
// Remove maxOrganizationalDecks column
await queryRunner.dropColumn('Organizations', 'maxOrganizationalDecks');
}
}
exports.AddMaxOrganizationalDecksToOrganization1692712800000 = AddMaxOrganizationalDecksToOrganization1692712800000;
//# sourceMappingURL=AddMaxOrganizationalDecksToOrganization.js.map