init: add contract definitions and database schema with migrations skeleton
This commit is contained in:
37
contract/ingest/common.schema.json
Normal file
37
contract/ingest/common.schema.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "contract/ingest/common.schema.json",
|
||||
"type": "object",
|
||||
"required": ["v", "id", "type", "ts", "deviceId", "payload"],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"v": {
|
||||
"type": "integer",
|
||||
"const": 1
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["telemetry", "event"]
|
||||
},
|
||||
"ts": {
|
||||
"type": "integer",
|
||||
"minimum": 1600000000000,
|
||||
"description": "Unix time in milliseconds (UTC)"
|
||||
},
|
||||
"deviceId": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"payload": {
|
||||
"type": "object"
|
||||
},
|
||||
"meta": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user