MongoDB migration

This commit is contained in:
2023-01-18 14:25:22 +01:00
parent 94f8839e53
commit e9e9e3784a
19 changed files with 462 additions and 138 deletions

16
validation/apikeys.json Normal file
View File

@@ -0,0 +1,16 @@
{
"$jsonSchema": {
"required": [
"user",
"hash"
],
"properties": {
"user": {
"bsonType": "string"
},
"hash": {
"bsonType": "binData"
}
}
}
}

24
validation/devices.json Normal file
View File

@@ -0,0 +1,24 @@
{
"$jsonSchema": {
"required": [
"user",
"name",
"os",
"last_save"
],
"properties": {
"user": {
"bsonType": "string"
},
"name": {
"bsonType": "string"
},
"os": {
"bsonType": "string"
},
"last_save": {
"bsonType": ["int", "double"]
}
}
}
}

12
validation/expired.json Normal file
View File

@@ -0,0 +1,12 @@
{
"$jsonSchema": {
"required": [
"hash"
],
"properties": {
"hash": {
"bsonType": "binData"
}
}
}
}

92
validation/saves.json Normal file
View File

@@ -0,0 +1,92 @@
{
"$jsonSchema": {
"required": [
"id",
"user",
"device",
"date",
"data",
"data.farmer",
"data.money",
"data.played",
"data.save_time",
"data.year",
"data.season",
"data.day",
"files",
"files.save",
"files.save.name",
"files.save.uuid",
"files.save.path",
"files.saveinfo",
"files.saveinfo.name",
"files.saveinfo.uuid",
"files.saveinfo.path"
],
"properties": {
"id": {
"bsonType": "int"
},
"user": {
"bsonType": "string"
},
"device": {
"bsonType": "string"
},
"date": {
"bsonType": ["int", "double"]
},
"data": {
"bsonType": "object"
},
"data.farmer": {
"bsonType": "string"
},
"data.money": {
"bsonType": "int"
},
"data.played": {
"bsonType": "int"
},
"data.save_time": {
"bsonType": "int"
},
"data.year": {
"bsonType": "int"
},
"data.season": {
"bsonType": "int"
},
"data.day": {
"bsonType": "int"
},
"files": {
"bsonType": "object"
},
"files.save": {
"bsonType": "object"
},
"files.save.name": {
"bsonType": "string"
},
"files.save.uuid": {
"bsonType": "string"
},
"files.save.path": {
"bsonType": "string"
},
"files.saveinfo": {
"bsonType": "object"
},
"files.saveinfo.name": {
"bsonType": "string"
},
"files.saveinfo.uuid": {
"bsonType": "string"
},
"files.saveinfo.path": {
"bsonType": "string"
}
}
}
}