{"size": 1069, "ext": "js", "max_stars_repo_path": "src/infra/database/migrate/3-create-challengeCustomer.js", "max_stars_repo_name": "igor-chernetsky/BarChallengeBE", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/infra/database/migrate/3-create-challengeCustomer.js", "max_issues_repo_name": "igor-chernetsky/BarChallengeBE", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/infra/database/migrate/3-create-challengeCustomer.js", "max_forks_repo_name": "igor-chernetsky/BarChallengeBE", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.2708333333, "max_line_length": 61, "alphanum_fraction": 0.5238540692}
'use strict';
module.exports = {
  up: function(queryInterface, Sequelize) {
    return queryInterface.createTable('challengeCustomers', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      updatedAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      customerId: {
        type: Sequelize.INTEGER,
        allowNull: false,
        references: {
          model: 'customers',
          key: 'id'
        },
        onUpdate: 'cascade',
        onDelete: 'cascade'
      },
      challengeId: {
        type: Sequelize.INTEGER,
        allowNull: false,
        references: {
          model: 'challenges',
          key: 'id'
        },
        onUpdate: 'cascade',
        onDelete: 'cascade'
      },
      rewardId: {
        type: Sequelize.INTEGER
      }
    });
  },
  down: function(queryInterface) {
    return queryInterface.dropTable('challengeCustomers');
  }
};
