secajs/src/models/ContactDetailsSet.js

38 lines
857 B
JavaScript

class ContactDetailsSetProvider {
constructor({ sequelize, DataTypes }) {
this.sequelize = sequelize;
this.DataTypes = DataTypes;
}
provide() {
const ContactDetailsSet = this.sequelize.define(
'ContactDetailsSet',
{
uuid: {
type: this.DataTypes.UUID,
allowNull: false,
unique: true,
primaryKey: true,
},
public_key: {
type: this.DataTypes.STRING,
allowNull: false,
},
encrypted_contact_details: {
type: this.DataTypes.TEXT,
allowNull: false,
},
created_at: {
type: this.DataTypes.DATE,
allowNull: false,
},
},
{
tableName: 'contact_details_set',
}
);
return ContactDetailsSet;
}
}
module.exports = ContactDetailsSetProvider;