mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -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:
parent
dfca0abc93
commit
ba4f8cc857
5 changed files with 25 additions and 1 deletions
|
@ -14,6 +14,7 @@ const BACKUP_TABLES = [
|
||||||
'members_stripe_customers_subscriptions',
|
'members_stripe_customers_subscriptions',
|
||||||
'migrations',
|
'migrations',
|
||||||
'migrations_lock',
|
'migrations_lock',
|
||||||
|
'oauth',
|
||||||
'permissions',
|
'permissions',
|
||||||
'permissions_roles',
|
'permissions_roles',
|
||||||
'permissions_users',
|
'permissions_users',
|
||||||
|
|
|
@ -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'}
|
||||||
|
});
|
|
@ -112,6 +112,16 @@ module.exports = {
|
||||||
updated_at: {type: 'dateTime', nullable: true},
|
updated_at: {type: 'dateTime', nullable: true},
|
||||||
updated_by: {type: 'string', maxlength: 24, 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: {
|
posts_authors: {
|
||||||
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
||||||
post_id: {type: 'string', maxlength: 24, nullable: false, references: 'posts.id'},
|
post_id: {type: 'string', maxlength: 24, nullable: false, references: 'posts.id'},
|
||||||
|
|
|
@ -45,6 +45,7 @@ describe('Exporter', function () {
|
||||||
'migrations',
|
'migrations',
|
||||||
'migrations_lock',
|
'migrations_lock',
|
||||||
'mobiledoc_revisions',
|
'mobiledoc_revisions',
|
||||||
|
'oauth',
|
||||||
'permissions',
|
'permissions',
|
||||||
'permissions_roles',
|
'permissions_roles',
|
||||||
'permissions_users',
|
'permissions_users',
|
||||||
|
|
|
@ -32,7 +32,7 @@ const defaultSettings = require('../../../../core/server/data/schema/default-set
|
||||||
*/
|
*/
|
||||||
describe('DB version integrity', function () {
|
describe('DB version integrity', function () {
|
||||||
// Only these variables should need updating
|
// Only these variables should need updating
|
||||||
const currentSchemaHash = '32e92f2cf2874d6d8ac68bfdc97cd885';
|
const currentSchemaHash = 'a2248eaa72a9d08c3753b90a9436dbe3';
|
||||||
const currentFixturesHash = '97283c575b1f6c84c27db6e1b1be21d4';
|
const currentFixturesHash = '97283c575b1f6c84c27db6e1b1be21d4';
|
||||||
const currentSettingsHash = 'dd0a0a08e66b252e7704bb7e346a8c20';
|
const currentSettingsHash = 'dd0a0a08e66b252e7704bb7e346a8c20';
|
||||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||||
|
|
Loading…
Add table
Reference in a new issue