const Sequelize = require("sequelize");
const db = require("../../db");
const UserImage = require("../userimage");
const WorkImage = require("../workimage")
const User = db.sequelize.define("users", {
  id: {
    type: Sequelize.INTEGER,
    primaryKey: true,
    autoIncrement: true,
  },
  name: {
    type: Sequelize.STRING,
  },
  email: {
    type: Sequelize.STRING,
  },
  password: {
    type: Sequelize.STRING,
  },
  address: {
    type: Sequelize.STRING,
  },
  tel: {
    type: Sequelize.STRING,
  },

  role: {
    type: Sequelize.INTEGER,
  },
});
User.hasMany(UserImage, { foreignKey: "image_id" });
// User.hasMany(WorkImage, { foreignKey: "image_id" });
module.exports = User;
