41 lines
890 B
JavaScript
41 lines
890 B
JavaScript
'use strict';
|
|
|
|
const { sequelize } = require('../models');
|
|
|
|
/** @type {import('sequelize-cli').Migration} */
|
|
module.exports = {
|
|
async up(queryInterface, Sequelize) {
|
|
await queryInterface.createTable('Users', {
|
|
id: {
|
|
allowNull: false,
|
|
autoIncrement: true,
|
|
primaryKey: true,
|
|
type: Sequelize.INTEGER
|
|
},
|
|
name: {
|
|
type: Sequelize.STRING,
|
|
allowNull: true
|
|
},
|
|
email: {
|
|
type: Sequelize.STRING,
|
|
allowNull: false,
|
|
unique: true
|
|
},
|
|
password: {
|
|
type: Sequelize.STRING,
|
|
allowNull: false
|
|
},
|
|
alamat: {
|
|
type: Sequelize.STRING,
|
|
allowNull: true
|
|
},
|
|
nomorTelepon: {
|
|
type: Sequelize.STRING,
|
|
allowNull: true
|
|
},
|
|
});
|
|
},
|
|
async down(queryInterface, Sequelize) {
|
|
await queryInterface.dropTable('Users');
|
|
}
|
|
}; |