小编Оле*_*кий的帖子

Postgress 尝试返回我的模型中不存在的列

我使用 graphql API 并尝试将数据插入 Postgress 表并收到错误:

"message": "column \"UserId\" does not exist",
Run Code Online (Sandbox Code Playgroud)

和我的原始查询:

Executing (default): INSERT INTO "Recipes" 
("id","title","ingredients","direction","createdAt","updatedAt","userId") VALUES 
(DEFAULT,$1,$2,$3,$4,$5,$6) 
 RETURNING 
"id","title","ingredients","direction","createdAt","updatedAt","userId","UserId";
Run Code Online (Sandbox Code Playgroud)

问题是UserId列不在我的模型中,但userId是!我不知道为什么 Postgres 试图返回 UserId 列。我的模特。用户:

module.exports = (sequelize, DataTypes) => {
  class User extends Model {
    static associate(models) {
      User.hasMany(models.Recipe)
    }
  };
  User.init({
    name: {
        type: DataTypes.STRING,
        allowNull: false
    },
    email: {
        type: DataTypes.STRING,
        allowNull: false
    },
    password: {
        type: DataTypes.STRING,
        allowNull: false
    }
  }, {
    sequelize,
    modelName: 'User',
  });
  return User;
}; …
Run Code Online (Sandbox Code Playgroud)

postgresql database-migration node.js sequelize.js graphql

5
推荐指数
1
解决办法
1811
查看次数

此源的 Angular 12 内容和地图不可用(仅支持 size())

将我的 Angular 版本升级到最新版本后,出现错误:

Content and Map of this Source is not available (only size() is supported)
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激,因为有关此问题的信息并不多。

source-maps webpack angular

5
推荐指数
1
解决办法
3221
查看次数