140 lines
2.9 KiB
TypeScript
140 lines
2.9 KiB
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
import { TableColumn } from "typeorm";
|
|
|
|
export class CommunicationFields1727439800630 implements MigrationInterface {
|
|
name = "CommunicationFields1727439800630";
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.changeColumn(
|
|
"communication",
|
|
"mobile",
|
|
new TableColumn({
|
|
name: "mobile",
|
|
type: "varchar",
|
|
length: "255",
|
|
isNullable: true,
|
|
})
|
|
);
|
|
|
|
await queryRunner.changeColumn(
|
|
"communication",
|
|
"email",
|
|
new TableColumn({
|
|
name: "email",
|
|
type: "varchar",
|
|
length: "255",
|
|
isNullable: true,
|
|
})
|
|
);
|
|
|
|
await queryRunner.changeColumn(
|
|
"communication",
|
|
"city",
|
|
new TableColumn({
|
|
name: "city",
|
|
type: "varchar",
|
|
length: "255",
|
|
isNullable: true,
|
|
})
|
|
);
|
|
|
|
await queryRunner.changeColumn(
|
|
"communication",
|
|
"street",
|
|
new TableColumn({
|
|
name: "street",
|
|
type: "varchar",
|
|
length: "255",
|
|
isNullable: true,
|
|
})
|
|
);
|
|
|
|
await queryRunner.changeColumn(
|
|
"communication",
|
|
"streetNumber",
|
|
new TableColumn({
|
|
name: "streetNumber",
|
|
type: "int",
|
|
isNullable: true,
|
|
})
|
|
);
|
|
|
|
await queryRunner.changeColumn(
|
|
"communication",
|
|
"streetNumberAddition",
|
|
new TableColumn({
|
|
name: "streetNumberAddition",
|
|
type: "varchar",
|
|
length: "255",
|
|
isNullable: true,
|
|
})
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.changeColumn(
|
|
"communication",
|
|
"mobile",
|
|
new TableColumn({
|
|
name: "mobile",
|
|
type: "varchar",
|
|
length: "255",
|
|
isNullable: false,
|
|
})
|
|
);
|
|
|
|
await queryRunner.changeColumn(
|
|
"communication",
|
|
"email",
|
|
new TableColumn({
|
|
name: "email",
|
|
type: "varchar",
|
|
length: "255",
|
|
isNullable: false,
|
|
})
|
|
);
|
|
|
|
await queryRunner.changeColumn(
|
|
"communication",
|
|
"city",
|
|
new TableColumn({
|
|
name: "city",
|
|
type: "varchar",
|
|
length: "255",
|
|
isNullable: false,
|
|
})
|
|
);
|
|
|
|
await queryRunner.changeColumn(
|
|
"communication",
|
|
"street",
|
|
new TableColumn({
|
|
name: "street",
|
|
type: "varchar",
|
|
length: "255",
|
|
isNullable: false,
|
|
})
|
|
);
|
|
|
|
await queryRunner.changeColumn(
|
|
"communication",
|
|
"streetNumber",
|
|
new TableColumn({
|
|
name: "streetNumber",
|
|
type: "int",
|
|
isNullable: false,
|
|
})
|
|
);
|
|
|
|
await queryRunner.changeColumn(
|
|
"communication",
|
|
"streetNumberAddition",
|
|
new TableColumn({
|
|
name: "streetNumberAddition",
|
|
type: "varchar",
|
|
length: "255",
|
|
isNullable: false,
|
|
})
|
|
);
|
|
}
|
|
}
|