karmis
@karmis

Как в nodejs express в postgresql объявить в модели auto increment для поля id?

Как в nodejs express в postgresql объявить в модели auto increment для поля id ?

Вот код моей модели созданной через strongloop
{
  "name": "Message",
  "base": "",
  "idInjection": true,
  "options": {
    "validateUpsert": true
  },
  "properties": {
    "content": {
      "type": "string",
      "required": true
    },
    "parent_id": {
      "type": "Message"
    },
    "created": {
      "type": "date"
    },
    "updated": {
      "type": "date"
    },
    "deleted": {
      "type": "boolean"
    },
    "id": {
      "type": "string",
      "id": true,
      "generated": true,
      "index": true
    },
    "receiver_id": {
      "type": "User",
      "required": true
    },
    "sender_id": {
      "type": "User",
      "required": true
    }
  },
  "validations": [],
  "relations": {},
  "acls": [],
  "methods": {}
}
  • Вопрос задан
  • 291 просмотр
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы