'use strict';
module.exports = {
    up: (queryInterface, Sequelize) => {
        return queryInterface.createTable('Users', {
            id: {
                allowNull: false,
                autoIncrement: true,
                primaryKey: true,
                type: Sequelize.INTEGER
            },
            name: {
              allowNull: false,
              type: Sequelize.STRING
            },
            surname: {
              allowNull: false,
              type: Sequelize.STRING
            },
            email: {
              allowNull: false,
                unique: true,
              type: Sequelize.STRING
            },
            birthDay: {
              allowNull: false,
              type: Sequelize.STRING
            },
            phone: {
              allowNull: false,
              type: Sequelize.STRING
            },
            city: {
                allowNull: false,
                type: Sequelize.STRING
            },
            home: {
              allowNull: false,
              type: Sequelize.STRING
            },
            street: {
              allowNull: false,
              type: Sequelize.STRING
            },
            apartment: {
              allowNull: true,
              type: Sequelize.STRING
            },
            postIndex: {
                allowNull: false,
                type: Sequelize.INTEGER
            },
            role: {
                allowNull: false,
                type: Sequelize.STRING
            },
            password: {
                allowNull: false,
                type: Sequelize.STRING
            },
            token: {
              allowNull: true,
              type: Sequelize.STRING
            },
            createdAt: {
                allowNull: false,
                type: Sequelize.DATE,
                defaultValue: Sequelize.NOW
            },
            updatedAt: {
                allowNull: false,
                type: Sequelize.DATE
            }
        });
    },
    down: (queryInterface, Sequelize) => {
        return queryInterface.dropTable('Users');
    }
};
