ContainerHQ/arkis-api

View on GitHub
app/models/user_providers_link.js

Summary

Maintainability
A
1 hr
Test Coverage
'use strict';

module.exports = function(sequelize, DataTypes) {
  return sequelize.define('UserProviderLink', {
    id: {
      type: DataTypes.INTEGER,
      primaryKey: true,
      autoIncrement: true
    },
    type: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: null,
      validate: {
        isIn: [['ssh_key']]
      }
    },
    provider_id: {
      type: DataTypes.STRING,
      allowNull: false,
      defaultValue: null
    }
  }, {
    classMethods: {
      associate: function(models) {
        this.belongsTo(models.User);
      }
    }
  });
};