error: столбец "typeId" не существует в PostgreSQL

const Brand = sequelize.define("brand", {
    id: {type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true},
    name: {type: DataTypes.STRING, unique:true, allowNull:false},
})

//models

const Router = require("express");
const router = new Router();
const brandController = require("../controllers/brandController")

router.post("/",brandController.create)
router.get("/",brandController.getAll)


module.exports = router

//brand router

const {Brand} = require("../models/models")
const ApiError = require("../error/ApiError")

class BrandController{
    async create(req, res){
        const {name} = req.body
        const brand = await Brand.create({name})
        return res.json(brand)
    }

    async getAll(req,res){
        const brands = await Brand.findAll()
        return res.json(brands)
    }
}

module.exports = new BrandController();

//BrandController

const Router = require("express");
const router = new Router();

const deviceRouter = require("./deviceRouter")
const brandRouter = require("./brandRouter")
const typeRouter = require("./typeRouter")
const userRouter = require("./userRouter")


router.use("/user", userRouter)
router.use("/type", typeRouter)
router.use("/brand", brandRouter)
router.use("/device", deviceRouter)

module.exports = router

//routes/index.js

проблема в том что с аналогичным type всё работает хорошо

sql: 'INSERT INTO "brands" ("id","name","createdAt","updatedAt") VALUES (DEFAULT,$1,$2,$3) RETURNING "id","name","createdAt","updatedAt","typeId";' появляется лишний столбец с typeId


Ответы (0 шт):