S
S
Sergey2016-09-14 13:05:55
PostgreSQL
Sergey, 2016-09-14 13:05:55

How to declare auto increment for id field in nodejs express in postgresql?

How to declare auto increment for id field in nodejs express in postgresql?
Here is the code of my model created via 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": {}
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question