UNPKG

origintrail-node

Version:

OriginTrail Node - Decentralized Knowledge Graph Node Library

37 lines (36 loc) 1.04 kB
export default (sequelize, DataTypes) => { const shard = sequelize.define( 'shard', { peerId: { type: DataTypes.STRING, primaryKey: true }, blockchainId: { type: DataTypes.STRING, primaryKey: true }, ask: { type: DataTypes.INTEGER, allowNull: false, }, stake: { type: DataTypes.INTEGER, allowNull: false, }, lastSeen: { type: DataTypes.DATE, allowNull: false, defaultValue: new Date(0), }, lastDialed: { type: DataTypes.DATE, allowNull: false, defaultValue: new Date(0), }, sha256: { type: DataTypes.STRING, allowNull: false, }, }, { underscored: true }, ); shard.associate = () => { // associations can be defined here }; return shard; };