@ibernoh/arkanjs
Version:
Backend API generator with RBAC, CLI scaffolding, and built-in structure. Just install and run.
21 lines (18 loc) • 552 B
JavaScript
export async function up(queryInterface, Sequelize) {
await queryInterface.createTable("roles", {
id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true },
name: { type: Sequelize.STRING, unique: true, allowNull: false },
created_at: Sequelize.DATE,
updated_at: Sequelize.DATE
});
await queryInterface.bulkInsert("roles", [
{
name: "admin",
created_at: new Date(),
updated_at: new Date()
}
]);
}
export async function down(queryInterface) {
await queryInterface.dropTable("roles");
}