text: const { Model, DataTypes } = require('sequelize');
  const sequelize = require('../config/connection');
  
  class Pet extends Model { }
  
  Pet.init(
    {
  
      id: {
        type: DataTypes.INTEGER,
        allowNull: false,
        primaryKey: true,
        autoIncrement: true,
      },
      name: {
        type: DataTypes.STRING,
        allowNull: false,
      },
      species: {
        type: DataTypes.STRING,
        allowNull: false,
      },
      breed: {
        type: DataTypes.STRING,
        allowNull: false,
      },
      age: {
        type: DataTypes.INTEGER,
        allowNull: false,
      },
  
      sex: {
        type: DataTypes.STRING,
        allowNull: false,
      },
  
      isvaccinated: {
        type: DataTypes.STRING,
        allowNull: false,
      },
  
  
      ismicrochipped: {
        type: DataTypes.STRING,
        allowNull: false,
      },
  
      isdesexed: {
        type: DataTypes.STRING,
        allowNull: false,
      },
  
      description: {
        type: DataTypes.STRING,
        allowNull: true,
      },
  
      photourl: {
        type: DataTypes.STRING,
        allowNull: true
      },
  
  
  
      user_id: {
        type: DataTypes.INTEGER,
        references: {
          model: 'user',
          key: 'id',
        },
      },
    },
    {
      // Link to database connection
      sequelize,
      // Set to false to remove `created_at` and `updated_at` fields
      timestamps: false,
      underscored: true,
      modelName: 'pet'
    }
  );
  
  module.exports = Pet;
  