import { DataTypes } from 'sequelize';
import sequelize from '../config/config.js';

const Treelogy = sequelize.define('Treelogy', {
  treelogy_id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
  treelogy_code: { type: DataTypes.STRING(100), allowNull: false },
  treelogy_name: { type: DataTypes.STRING(100), allowNull: false },
  landmark: { type: DataTypes.STRING(100), allowNull: false },
  dbname: { type: DataTypes.STRING(100), allowNull: false },
  client_id: { type: DataTypes.INTEGER, allowNull: false },
  updated_at: { type: DataTypes.DATE, allowNull: false, defaultValue: DataTypes.NOW },
  status: { type: DataTypes.STRING(100), allowNull: false, defaultValue: 'Y' },
}, {
  tableName: 'treelogy',
  schema: 'public',
  timestamps: false // we already have updated_at in table
});

export default Treelogy;
