Massive/migrations/1669420187764-split-color.ts
Brandon Presley dc27ae9868 Split up dark and light color settings
Previously it was possible to choose a color combination
that was almost impossible to read (due to contrast).
Now we have prevented this from happening, as well as
giving the user more customizability.
2022-11-26 13:15:12 +13:00

25 lines
841 B
TypeScript

import {MigrationInterface, QueryRunner, TableColumn} from 'typeorm'
export class splitColor1669420187764 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.addColumn(
'settings',
new TableColumn({name: 'lightColor', type: 'text', isNullable: true}),
)
await queryRunner.addColumn(
'settings',
new TableColumn({name: 'darkColor', type: 'text', isNullable: true}),
)
await queryRunner.dropColumn('settings', 'color')
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropColumn('settings', 'darkColor')
await queryRunner.dropColumn('settings', 'lightColor')
await queryRunner.addColumn(
'settings',
new TableColumn({name: 'color', type: 'text', isNullable: true}),
)
}
}