module.exports = {
  up(queryInterface, Sequelize) {
    return queryInterface.createTable('TeamRoles', {
      id: {
        type: Sequelize.BIGINT,
        primaryKey: true,
        autoIncrement: true
      },
      teamId: {
        type: Sequelize.BIGINT,
        required: true,
        defaultValue: 1
      },
      updatedAt: Sequelize.DATE,
      createdAt: Sequelize.DATE,
      name: {
        type: Sequelize.STRING,
        required: true,
        defaultValue: "Members"
      },
      inviteUsers: {
        type: Sequelize.BOOLEAN,
        defaultValue: true
      },
      administrator: {
        type: Sequelize.BOOLEAN,
        defaultValue: false
      },
      changeTeamMeta: {
        type: Sequelize.BOOLEAN,
        defaultValue: false
      },
      changeTeamRoles: {
        type: Sequelize.BOOLEAN,
        defaultValue: false
      },
      forumAdministrator: {
        type: Sequelize.BOOLEAN,
        defaultValue: false
      },
      moderateForumThreads: {
        type: Sequelize.BOOLEAN,
        defaultValue: false
      },
      changeTeamPrivacy: {
        type: Sequelize.BOOLEAN,
        defaultValue: false
      },
      submitTeamItems: {
        type: Sequelize.BOOLEAN,
        defaultValue: false
      },
    })
  },
  down(queryInterface, Sequelize) {
    return queryInterface.dropTable('TeamMembers', {})
  }
}