【问题标题】:How do I change the schema of a postgres data source in strongloop?如何在 strongloop 中更改 postgres 数据源的架构?
【发布时间】:2016-07-04 15:19:37
【问题描述】:

我试图告诉 strongloop 我的画廊表已移至产品架构。将其添加到common/models/gallery.json 中的模型定义中似乎没有任何效果。强循环新手。我做错了什么?

我当前的架构。 "schema": "products" 是唯一添加的内容。

{
  "name": "gallery",
  "plural": "galleries",
  "base": "PersistedModel",
  "idInjection": true,
  "options": {
    "validateUpsert": true,
    "schema": "products"
  },
  "properties": {
    "id": {
      "type": "number"
    },
    "name": {
      "type": "string",
      "required": true
    },
    "description": {
      "type": "string"
    },
    "uuid": {
      "type": "uuid"
    },
    "test": {
      "type": "string"
    },
    "order": {
      "type": "number"
    }
  },
  "validations": [],
  "relations": {},
  "acls": [],
  "methods": {}
}

uuid 是占位符

【问题讨论】:

    标签: postgresql schema loopbackjs strongloop


    【解决方案1】:

    答案在这里:https://docs.strongloop.com/display/public/LB/PostgreSQL+connector

    正确的选项值:

      "options": {
        "validateUpsert": true,
        "postgresql": {
          "schema": "products"
        }
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-03-25
      • 2016-03-04
      • 1970-01-01
      • 1970-01-01
      • 2015-09-19
      • 2017-12-23
      • 2023-03-16
      相关资源
      最近更新 更多