@grouparoo/core
Version:
The Grouparoo Core
50 lines (41 loc) • 982 B
text/typescript
import Sequelize from "sequelize";
export default {
up: async (
queryInterface: Sequelize.QueryInterface,
DataTypes: typeof Sequelize
) => {
await queryInterface.createTable("sessions", {
id: {
type: DataTypes.STRING(40),
primaryKey: true,
},
createdAt: {
type: DataTypes.DATE,
allowNull: false,
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false,
},
teamMemberId: {
type: DataTypes.STRING(191),
allowNull: false,
},
fingerprint: {
type: DataTypes.TEXT,
allowNull: false,
},
expiresAt: {
type: DataTypes.DATE,
allowNull: false,
},
});
await queryInterface.addIndex("sessions", ["fingerprint"], {
unique: true,
fields: ["fingerprint"],
});
},
down: async (queryInterface: Sequelize.QueryInterface) => {
await queryInterface.dropTable("sessions");
},
};