"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class postTag extends sequelize_1.Model{static initModel(e){return postTag.init({id:{type:sequelize_1.DataTypes.UUID,defaultValue:sequelize_1.DataTypes.UUIDV4,primaryKey:!0,allowNull:!1,comment:"Unique identifier for the post-tag relationship"},postId:{type:sequelize_1.DataTypes.UUID,allowNull:!1,validate:{isUUID:{args:4,msg:"postId: Post ID must be a valid UUID"}},comment:"ID of the blog post"},tagId:{type:sequelize_1.DataTypes.UUID,allowNull:!1,validate:{isUUID:{args:4,msg:"tagId: Tag ID must be a valid UUID"}},comment:"ID of the tag associated with the post"}},{sequelize:e,modelName:"postTag",tableName:"post_tag",timestamps:!1,indexes:[{name:"PRIMARY",unique:!0,using:"BTREE",fields:[{name:"id"}]},{name:"postTagPostIdForeign",using:"BTREE",fields:[{name:"postId"}]},{name:"postTagTagIdForeign",using:"BTREE",fields:[{name:"tagId"}]}]})}static associate(e){postTag.belongsTo(e.post,{as:"post",foreignKey:"postId",onDelete:"CASCADE",onUpdate:"CASCADE"});postTag.belongsTo(e.tag,{as:"tag",foreignKey:"tagId",onDelete:"CASCADE",onUpdate:"CASCADE"})}}exports.default=postTag;