Genesis commit
This commit is contained in:
25
persistence/models/extendedPublicKey.js
Normal file
25
persistence/models/extendedPublicKey.js
Normal file
@@ -0,0 +1,25 @@
|
||||
module.exports = function (sequelize, DataTypes, options) {
|
||||
const model = sequelize.define("extendedPublicKey", {
|
||||
id: {
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: function() {
|
||||
return options.generateUniqueId()
|
||||
},
|
||||
primaryKey: true,
|
||||
unique: true
|
||||
},
|
||||
xpub: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
unique: true
|
||||
}
|
||||
}, {
|
||||
comment: "Extended Public Key belonging to the users of the system"
|
||||
});
|
||||
|
||||
model.associate = (db) => {
|
||||
model.User = model.belongsTo(db.User);
|
||||
}
|
||||
|
||||
return model;
|
||||
};
|
||||
Reference in New Issue
Block a user