{"size": 1189, "ext": "js", "max_stars_repo_path": "Subscription_App_BackEnd-RESTful-API/src/database/migrations/20210529092803-create-user.js", "max_stars_repo_name": "JPDevM/NodeJS", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Subscription_App_BackEnd-RESTful-API/src/database/migrations/20210529092803-create-user.js", "max_issues_repo_name": "JPDevM/NodeJS", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Subscription_App_BackEnd-RESTful-API/src/database/migrations/20210529092803-create-user.js", "max_forks_repo_name": "JPDevM/NodeJS", "max_forks_repo_forks_event_min_datetime": "2020-11-01T21:43:09.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-01T21:43:09.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 23.78, "max_line_length": 64, "alphanum_fraction": 0.535744323}
'use strict';
module.exports = {
  up: async (queryInterface, Sequelize) => {
    /* Create table */
    await queryInterface.createTable('users', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER,
      },
      firstName: {
        type: Sequelize.STRING,
        allowNull: false, // MUST have a value. Set defaultValue
      },
      lastName: {
        type: Sequelize.STRING,
        allowNull: true,
        defaultValue: null,
      },
      email: {
        type: Sequelize.STRING(125),
        allowNull: false, // MUST have a value. Set defaultValue
        unique: true, // specify STRING(125)
      },
      gender: {
        type: Sequelize.STRING,
        allowNull: true,
        defaultValue: null,
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE,
      },
      updatedAt: {
        allowNull: false,
        type: Sequelize.DATE,
      },
      deletedAt: {
        allowNull: true,
        type: Sequelize.DATE,
      },
    });
  },
  down: async (queryInterface, Sequelize) => {
    /* Delete table */
    await queryInterface.dropTable('users');
  },
};
