add sorting to protocol agenda, decision and votings
This commit is contained in:
parent
4b6f0b34df
commit
2e5b345daa
22 changed files with 138 additions and 16 deletions
29
src/migrations/1742544887410-protocolSort.ts
Normal file
29
src/migrations/1742544887410-protocolSort.ts
Normal file
|
@ -0,0 +1,29 @@
|
|||
import { MigrationInterface, QueryRunner, TableColumn } from "typeorm";
|
||||
import { getDefaultByORM, getTypeByORM } from "./ormHelper";
|
||||
|
||||
export class ProtocolSort1742544887410 implements MigrationInterface {
|
||||
name = "ProtocolSort1742544887410";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.addColumn(
|
||||
"protocol_agenda",
|
||||
new TableColumn({ name: "sort", ...getTypeByORM("int"), default: getDefaultByORM("number", 0) })
|
||||
);
|
||||
|
||||
await queryRunner.addColumn(
|
||||
"protocol_decision",
|
||||
new TableColumn({ name: "sort", ...getTypeByORM("int"), default: getDefaultByORM("number", 0) })
|
||||
);
|
||||
|
||||
await queryRunner.addColumn(
|
||||
"protocol_voting",
|
||||
new TableColumn({ name: "sort", ...getTypeByORM("int"), default: getDefaultByORM("number", 0) })
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.dropColumn("protocol_agenda", "sort");
|
||||
await queryRunner.dropColumn("protocol_decision", "sort");
|
||||
await queryRunner.dropColumn("protocol_voting", "sort");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue