Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARC-920 Add githubAppId to Installations table #1189

Merged
merged 2 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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