diff --git a/models/accounts.model.js b/models/accounts.model.js index 05b4448..18f252c 100644 --- a/models/accounts.model.js +++ b/models/accounts.model.js @@ -1,50 +1,54 @@ import { DataTypes } from 'sequelize'; export default (sequelize) => { - sequelize.define('accounts', { - id: { - allowNull: false, - autoIncrement: true, - primaryKey: true, - type: DataTypes.INTEGER, + sequelize.define( + 'accounts', + { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: DataTypes.INTEGER, + }, + email: { + allowNull: false, + type: DataTypes.TEXT, + }, + password: { + allowNull: true, + type: DataTypes.TEXT, + }, + created: { + allowNull: true, + type: DataTypes.BIGINT, + }, + last_ping: { + allowNull: true, + type: DataTypes.BIGINT, + }, + '2fa_token': { + allowNull: true, + type: DataTypes.TEXT, + }, + admin: { + allowNull: true, + type: DataTypes.BOOLEAN, + }, + email_verify_token: { + allowNull: true, + type: DataTypes.TEXT, + }, + g_oauth_sub: { + allowNull: true, + type: DataTypes.TEXT, + }, + two_factor_enabled: { + allowNull: true, + type: DataTypes.BOOLEAN, + }, }, - email: { - allowNull: false, - type: DataTypes.TEXT, + { + timestamps: false, }, - password: { - allowNull: true, - type: DataTypes.TEXT, - }, - created: { - allowNull: true, - type: DataTypes.BIGINT, - }, - last_ping: { - allowNull: true, - type: DataTypes.BIGINT, - }, - '2fa_token': { - allowNull: true, - type: DataTypes.TEXT, - }, - admin: { - allowNull: true, - type: DataTypes.BOOLEAN, - }, - email_verify_token: { - allowNull: true, - type: DataTypes.TEXT, - }, - g_oauth_sub: { - allowNull: true, - type: DataTypes.TEXT, - }, - two_factor_enabled: { - allowNull: true, - type: DataTypes.BOOLEAN, - }, - }, { - timestamps: false, - }); + ); }; diff --git a/models/athena_action_log.model.js b/models/athena_action_log.model.js index 5284fdd..ddf1264 100644 --- a/models/athena_action_log.model.js +++ b/models/athena_action_log.model.js @@ -1,46 +1,50 @@ import { DataTypes } from 'sequelize'; export default (sequelize) => { - sequelize.define('athena_action_log', { - id: { - allowNull: false, - autoIncrement: true, - primaryKey: true, - type: DataTypes.INTEGER, + sequelize.define( + 'athena_action_log', + { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: DataTypes.INTEGER, + }, + account_id: { + allowNull: true, + type: DataTypes.INTEGER, + }, + device_id: { + allowNull: true, + type: DataTypes.INTEGER, + }, + action: { + allowNull: true, + type: DataTypes.TEXT, + }, + user_ip: { + allowNull: true, + type: DataTypes.TEXT, + }, + device_ip: { + allowNull: true, + type: DataTypes.TEXT, + }, + meta: { + allowNull: true, + type: DataTypes.TEXT, + }, + created_at: { + allowNull: true, + type: DataTypes.BIGINT, + }, + dongle_id: { + allowNull: true, + type: DataTypes.TEXT, + }, }, - account_id: { - allowNull: true, - type: DataTypes.INTEGER, + { + timestamps: false, }, - device_id: { - allowNull: true, - type: DataTypes.INTEGER, - }, - action: { - allowNull: true, - type: DataTypes.TEXT, - }, - user_ip: { - allowNull: true, - type: DataTypes.TEXT, - }, - device_ip: { - allowNull: true, - type: DataTypes.TEXT, - }, - meta: { - allowNull: true, - type: DataTypes.TEXT, - }, - created_at: { - allowNull: true, - type: DataTypes.BIGINT, - }, - dongle_id: { - allowNull: true, - type: DataTypes.TEXT, - }, - }, { - timestamps: false, - }); + ); }; diff --git a/models/athena_returned_data.model.js b/models/athena_returned_data.model.js index 765f336..9d8e3a3 100644 --- a/models/athena_returned_data.model.js +++ b/models/athena_returned_data.model.js @@ -1,39 +1,41 @@ import { DataTypes } from 'sequelize'; export default (sequelize) => { - sequelize.define('athena_returned_data', { - id: { - allowNull: false, - autoIncrement: true, - primaryKey: true, - type: DataTypes.INTEGER, + sequelize.define('athena_returned_data', + { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: DataTypes.INTEGER, + }, + device_id: { + allowNull: true, + type: DataTypes.INTEGER, + }, + type: { + allowNull: true, + type: DataTypes.TEXT, + }, + data: { + allowNull: true, + type: DataTypes.TEXT, + }, + created_at: { + allowNull: true, + type: DataTypes.TEXT, + }, + uuid: { + allowNull: false, + type: DataTypes.TEXT, + }, + resolved_at: { + allowNull: true, + type: DataTypes.INTEGER, + }, }, - device_id: { - allowNull: true, - type: DataTypes.INTEGER, + { + timestamps: false, }, - type: { - allowNull: true, - type: DataTypes.TEXT, - }, - data: { - allowNull: true, - type: DataTypes.TEXT, - }, - created_at: { - allowNull: true, - type: DataTypes.TEXT, - }, - uuid: { - allowNull: false, - type: DataTypes.TEXT, - }, - resolved_at: { - allowNull: true, - type: DataTypes.INTEGER, - }, - - }, { - timestamps: false, - }); + ); }; diff --git a/models/device_authorised_users.model.js b/models/device_authorised_users.model.js index ae6d14e..87f0ede 100644 --- a/models/device_authorised_users.model.js +++ b/models/device_authorised_users.model.js @@ -1,39 +1,42 @@ import { DataTypes } from 'sequelize'; export default (sequelize) => { - sequelize.define('device_authorised_users', { - id: { - allowNull: false, - autoIncrement: true, - primaryKey: true, - type: DataTypes.INTEGER, + sequelize.define( + 'device_authorised_users', + { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: DataTypes.INTEGER, + }, + account_id: { + allowNull: false, + type: DataTypes.INTEGER, + }, + device_id: { + allowNull: true, + type: DataTypes.INTEGER, + }, + athena: { + allowNull: true, + type: DataTypes.BOOLEAN, + }, + unpair: { + allowNull: true, + type: DataTypes.BOOLEAN, + }, + view_drives: { + allowNull: true, + type: DataTypes.BOOLEAN, + }, + created_at: { + allowNull: true, + type: DataTypes.BIGINT, + }, }, - account_id: { - allowNull: false, - type: DataTypes.INTEGER, + { + timestamps: false, }, - device_id: { - allowNull: true, - type: DataTypes.INTEGER, - }, - athena: { - allowNull: true, - type: DataTypes.BOOLEAN, - }, - unpair: { - allowNull: true, - type: DataTypes.BOOLEAN, - }, - view_drives: { - allowNull: true, - type: DataTypes.BOOLEAN, - }, - created_at: { - allowNull: true, - type: DataTypes.BIGINT, - }, - - }, { - timestamps: false, - }); + ); }; diff --git a/models/devices.model.js b/models/devices.model.js index 2fb54fb..5417d80 100644 --- a/models/devices.model.js +++ b/models/devices.model.js @@ -46,7 +46,6 @@ export default (sequelize) => { allowNull: true, type: DataTypes.INTEGER, }, - max_storage: { allowNull: true, type: DataTypes.INTEGER, diff --git a/models/index.model.js b/models/index.model.js index 39b933d..1a0e8f0 100644 --- a/models/index.model.js +++ b/models/index.model.js @@ -16,7 +16,7 @@ const sequelize = new Sequelize({ password: process.env.DB_PASS, database: process.env.DB_NAME || 'retro-pilot', host: process.env.DB_HOST || '127.0.0.1', - port: process.env.DB_PORT || 5432, + port: process.env.DB_PORT || 5432, dialect: 'postgres', }); diff --git a/models/oauth_accounts.js b/models/oauth_accounts.js index 22ba6d2..e1dd6a9 100644 --- a/models/oauth_accounts.js +++ b/models/oauth_accounts.js @@ -1,38 +1,42 @@ import { DataTypes } from 'sequelize'; export default (sequelize) => { - sequelize.define('oauth_accounts', { - id: { - id: false, - autoIncrement: true, - primaryKey: true, - type: DataTypes.INTEGER, + sequelize.define( + 'oauth_accounts', + { + id: { + id: false, + autoIncrement: true, + primaryKey: true, + type: DataTypes.INTEGER, + }, + account_id: { + allowNull: false, + type: DataTypes.INTEGER, + }, + email: { + allowNull: false, + type: DataTypes.TEXT, + }, + created: { + allowNull: true, + type: DataTypes.TIME, + }, + last_used: { + allowNull: true, + type: DataTypes.CHAR, + }, + refresh: { + allowNull: true, + type: DataTypes.TEXT, + }, + provider: { + allowNull: true, + type: DataTypes.TEXT, + }, }, - account_id: { - allowNull: false, - type: DataTypes.INTEGER, + { + timestamps: false, }, - email: { - allowNull: false, - type: DataTypes.TEXT, - }, - created: { - allowNull: true, - type: DataTypes.TIME, - }, - last_used: { - allowNull: true, - type: DataTypes.CHAR, - }, - refresh: { - allowNull: true, - type: DataTypes.TEXT, - }, - provider: { - allowNull: true, - type: DataTypes.TEXT, - }, - }, { - timestamps: false, - }); + ); };