const { DataTypes } = require('sequelize');
const sequelize = require('../config/database');

const PostTag = sequelize.define('PostTag', {
  id: {
    type: DataTypes.UUID,
    defaultValue: DataTypes.UUIDV4,
    primaryKey: true
  },
  postId: {
    type: DataTypes.UUID,
    allowNull: false,
    references: {
      model: 'ForumPosts',
      key: 'id'
    }
  },
  tagName: {
    type: DataTypes.STRING,
    allowNull: false
  }
});

module.exports = PostTag;
