Ignore:
Timestamp:
03/27/14 14:44:36 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Return to using truly ISO formatted dates, including milliseconds.
  • Also set constraint on surveyrun dates when value is initially set.
  • Separate runs & results from surveys and questions.
  • Moved date & email format to schema itself.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/server/config/couchdb-schema.json

    r525 r531  
    1010  "definitions": {
    1111    "nonEmptyString": { "type": "string", "minLength": 1 },
    12     "codeString": { "type": "string", "pattern": "^[A-Za-z0-9]+$" },
    13     "subcodeString": { "type": "string", "pattern": "^[A-Za-z0-9]*$" },
     12    "code": { "type": "string", "pattern": "^[A-Za-z0-9]+$" },
     13    "subcode": { "type": "string", "pattern": "^[A-Za-z0-9]*$" },
     14    "datetime": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"},
     15    "html5Email": {"type": "string", "pattern": "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$"},
    1416    "schemaInfo": {
    1517      "type": "object",
     
    4042          "_rev": { "$ref": "#/definitions/nonEmptyString" },
    4143          "categories": { "type": "array", "items": { "$ref": "#/definitions/nonEmptyString" } },
    42           "code": { "$ref": "#/definitions/codeString" },
     44          "code": { "$ref": "#/definitions/code" },
    4345          "content": { "type": "array", "items": { "$ref": "#/definitions/content/any" } },
    4446          "description": { "$ref": "#/definitions/nonEmptyString" },
    45           "publicationDate": { "type": "string", "format": "datetime" },
     47          "publicationDate": { "$ref": "#/definitions/datetime" },
    4648          "title": { "$ref": "#/definitions/nonEmptyString" },
    4749          "topic": { "$ref": "#/definitions/nonEmptyString" }
     
    5759          "_rev": { "$ref": "#/definitions/nonEmptyString" },
    5860          "description": { "$ref": "#/definitions/nonEmptyString" },
    59           "publicationDate": { "type": "string", "format": "datetime" },
     61          "publicationDate": { "$ref": "#/definitions/datetime" },
    6062          "questions": { "type": "array", "items": { "$ref": "#/definitions/docs/Question" } },
    6163          "title": { "$ref": "#/definitions/nonEmptyString" }
     
    7173          "_rev": { "$ref": "#/definitions/nonEmptyString" },
    7274          "description": { "$ref": "#/definitions/nonEmptyString" },
    73           "endDate": { "type": "string", "format": "datetime" },
    74           "liveName": { "$ref": "#/definitions/nonEmptyString" },
     75          "endDate": { "$ref": "#/definitions/datetime" },
    7576          "mode": { "type": "string", "enum": [ "open", "closed" ] },
    7677          "respondentCanDeleteOwnResponse": { "type": "boolean" },
    7778          "secret": { "$ref": "#/definitions/nonEmptyString" },
    78           "startDate": { "type": "string", "format": "datetime" },
     79          "startDate": { "$ref": "#/definitions/datetime" },
    7980          "survey": { "$ref": "#/definitions/docs/Survey" },
    8081          "title": { "$ref": "#/definitions/nonEmptyString" }
     
    9697              "additionalProperties": false
    9798          },
    98           "email": { "type": "string", "format": "email" },
    99           "publicationDate": { "type": "string", "format": "datetime" },
     99          "publicationDate": { "$ref": "#/definitions/datetime" },
    100100          "secret": { "$ref": "#/definitions/nonEmptyString" },
    101101          "surveyRunId": { "$ref": "#/definitions/nonEmptyString" }
     
    149149        "properties": {
    150150          "type": { "type": "string", "pattern": "^StringInput$" },
    151           "subcode": { "$ref": "#/definitions/subcodeString" },
     151          "subcode": { "$ref": "#/definitions/subcode" },
    152152          "text": { "$ref": "#/definitions/nonEmptyString" }
    153153        },
     
    160160          "type": { "type": "string", "pattern": "^TextInput$" },
    161161          "maxLength": { "type": "integer" },
    162           "subcode": { "$ref": "#/definitions/subcodeString" },
     162          "subcode": { "$ref": "#/definitions/subcode" },
    163163          "text": { "$ref": "#/definitions/nonEmptyString" }
    164164        },
     
    173173          "max": { "type": "integer" },
    174174          "places": { "type": "integer" },
    175           "subcode": { "$ref": "#/definitions/subcodeString" },
     175          "subcode": { "$ref": "#/definitions/subcode" },
    176176          "text": { "$ref": "#/definitions/nonEmptyString" }
    177177        },
     
    193193              "minLabel": { "$ref": "#/definitions/nonEmptyString" },
    194194              "maxLabel": { "$ref": "#/definitions/nonEmptyString" },
    195               "subcode": { "$ref": "#/definitions/subcodeString" },
     195              "subcode": { "$ref": "#/definitions/subcode" },
    196196              "text": { "$ref": "#/definitions/nonEmptyString" }
    197197            },
     
    219219              "type": "object",
    220220              "properties": {
    221                   "subcode": { "$ref": "#/definitions/subcodeString" }
     221                  "subcode": { "$ref": "#/definitions/subcode" }
    222222              },
    223223              "required": ["subcode"],
    224224              "additionalProperties": false
    225225          },
    226           "subcode": { "$ref": "#/definitions/subcodeString" }
     226          "subcode": { "$ref": "#/definitions/subcode" }
    227227        },
    228228        "required":["type","items","subcode"],
     
    236236              "type": "object",
    237237              "properties": {
    238                 "subcode": { "$ref": "#/definitions/subcodeString" },
     238                "subcode": { "$ref": "#/definitions/subcode" },
    239239                "text": { "$ref": "#/definitions/nonEmptyString" }
    240240              },
     
    245245              "type": "object",
    246246              "properties": {
    247                 "subcode": { "$ref": "#/definitions/subcodeString" }
     247                "subcode": { "$ref": "#/definitions/subcode" }
    248248              },
    249249              "required": ["subcode"],
Note: See TracChangeset for help on using the changeset viewer.