Skip to content

Commit

Permalink
Add githubAppId to Installations table (#1189)
Browse files Browse the repository at this point in the history
  • Loading branch information
yvonnevictoria authored May 12, 2022
1 parent 9d95bd4 commit 61365a3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
15 changes: 15 additions & 0 deletions db/migrations/20220511143000-add-github-app-id.js
Original file line number Diff line number Diff line change
@@ -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");
}
};
7 changes: 6 additions & 1 deletion src/models/installation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class Installation extends Model {
clientKey: string;
updatedAt: Date;
createdAt: Date;
githubAppId?: number;

static async getForClientKey(
clientKey: string
Expand Down Expand Up @@ -121,7 +122,11 @@ Installation.init({
},
enabled: BOOLEAN,
createdAt: DATE,
updatedAt: DATE
updatedAt: DATE,
githubAppId: {
type: DataTypes.INTEGER,
allowNull: true
}
}, { sequelize });

export interface InstallationPayload {
Expand Down

0 comments on commit 61365a3

Please sign in to comment.