Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change PAT primary key from string to number (#2163)
* Update primary key * Fix tests
- Loading branch information
Showing
10 changed files
with
108 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import { Store } from './store'; | ||
import { IPat } from '../models/pat'; | ||
|
||
export interface IPatStore extends Store<IPat, string> { | ||
export interface IPatStore extends Store<IPat, number> { | ||
create(group: IPat): Promise<IPat>; | ||
getAllByUser(userId: number): Promise<IPat[]>; | ||
deleteForUser(id: number, userId: number): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use strict'; | ||
|
||
exports.up = function (db, cb) { | ||
db.runSql( | ||
` | ||
alter table personal_access_tokens | ||
drop constraint personal_access_tokens_pkey; | ||
ALTER TABLE personal_access_tokens | ||
add column id serial primary key; | ||
`, | ||
cb, | ||
); | ||
}; | ||
|
||
exports.down = function (db, cb) { | ||
db.runSql( | ||
` | ||
alter table personal_access_tokens | ||
drop constraint personal_access_tokens_pkey; | ||
alter table personal_access_tokens | ||
drop column id; | ||
alter table personal_access_tokens | ||
add primary key (secret); | ||
`, | ||
cb, | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters