{"size": 731, "ext": "js", "max_stars_repo_path": "api/src/models/sdec/refreshToken.js", "max_stars_repo_name": "sdec-brasil/dashboard-emissor", "max_stars_repo_stars_event_min_datetime": "2019-07-26T17:02:22.000Z", "max_stars_repo_stars_event_max_datetime": "2019-07-26T17:02:22.000Z", "max_issues_repo_path": "api/src/models/sdec/refreshToken.js", "max_issues_repo_name": "sdec-brasil/dashboard-emissor", "max_issues_repo_issues_event_min_datetime": "2019-07-25T22:25:33.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-10T19:11:07.000Z", "max_forks_repo_path": "api/src/models/sdec/refreshToken.js", "max_forks_repo_name": "sdec-brasil/dashboard-emissor", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 11, "max_forks_count": null, "avg_line_length": 29.24, "max_line_length": 112, "alphanum_fraction": 0.6689466484}
export default function (sequelize, DataTypes) {
// The refresh tokens.
// You will use these to get access tokens to access your end point data through the means outlined
// in the RFC The OAuth 2.0 Authorization Framework: Bearer Token Usage
// (http://tools.ietf.org/html/rfc6750)
  const refreshToken = sequelize.define('refreshToken', {
    token_secret: {
      type: DataTypes.TEXT('long'),
    },
    scope: {
      type: DataTypes.STRING,
      allowNull: true,
    },
  }, {
    underscored: true,
    tableName: 'refreshToken',
  });

  refreshToken.associate = (models) => {
    refreshToken.belongsTo(models.user, { targetKey: 'id', foreignKey: { name: 'user_id', allowNull: false } });
  };

  return refreshToken;
}
