import { DataTypes } from 'sequelize';

export default function defineTaskImage(sequelize) {
  return sequelize.define(
    'TaskImage',
    {
      id: { type: DataTypes.BIGINT.UNSIGNED, primaryKey: true, autoIncrement: true },
      job_task_id: { type: DataTypes.BIGINT.UNSIGNED, allowNull: false },
      image_url: { type: DataTypes.STRING(512), allowNull: false },
      created_at: {
        type: DataTypes.DATE(3),
        allowNull: false,
        defaultValue: DataTypes.NOW,
      },
    },
    { tableName: 'task_images' }
  );
}
