text: const { Model, DataTypes } = require('sequelize');
  const sequelize = require('../config/connection');
  
  class Post extends Model {}
  
  // create fields/columns for Post
  Post.init(
      {
        id: {
          type: DataTypes.INTEGER,
          allowNull: false,
          primaryKey: true,
          autoIncrement: true
        },
        title: {
          type: DataTypes.STRING,
          allowNull: false
        },
        postText: {
          type: DataTypes.STRING(1999),
              allowNull: false,
              validate: {
                  // notEmpty: true,
                  len: [1]
          }
        },
        userId: {
          type: DataTypes.INTEGER,
          references: {
            model: 'user',
            key: 'id'
          }
        }
      },
      {
        sequelize,
        freezeTableName: true,
        underscored: true,
        modelName: 'post'
      }
    );
  
    module.exports = Post;