Brandon Presley
dc27ae9868
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.
25 lines
841 B
TypeScript
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}),
|
|
)
|
|
}
|
|
}
|