如何在strongloop中更改postgres数据源的架构?

时间:2016-03-18 01:47:42

标签: postgresql schema loopbackjs strongloop

我试图告诉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是一个占位符

1 个答案:

答案 0 :(得分:0)

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

更正选项值:

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