Skip to content

Commit

Permalink
fix(PullRequest): not updating due to external integer id overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mikewuu committed Nov 1, 2024
1 parent 641518a commit b19cecf
Show file tree
Hide file tree
Showing 14 changed files with 5,615 additions and 9,371 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ it('should create and embed a pr', async () => {

const pullRequest = await dbClient
.selectFrom('homie.pull_request')
.where('ext_gh_pull_request_id', '=', 8282)
.where('ext_gh_pull_request_id', '=', '8282')
.selectAll()
.executeTakeFirstOrThrow()
expect(pullRequest.title).toBe('My test closed PR')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'

export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.alterColumn(
{
schema: 'homie',
name: 'pull_request',
},
'ext_gh_pull_request_id',
{
type: 'text',
notNull: false,
},
)

pgm.alterColumn(
{
schema: 'homie',
name: 'pull_request',
},
'ext_gitlab_merge_request_id',
{
type: 'text',
notNull: false,
},
)
pgm.alterColumn(
{
schema: 'homie',
name: 'pull_request',
},
'ext_gitlab_merge_request_iid',
{
type: 'text',
notNull: false,
},
)
}

export async function down(pgm: MigrationBuilder): Promise<void> {
pgm.alterColumn(
{
schema: 'homie',
name: 'pull_request',
},
'ext_gh_pull_request_id',
{
type: 'integer',
notNull: false,
},
)

pgm.alterColumn(
{
schema: 'homie',
name: 'pull_request',
},
'ext_gitlab_merge_request_id',
{
type: 'integer',
notNull: false,
},
)
pgm.alterColumn(
{
schema: 'homie',
name: 'pull_request',
},
'ext_gitlab_merge_request_iid',
{
type: 'integer',
notNull: false,
},
)
}
6 changes: 4 additions & 2 deletions src/database/schema/zapatos/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"ignorePatterns": ["*"]
}
"ignorePatterns": [
"*"
]
}
Loading

0 comments on commit b19cecf

Please sign in to comment.