-
-
Notifications
You must be signed in to change notification settings - Fork 727
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add primary keys to missing tables
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use strict'; | ||
|
||
exports.up = function (db, callback) { | ||
db.runSql( | ||
` | ||
ALTER TABLE project_stats ADD PRIMARY KEY (project); | ||
ALTER TABLE api_token_project ADD PRIMARY KEY (secret); | ||
ALTER TABLE role_permission ADD COLUMN id SERIAL PRIMARY KEY; | ||
`, | ||
callback, | ||
); | ||
}; | ||
|
||
exports.down = function (db, callback) { | ||
db.runSql( | ||
` | ||
ALTER TABLE project_stats DROP CONSTRAINT project_stats_pkey; | ||
ALTER TABLE api_token_project DROP CONSTRAINT api_token_project_pkey; | ||
ALTER TABLE role_permission DROP CONSTRAINT role_permission_pkey; | ||
ALTER TABLE role_permission DROP COLUMN id; | ||
`, | ||
callback, | ||
); | ||
}; |