'use strict';

module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.createTable('BlogPosts', {
      id: {
        type: Sequelize.INTEGER,
        primaryKey: true,
        autoIncrement: true
      },
      createdAt: Sequelize.DATE,
      updatedAt: Sequelize.DATE,
      name: {
        type: Sequelize.TEXT,
        allowNull: false
      },
      slug: Sequelize.TEXT,
      content: {
        type: Sequelize.TEXT,
        allowNull: false
      },
      postNumber: Sequelize.INTEGER,
      removed: {
        type: Sequelize.BOOLEAN,
        defaultValue: false
      },

      UserId: Sequelize.INTEGER,
      comments: {
        type: Sequelize.BOOLEAN,
        defaultValue: true
      },
    }, {
      charset: 'utf8mb4'
    })
  },

  down: (queryInterface, Sequelize) => {
    return queryInterface.dropTable('BlogPosts');
  }
};
