text: const { Sequelize, Model, DataTypes } = require('sequelize');
  const sequelize = require('../config/connection');
  
  class Post extends Model {}
  
  Post.init({
    id: {
        type: DataTypes.INTEGER,
        allowNull: false,
        primaryKey: true,
        autoIncrement: true,
    },
    title: {
        type: DataTypes.STRING,
        allowNull: false,
    },
    content: {
        type: DataTypes.STRING,
        allowNull: false,
    },
  //   date_created: {
  //     type: DataTypes.DATE,
  //     allowNull: false,
  //     defaultValue: DataTypes.NOW,
  // },
    user_id: {
         type: DataTypes.INTEGER,
         allowNull: false,
         references: {
           model:'user',
           id: 'id',
         },
    },
  },
  {
    sequelize,
    timestamps:true,
    freezeTableName: true,
    underscored: true,
    modelName: 'post',
    }
  
  );
  
  module.exports = Post;
  