From 70f5aba9c84ddf8eb12431fde4bf087b59a9d0e9 Mon Sep 17 00:00:00 2001 From: yvonnevictoria <28718897+yvonnevictoria@users.noreply.github.com> Date: Thu, 12 May 2022 11:32:54 +1000 Subject: [PATCH] Add githubAppId to Installations table --- db/migrations/20220511143000-add-github-app-id.js | 15 +++++++++++++++ src/models/installation.ts | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 db/migrations/20220511143000-add-github-app-id.js diff --git a/db/migrations/20220511143000-add-github-app-id.js b/db/migrations/20220511143000-add-github-app-id.js new file mode 100644 index 0000000000..f049592fc3 --- /dev/null +++ b/db/migrations/20220511143000-add-github-app-id.js @@ -0,0 +1,15 @@ +"use strict"; + +const tableName = "Installations"; +module.exports = { + up: async (queryInterface, Sequelize) => { + await queryInterface.addColumn(tableName, "githubAppId", { + type: Sequelize.INTEGER, + allowNull: true + }); + }, + + down: async (queryInterface, Sequelize) => { + await queryInterface.removeColumn(tableName, "githubAppId"); + } +}; diff --git a/src/models/installation.ts b/src/models/installation.ts index 2f4823305f..0481bd6e89 100644 --- a/src/models/installation.ts +++ b/src/models/installation.ts @@ -15,6 +15,7 @@ export class Installation extends Model { clientKey: string; updatedAt: Date; createdAt: Date; + githubAppId?: number; static async getForClientKey( clientKey: string @@ -121,7 +122,11 @@ Installation.init({ }, enabled: BOOLEAN, createdAt: DATE, - updatedAt: DATE + updatedAt: DATE, + githubAppId: { + type: DataTypes.INTEGER, + allowNull: true + } }, { sequelize }); export interface InstallationPayload {