diff --git a/colors.ts b/colors.ts index 1e6339c..8ac11ee 100644 --- a/colors.ts +++ b/colors.ts @@ -1,6 +1,6 @@ export const lightColors = [ - {hex: '#FA8072', name: 'Salmon'}, {hex: '#B3E5FC', name: 'Cyan'}, + {hex: '#FA8072', name: 'Salmon'}, {hex: '#FFC0CB', name: 'Pink'}, {hex: '#E9DCC9', name: 'Linen'}, ] diff --git a/migrations/1667186320954-add-color.ts b/migrations/1667186320954-add-color.ts index 373ebab..d1b64c3 100644 --- a/migrations/1667186320954-add-color.ts +++ b/migrations/1667186320954-add-color.ts @@ -1,10 +1,19 @@ -import {MigrationInterface, QueryRunner} from 'typeorm' +import {MigrationInterface, QueryRunner, TableColumn} from 'typeorm' +import {darkColors} from '../colors' export class addColor1667186320954 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { await queryRunner - .query(`ALTER TABLE settings ADD COLUMN color TEXT NULL`) - .catch(() => null) + .addColumn( + 'settings', + new TableColumn({ + name: 'color', + type: 'text', + isNullable: false, + default: `'${darkColors[0].hex}'`, + }), + ) + .catch(console.error) } public async down(queryRunner: QueryRunner): Promise {