From de84113066c27d88922285bd431b4968cf565a68 Mon Sep 17 00:00:00 2001 From: Joseph Ditton Date: Fri, 7 Jan 2022 10:19:34 -0700 Subject: adds context id to role and role helpers --- .../migrations/1641570023672-AddContextIdToUserRole.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 server/database/migrations/1641570023672-AddContextIdToUserRole.ts (limited to 'server/database/migrations') diff --git a/server/database/migrations/1641570023672-AddContextIdToUserRole.ts b/server/database/migrations/1641570023672-AddContextIdToUserRole.ts new file mode 100644 index 0000000..921c679 --- /dev/null +++ b/server/database/migrations/1641570023672-AddContextIdToUserRole.ts @@ -0,0 +1,18 @@ +import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm'; + +export class AddContextIdToUserRole1641570023672 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.addColumn( + 'user_role', + new TableColumn({ + name: 'contextId', + type: 'text', + default: "'root'", // default values must include single quotes for text + }), + ); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.dropColumn('user_role', 'contextId'); + } +} -- cgit v1.2.3-70-g09d2