demo data & template usage
This commit is contained in:
parent
2f72cc3925
commit
de5e4afffb
6 changed files with 176 additions and 8 deletions
20
src/migrations/1742207245862-memberPrintoutTemplates.ts
Normal file
20
src/migrations/1742207245862-memberPrintoutTemplates.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
import { templateUsage } from "../entity/configuration/templateUsage";
|
||||
|
||||
export class MemberPrintoutTemplates1742207245862 implements MigrationInterface {
|
||||
name = "MemberPrintoutTemplates1742207245862";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.manager
|
||||
.createQueryBuilder()
|
||||
.insert()
|
||||
.into(templateUsage)
|
||||
.values([{ scope: "member" }])
|
||||
.orUpdate(["headerId", "bodyId", "footerId", "headerHeight", "footerHeight"], ["scope"])
|
||||
.execute();
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.manager.createQueryBuilder().delete().from(templateUsage).where({ scope: "member" }).execute();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue