0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Added OAuth user data

issue https://github.com/TryGhost/Team/issues/614

- This allows keeping each user oauth data, to compare on future logins
This commit is contained in:
Thibaut Patel 2021-04-23 11:24:25 +02:00 committed by Thibaut Patel
parent dfca0abc93
commit ba4f8cc857
5 changed files with 25 additions and 1 deletions

View file

@ -14,6 +14,7 @@ const BACKUP_TABLES = [
'members_stripe_customers_subscriptions',
'migrations',
'migrations_lock',
'oauth',
'permissions',
'permissions_roles',
'permissions_users',

View file

@ -0,0 +1,12 @@
const {addTable} = require('../../utils');
module.exports = addTable('oauth', {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
provider: {type: 'string', maxlength: 50, nullable: false},
provider_id: {type: 'string', maxlength: 191, nullable: false},
access_token: {type: 'text', maxlength: 65535, nullable: true},
refresh_token: {type: 'text', maxlength: 2000, nullable: true},
created_at: {type: 'dateTime', nullable: false},
updated_at: {type: 'dateTime', nullable: true},
user_id: {type: 'string', maxlength: 24, nullable: false, references: 'users.id'}
});

View file

@ -112,6 +112,16 @@ module.exports = {
updated_at: {type: 'dateTime', nullable: true},
updated_by: {type: 'string', maxlength: 24, nullable: true}
},
oauth: {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
provider: {type: 'string', maxlength: 50, nullable: false},
provider_id: {type: 'string', maxlength: 191, nullable: false},
access_token: {type: 'text', maxlength: 65535, nullable: true},
refresh_token: {type: 'text', maxlength: 2000, nullable: true},
created_at: {type: 'dateTime', nullable: false},
updated_at: {type: 'dateTime', nullable: true},
user_id: {type: 'string', maxlength: 24, nullable: false, references: 'users.id'}
},
posts_authors: {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
post_id: {type: 'string', maxlength: 24, nullable: false, references: 'posts.id'},

View file

@ -45,6 +45,7 @@ describe('Exporter', function () {
'migrations',
'migrations_lock',
'mobiledoc_revisions',
'oauth',
'permissions',
'permissions_roles',
'permissions_users',

View file

@ -32,7 +32,7 @@ const defaultSettings = require('../../../../core/server/data/schema/default-set
*/
describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = '32e92f2cf2874d6d8ac68bfdc97cd885';
const currentSchemaHash = 'a2248eaa72a9d08c3753b90a9436dbe3';
const currentFixturesHash = '97283c575b1f6c84c27db6e1b1be21d4';
const currentSettingsHash = 'dd0a0a08e66b252e7704bb7e346a8c20';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';