summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/DB/Schema.pm6
-rw-r--r--Bugzilla/Install/DB.pm5
2 files changed, 9 insertions, 2 deletions
diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm
index c089513e3..3d904ba8b 100644
--- a/Bugzilla/DB/Schema.pm
+++ b/Bugzilla/DB/Schema.pm
@@ -1779,15 +1779,17 @@ use constant ABSTRACT_SCHEMA => {
REFERENCES => {TABLE => 'profiles',
COLUMN => 'userid',
DELETE => 'CASCADE'}},
- api_key => {TYPE => 'VARCHAR(40)', NOTNULL => 1},
- description => {TYPE => 'VARCHAR(255)'},
+ api_key => {TYPE => 'varchar(40)', NOTNULL => 1},
+ description => {TYPE => 'varchar(255)'},
revoked => {TYPE => 'BOOLEAN', NOTNULL => 1,
DEFAULT => 'FALSE'},
last_used => {TYPE => 'DATETIME'},
+ app_id => {TYPE => 'varchar(64)'},
],
INDEXES => [
user_api_keys_api_key_idx => {FIELDS => ['api_key'], TYPE => 'UNIQUE'},
user_api_keys_user_id_idx => ['user_id'],
+ user_api_keys_user_id_app_id_idx => ['user_id', 'app_id'],
],
},
};
diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm
index ddd127be2..5761d1963 100644
--- a/Bugzilla/Install/DB.pm
+++ b/Bugzilla/Install/DB.pm
@@ -122,6 +122,11 @@ sub update_fielddefs_definition {
$dbh->bz_add_column('fielddefs', 'long_desc',
{TYPE => 'varchar(255)', NOTNULL => 1, DEFAULT => "''"}, '');
+ $dbh->bz_add_column('user_api_keys', 'app_id',
+ {TYPE => 'varchar(64)'});
+ $dbh->bz_add_index('user_api_keys', 'user_api_keys_user_id_app_id_idx',
+ [qw(user_id app_id)]);
+
Bugzilla::Hook::process('install_update_db_fielddefs');
# Remember, this is not the function for adding general table changes.