summaryrefslogblamecommitdiff
path: root/src/routers/vault/models/vault/migration_log.js
blob: 0d30aeb198633f5349b91bc6e3aed0bc7daac12a (plain) (tree)



















                                                            


                                                                         














                                        
const Sequelize = require("sequelize"); // from npm registry

module.exports = {
    fields: {
        legacyId: {
            type: Sequelize.INTEGER.UNSIGNED,
            primaryKey: true,
            allowNull: false,
        },
        accountId: {
            type: Sequelize.INTEGER.UNSIGNED,
            allowNull: false,
        },
        vaultId: {
            type: Sequelize.INTEGER.UNSIGNED,
            allowNull: false,
        },
        ip: {
            type: "VARBINARY(16)",
            allowNull: false,
            set (raw) {
                this.setDataValue("ip", Sequelize.fn("INET6_ATON", raw));
            },
        },
        date: {
            type: Sequelize.DATE,
            allowNull: false,
            defaultValue: Sequelize.NOW,
        },
    },
    options: {
        indexes: [
            { fields: ["vault_id"] },
            { fields: ["account_id"] },
            { fields: ["ip"] },
        ]
    }
};