[
{
"id": "pbc_1736455494",
"listRule": "",
"viewRule": "",
"createRule": "admin = false",
"updateRule": "@request.auth.id != \"\" &&\n@request.auth.id = id",
"deleteRule": null,
"name": "users",
"type": "auth",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text4166911607",
"max": 10,
"min": 3,
"name": "username",
"pattern": "",
"presentable": true,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2208304744",
"max": 0,
"min": 0,
"name": "firstname",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "file376926767",
"maxSelect": 1,
"maxSize": 0,
"mimeTypes": [
"image/avif"
],
"name": "avatar",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
},
{
"hidden": false,
"id": "bool2282622326",
"name": "admin",
"presentable": false,
"required": false,
"system": false,
"type": "bool"
},
{
"cost": 0,
"hidden": true,
"id": "password901924565",
"max": 0,
"min": 1,
"name": "password",
"pattern": "",
"presentable": false,
"required": true,
"system": true,
"type": "password"
},
{
"autogeneratePattern": "[a-zA-Z0-9]{50}",
"hidden": true,
"id": "text2504183744",
"max": 60,
"min": 30,
"name": "tokenKey",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": true,
"type": "text"
},
{
"exceptDomains": null,
"hidden": false,
"id": "email3885137012",
"name": "email",
"onlyDomains": null,
"presentable": false,
"required": false,
"system": true,
"type": "email"
},
{
"hidden": false,
"id": "bool1547992806",
"name": "emailVisibility",
"presentable": false,
"required": false,
"system": true,
"type": "bool"
},
{
"hidden": false,
"id": "bool256245529",
"name": "verified",
"presentable": false,
"required": false,
"system": true,
"type": "bool"
},
{
"hidden": true,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": true,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"indexes": [
"CREATE UNIQUE INDEX `idx_tokenKey_pbc_1736455494` ON `users` (`tokenKey`)",
"CREATE UNIQUE INDEX `idx_S35D9NRBbr` ON `users` (`username`)",
"CREATE UNIQUE INDEX `idx_email_pbc_1736455494` ON `users` (`email`) WHERE `email` != ''"
],
"system": false,
"authRule": "",
"manageRule": null,
"authAlert": {
"enabled": false,
"emailTemplate": {
"subject": "Login from a new location",
"body": "
Hello,
\nWe noticed a login to your {APP_NAME} account from a new location:
\n{ALERT_INFO}
\nIf this wasn't you, you should immediately change your {APP_NAME} account password to revoke access from all other locations.
\nIf this was you, you may disregard this email.
\n\n Thanks,
\n {APP_NAME} team\n
"
}
},
"oauth2": {
"mappedFields": {
"id": "",
"name": "",
"username": "",
"avatarURL": ""
},
"enabled": false
},
"passwordAuth": {
"enabled": true,
"identityFields": [
"username"
]
},
"mfa": {
"enabled": false,
"duration": 1800,
"rule": ""
},
"otp": {
"enabled": false,
"duration": 180,
"length": 8,
"emailTemplate": {
"subject": "OTP for {APP_NAME}",
"body": "Hello,
\nYour one-time password is: {OTP}
\nIf you didn't ask for the one-time password, you can ignore this email.
\n\n Thanks,
\n {APP_NAME} team\n
"
}
},
"authToken": {
"duration": 2592000
},
"passwordResetToken": {
"duration": 1800
},
"emailChangeToken": {
"duration": 1800
},
"verificationToken": {
"duration": 259200
},
"fileToken": {
"duration": 180
},
"verificationTemplate": {
"subject": "Verify your {APP_NAME} email",
"body": "Hello,
\nThank you for joining us at {APP_NAME}.
\nClick on the button below to verify your email address.
\n\n Verify\n
\n\n Thanks,
\n {APP_NAME} team\n
"
},
"resetPasswordTemplate": {
"subject": "Reset your {APP_NAME} password",
"body": "Hello,
\n\nUsing a password manager is essential for maintaining strong, unique passwords across all your accounts. Many people rely on short passwords or passwords made up of common words, but these are highly vulnerable to attacks like brute force and dictionary attacks. Hackers use automated tools to guess weak passwords in seconds, making it crucial to use long, random, and complex passwords.
\n\nReusing passwords is also a major security risk—if one account is compromised, all other accounts using the same password are at risk. A password manager helps generate and store unique passwords for each account, ensuring better security without the need to remember them all.
\n\nKeePassXC is an excellent choice for managing passwords securely. Unlike cloud-based services like LastPass—which has suffered multiple security breaches—KeePassXC stores your passwords locally, giving you full control over your data and how to synchronize it to your devices. Because it does not rely on external providers, your passwords remain safe from large-scale hacks or data leaks. With strong encryption and open-source transparency, KeePassXC is a reliable tool for protecting your online accounts.
\n\nClick on the button below to reset your password.
\n\n\n Reset password\n
\n\nIf you didn't ask to reset your password, you can ignore this email.
\n\n\n Thanks,
\n {APP_NAME} team\n
"
},
"confirmEmailChangeTemplate": {
"subject": "Confirm your {APP_NAME} new email address",
"body": "Hello,
\nClick on the button below to confirm your new email address.
\n\n Confirm new email\n
\nIf you didn't ask to change your email address, you can ignore this email.
\n\n Thanks,
\n {APP_NAME} team\n
"
}
},
{
"id": "pbc_4275539003",
"listRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId",
"viewRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId",
"createRule": null,
"updateRule": null,
"deleteRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId",
"name": "_authOrigins",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text455797646",
"max": 0,
"min": 0,
"name": "collectionRef",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text127846527",
"max": 0,
"min": 0,
"name": "recordRef",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text4228609354",
"max": 0,
"min": 0,
"name": "fingerprint",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": true,
"type": "text"
},
{
"hidden": false,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": true,
"type": "autodate"
},
{
"hidden": false,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": true,
"type": "autodate"
}
],
"indexes": [
"CREATE UNIQUE INDEX `idx_authOrigins_unique_pairs` ON `_authOrigins` (collectionRef, recordRef, fingerprint)"
],
"system": true
},
{
"id": "pbc_2281828961",
"listRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId",
"viewRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId",
"createRule": null,
"updateRule": null,
"deleteRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId",
"name": "_externalAuths",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text455797646",
"max": 0,
"min": 0,
"name": "collectionRef",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text127846527",
"max": 0,
"min": 0,
"name": "recordRef",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2462348188",
"max": 0,
"min": 0,
"name": "provider",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1044722854",
"max": 0,
"min": 0,
"name": "providerId",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": true,
"type": "text"
},
{
"hidden": false,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": true,
"type": "autodate"
},
{
"hidden": false,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": true,
"type": "autodate"
}
],
"indexes": [
"CREATE UNIQUE INDEX `idx_externalAuths_record_provider` ON `_externalAuths` (collectionRef, recordRef, provider)",
"CREATE UNIQUE INDEX `idx_externalAuths_collection_provider` ON `_externalAuths` (collectionRef, provider, providerId)"
],
"system": true
},
{
"id": "pbc_2279338944",
"listRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId",
"viewRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "_mfas",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text455797646",
"max": 0,
"min": 0,
"name": "collectionRef",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text127846527",
"max": 0,
"min": 0,
"name": "recordRef",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1582905952",
"max": 0,
"min": 0,
"name": "method",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": true,
"type": "text"
},
{
"hidden": false,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": true,
"type": "autodate"
},
{
"hidden": false,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": true,
"type": "autodate"
}
],
"indexes": [
"CREATE INDEX `idx_mfas_collectionRef_recordRef` ON `_mfas` (collectionRef,recordRef)"
],
"system": true
},
{
"id": "pbc_1638494021",
"listRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId",
"viewRule": "@request.auth.id != '' && recordRef = @request.auth.id && collectionRef = @request.auth.collectionId",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "_otps",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text455797646",
"max": 0,
"min": 0,
"name": "collectionRef",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text127846527",
"max": 0,
"min": 0,
"name": "recordRef",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": true,
"type": "text"
},
{
"cost": 8,
"hidden": true,
"id": "password901924565",
"max": 0,
"min": 0,
"name": "password",
"pattern": "",
"presentable": false,
"required": true,
"system": true,
"type": "password"
},
{
"autogeneratePattern": "",
"hidden": true,
"id": "text3866985172",
"max": 0,
"min": 0,
"name": "sentTo",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": true,
"type": "text"
},
{
"hidden": false,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": true,
"type": "autodate"
},
{
"hidden": false,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": true,
"type": "autodate"
}
],
"indexes": [
"CREATE INDEX `idx_otps_collectionRef_recordRef` ON `_otps` (collectionRef, recordRef)"
],
"system": true
},
{
"id": "pbc_1967373549",
"listRule": "",
"viewRule": "",
"createRule": "@request.auth.id != \"\" && @request.auth.admin = true",
"updateRule": "@request.auth.id != \"\" && @request.auth.admin = true",
"deleteRule": "@request.auth.id != \"\" && @request.auth.admin = true",
"name": "drivers",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3170058525",
"max": 3,
"min": 3,
"name": "code",
"pattern": "",
"presentable": true,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2208304744",
"max": 0,
"min": 0,
"name": "firstname",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text824489398",
"max": 0,
"min": 0,
"name": "lastname",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "file2600164848",
"maxSelect": 1,
"maxSize": 0,
"mimeTypes": [
"image/avif"
],
"name": "headshot",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1568971955",
"hidden": false,
"id": "relation3303056927",
"maxSelect": 1,
"minSelect": 0,
"name": "team",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"hidden": false,
"id": "bool1260321794",
"name": "active",
"presentable": false,
"required": false,
"system": false,
"type": "bool"
},
{
"hidden": false,
"id": "bool3136797097",
"name": "started_active",
"presentable": false,
"required": false,
"system": false,
"type": "bool"
},
{
"hidden": true,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": true,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"indexes": [
"CREATE UNIQUE INDEX `idx_ChY3iWmGqf` ON `drivers` (\n `code`,\n `team`\n)"
],
"system": false
},
{
"id": "pbc_2156389441",
"listRule": "",
"viewRule": "",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "graphics",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1579384326",
"max": 0,
"min": 0,
"name": "name",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "file1542800728",
"maxSelect": 1,
"maxSize": 0,
"mimeTypes": [
"image/avif"
],
"name": "file",
"presentable": false,
"protected": false,
"required": true,
"system": false,
"thumbs": [],
"type": "file"
},
{
"hidden": true,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": true,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"indexes": [
"CREATE UNIQUE INDEX `idx_iRolOJcYaN` ON `graphics` (`name`)"
],
"system": false
},
{
"id": "pbc_406441476",
"listRule": "@request.auth.id != \"\" // If you know what you're doing you can easily request all picks here. But If I restrict this to the current user, the subscription events are blocked...",
"viewRule": "@request.auth.id != \"\" &&\n@request.auth.id = user // Can only view your own picks in this collection - otherwise use \"visibleracepicks\" collection",
"createRule": "@request.auth.id != \"\" &&\n@request.auth.id = user &&\n@now <= race.racedate",
"updateRule": "@request.auth.id != \"\" &&\n@request.auth.id = user &&\n@now <= race.racedate",
"deleteRule": "@request.auth.id != \"\" &&\n@request.auth.id = user &&\n@now <= race.racedate",
"name": "racepicks",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1736455494",
"hidden": false,
"id": "relation2375276105",
"maxSelect": 1,
"minSelect": 0,
"name": "user",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_2533072930",
"hidden": false,
"id": "relation3664755631",
"maxSelect": 1,
"minSelect": 0,
"name": "race",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "relation310950834",
"maxSelect": 1,
"minSelect": 0,
"name": "pxx",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "relation4012914858",
"maxSelect": 1,
"minSelect": 0,
"name": "dnf",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
},
{
"hidden": true,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": true,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"indexes": [
"CREATE UNIQUE INDEX `idx_2auZU3ZYMO` ON `racepicks` (\n `user`,\n `race`\n)"
],
"system": false
},
{
"id": "pbc_4231478832",
"listRule": "",
"viewRule": "",
"createRule": "@request.auth.id != \"\" &&\n@request.auth.admin = true &&\n@now >= race.racedate",
"updateRule": "@request.auth.id != \"\" && \n@request.auth.admin = true &&\n@now >= race.racedate",
"deleteRule": null,
"name": "raceresults",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"cascadeDelete": false,
"collectionId": "pbc_2533072930",
"hidden": false,
"id": "relation3664755631",
"maxSelect": 1,
"minSelect": 0,
"name": "race",
"presentable": true,
"required": false,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "relation1047762192",
"maxSelect": 7,
"minSelect": 0,
"name": "pxxs",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "relation769832389",
"maxSelect": 20,
"minSelect": 0,
"name": "dnfs",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
},
{
"hidden": true,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": true,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"indexes": [
"CREATE UNIQUE INDEX `idx_sEW62VJfmW` ON `raceresults` (`race`)"
],
"system": false
},
{
"id": "pbc_2533072930",
"listRule": "",
"viewRule": "",
"createRule": "@request.auth.id != \"\" && @request.auth.admin = true",
"updateRule": "@request.auth.id != \"\" && @request.auth.admin = true",
"deleteRule": "@request.auth.id != \"\" && @request.auth.admin = true",
"name": "races",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1579384326",
"max": 0,
"min": 0,
"name": "name",
"pattern": "",
"presentable": true,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "number1136262716",
"max": null,
"min": null,
"name": "step",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"hidden": false,
"id": "file1457561951",
"maxSelect": 1,
"maxSize": 0,
"mimeTypes": [
"image/avif"
],
"name": "pictogram",
"presentable": false,
"protected": false,
"required": true,
"system": false,
"thumbs": [],
"type": "file"
},
{
"hidden": false,
"id": "number310950834",
"max": null,
"min": null,
"name": "pxx",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"hidden": false,
"id": "date4138285749",
"max": "",
"min": "",
"name": "sprintqualidate",
"presentable": false,
"required": false,
"system": false,
"type": "date"
},
{
"hidden": false,
"id": "date1266338464",
"max": "",
"min": "",
"name": "sprintdate",
"presentable": false,
"required": false,
"system": false,
"type": "date"
},
{
"hidden": false,
"id": "date2825791974",
"max": "",
"min": "",
"name": "qualidate",
"presentable": false,
"required": true,
"system": false,
"type": "date"
},
{
"hidden": false,
"id": "date4076757882",
"max": "",
"min": "",
"name": "racedate",
"presentable": false,
"required": true,
"system": false,
"type": "date"
},
{
"hidden": true,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": true,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"indexes": [
"CREATE UNIQUE INDEX `idx_MOzS2Ww4Sk` ON `races` (`name`)",
"CREATE UNIQUE INDEX `idx_Uiw6vPV2wy` ON `races` (`step`)"
],
"system": false
},
{
"id": "pbc_3023263128",
"listRule": "",
"viewRule": "",
"createRule": "",
"updateRule": "",
"deleteRule": "",
"name": "scraped_driverstandings",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2428491277",
"max": 3,
"min": 3,
"name": "driver_code",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "number1177347317",
"max": null,
"min": 1,
"name": "position",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"hidden": false,
"id": "number666537513",
"max": null,
"min": 0,
"name": "points",
"onlyInt": false,
"presentable": false,
"required": false,
"system": false,
"type": "number"
},
{
"hidden": false,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": false,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"indexes": [],
"system": false
},
{
"id": "pbc_2182053151",
"listRule": "",
"viewRule": "",
"createRule": "",
"updateRule": "",
"deleteRule": "",
"name": "scraped_raceresults",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"hidden": false,
"id": "number516222579",
"max": 24,
"min": 1,
"name": "race_step",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3112802451",
"max": 3,
"min": 3,
"name": "driver_code",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "number1177347317",
"max": null,
"min": 1,
"name": "position",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2063623452",
"max": 0,
"min": 0,
"name": "status",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "number666537513",
"max": null,
"min": 0,
"name": "points",
"onlyInt": false,
"presentable": false,
"required": false,
"system": false,
"type": "number"
},
{
"hidden": false,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": false,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"indexes": [
"CREATE UNIQUE INDEX `idx_JT8bhbV2YG` ON `scraped_raceresults` (\n `race_step`,\n `driver_code`\n)",
"CREATE UNIQUE INDEX `idx_hFngwBjU8j` ON `scraped_raceresults` (\n `race_step`,\n `position`\n)"
],
"system": false
},
{
"id": "pbc_2435909571",
"listRule": "",
"viewRule": "",
"createRule": "",
"updateRule": "",
"deleteRule": "",
"name": "scraped_startinggrids",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"hidden": false,
"id": "number516222579",
"max": 24,
"min": 1,
"name": "race_step",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text2428491277",
"max": 3,
"min": 3,
"name": "driver_code",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "number1177347317",
"max": 20,
"min": 1,
"name": "position",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1872009285",
"max": 0,
"min": 0,
"name": "time",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
},
{
"hidden": true,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": true,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"indexes": [
"CREATE UNIQUE INDEX `idx_QPaZOui4P1` ON `scraped_startinggrids` (\n `race_step`,\n `driver_code`\n)",
"CREATE UNIQUE INDEX `idx_1bfQwZkKBX` ON `scraped_startinggrids` (\n `race_step`,\n `position`\n)"
],
"system": false
},
{
"id": "pbc_286850423",
"listRule": "",
"viewRule": "",
"createRule": "",
"updateRule": "",
"deleteRule": "",
"name": "scraped_teamstandings",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text690463184",
"max": 0,
"min": 0,
"name": "team_fullname",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "number1177347317",
"max": 10,
"min": 1,
"name": "position",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"hidden": false,
"id": "number666537513",
"max": null,
"min": 0,
"name": "points",
"onlyInt": false,
"presentable": false,
"required": false,
"system": false,
"type": "number"
},
{
"hidden": false,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": false,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"indexes": [],
"system": false
},
{
"id": "pbc_1473742649",
"listRule": "@request.auth.id != \"\" // If you know what you're doing you can easily request all picks here. But If I restrict this to the current user, the subscription events are blocked...",
"viewRule": "@request.auth.id != \"\" &&\n@request.auth.id = user // Can only view your own picks in this collection - otherwise use \"visibleseasonpicks\" collection",
"createRule": "@request.auth.id != \"\" &&\n@request.auth.id = user &&\n@collection.visibleseasonpickslength.total <= 0 // Can only change picks when no seasonpick is visible - use this indirection because the view collection uses the first race.qualidate",
"updateRule": "@request.auth.id != \"\" &&\n@request.auth.id = user &&\n@collection.visibleseasonpickslength.total <= 0 // Can only change picks when no seasonpick is visible - use this indirection because the view collection uses the first race.qualidate",
"deleteRule": "@request.auth.id != \"\" &&\n@request.auth.id = user &&\n@collection.visibleseasonpickslength.total <= 0 // Can only change picks when no seasonpick is visible - use this indirection because the view collection uses the first race.qualidate",
"name": "seasonpicks",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1736455494",
"hidden": false,
"id": "relation2375276105",
"maxSelect": 1,
"minSelect": 0,
"name": "user",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3327956763",
"max": 0,
"min": 0,
"name": "hottake",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "relation553681702",
"maxSelect": 1,
"minSelect": 0,
"name": "wdcwinner",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1568971955",
"hidden": false,
"id": "relation1540110664",
"maxSelect": 1,
"minSelect": 0,
"name": "wccwinner",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "relation3896658669",
"maxSelect": 1,
"minSelect": 0,
"name": "mostovertakes",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "relation3731883446",
"maxSelect": 1,
"minSelect": 0,
"name": "mostdnfs",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"hidden": false,
"id": "number1147572598",
"max": null,
"min": null,
"name": "doohanstarts",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "relation1938994230",
"maxSelect": 10,
"minSelect": 10,
"name": "teamwinners",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "relation3915334665",
"maxSelect": 20,
"minSelect": 3,
"name": "podiums",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"hidden": true,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": true,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"indexes": [
"CREATE UNIQUE INDEX `idx_gt281Qtgxw` ON `seasonpicks` (`user`)"
],
"system": false
},
{
"id": "pbc_1391974664",
"listRule": "",
"viewRule": "",
"createRule": "@request.auth.id != \"\" && @request.auth.admin = true",
"updateRule": "@request.auth.id != \"\" && @request.auth.admin = true",
"deleteRule": "@request.auth.id != \"\" && @request.auth.admin = true",
"name": "substitutions",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "relation3488830393",
"maxSelect": 1,
"minSelect": 0,
"name": "substitute",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "relation291929305",
"maxSelect": 1,
"minSelect": 0,
"name": "for",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_2533072930",
"hidden": false,
"id": "relation3664755631",
"maxSelect": 1,
"minSelect": 0,
"name": "race",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"hidden": true,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": true,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"indexes": [
"CREATE UNIQUE INDEX `idx_xq8hlnWI6F` ON `substitutions` (\n `substitute`,\n `race`\n)",
"CREATE UNIQUE INDEX `idx_AnXs2xjbGH` ON `substitutions` (\n `for`,\n `race`\n)"
],
"system": false
},
{
"id": "pbc_1568971955",
"listRule": "",
"viewRule": "",
"createRule": "@request.auth.id != \"\" && @request.auth.admin = true",
"updateRule": "@request.auth.id != \"\" && @request.auth.admin = true",
"deleteRule": "@request.auth.id != \"\" && @request.auth.admin = true",
"name": "teams",
"type": "base",
"fields": [
{
"autogeneratePattern": "[a-z0-9]{15}",
"hidden": false,
"id": "text3208210256",
"max": 15,
"min": 15,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1579384326",
"max": 0,
"min": 0,
"name": "name",
"pattern": "",
"presentable": true,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "file3834550803",
"maxSelect": 1,
"maxSize": 0,
"mimeTypes": [
"image/avif"
],
"name": "banner",
"presentable": false,
"protected": false,
"required": true,
"system": false,
"thumbs": [],
"type": "file"
},
{
"hidden": false,
"id": "file1704208859",
"maxSelect": 1,
"maxSize": 0,
"mimeTypes": [
"image/avif"
],
"name": "logo",
"presentable": false,
"protected": false,
"required": true,
"system": false,
"thumbs": [],
"type": "file"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "text1716930793",
"max": 0,
"min": 0,
"name": "color",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": true,
"id": "autodate2990389176",
"name": "created",
"onCreate": true,
"onUpdate": false,
"presentable": false,
"system": false,
"type": "autodate"
},
{
"hidden": true,
"id": "autodate3332085495",
"name": "updated",
"onCreate": true,
"onUpdate": true,
"presentable": false,
"system": false,
"type": "autodate"
}
],
"indexes": [
"CREATE UNIQUE INDEX `idx_lDc1lxx3SD` ON `teams` (`name`)"
],
"system": false
},
{
"id": "pbc_2516393357",
"listRule": "",
"viewRule": "",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "currentpickedusers",
"type": "view",
"fields": [
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3208210256",
"max": 0,
"min": 0,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_8Abk",
"max": 10,
"min": 3,
"name": "username",
"pattern": "",
"presentable": true,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_s6Vb",
"max": 0,
"min": 0,
"name": "firstname",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "_clone_3shc",
"maxSelect": 1,
"maxSize": 0,
"mimeTypes": [
"image/avif"
],
"name": "avatar",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
},
{
"hidden": false,
"id": "_clone_Phc6",
"name": "admin",
"presentable": false,
"required": false,
"system": false,
"type": "bool"
},
{
"hidden": false,
"id": "json294059985",
"maxSize": 1,
"name": "picked",
"presentable": false,
"required": false,
"system": false,
"type": "json"
}
],
"indexes": [],
"system": false,
"viewQuery": "-- This query returns users with an extra field \"picked\", depending on if they made their picks for the next race yet\nSELECT\n user.id, user.username, user.firstname, user.avatar, user.admin,\n -- Generate the additional field \"picked\" that contains the current picks ID if the user occurs in the picks for the current race and NULL otherwise\n (CASE\n WHEN rp.user IS NOT NULL THEN rp.id\n ELSE NULL\n END) AS picked\nFROM\n users user\n-- Join users and racepicks where the race matches the current race id (user ids that are missing from this join will receive picked=false)\nLEFT JOIN\n racepicks rp ON user.id = rp.user AND rp.race IN (SELECT id FROM currentrace)\nORDER BY user.id ASC;"
},
{
"id": "pbc_1737461865",
"listRule": "",
"viewRule": "",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "currentrace",
"type": "view",
"fields": [
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3208210256",
"max": 0,
"min": 0,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_Lqek",
"max": 0,
"min": 0,
"name": "name",
"pattern": "",
"presentable": true,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "_clone_74gl",
"max": null,
"min": null,
"name": "step",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"hidden": false,
"id": "_clone_XSiN",
"maxSelect": 1,
"maxSize": 0,
"mimeTypes": [
"image/avif"
],
"name": "pictogram",
"presentable": false,
"protected": false,
"required": true,
"system": false,
"thumbs": [],
"type": "file"
},
{
"hidden": false,
"id": "_clone_Dt5c",
"max": null,
"min": null,
"name": "pxx",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"hidden": false,
"id": "_clone_DjBN",
"max": "",
"min": "",
"name": "sprintqualidate",
"presentable": false,
"required": false,
"system": false,
"type": "date"
},
{
"hidden": false,
"id": "_clone_9JoH",
"max": "",
"min": "",
"name": "sprintdate",
"presentable": false,
"required": false,
"system": false,
"type": "date"
},
{
"hidden": false,
"id": "_clone_3g96",
"max": "",
"min": "",
"name": "qualidate",
"presentable": false,
"required": true,
"system": false,
"type": "date"
},
{
"hidden": false,
"id": "_clone_ikdE",
"max": "",
"min": "",
"name": "racedate",
"presentable": false,
"required": true,
"system": false,
"type": "date"
}
],
"indexes": [],
"system": false,
"viewQuery": "-- This query will select the first race that doesn't have a related result (ordered by race step)\nSELECT race.id, race.name, race.step, race.pictogram, race.pxx, race.sprintqualidate, race.sprintdate, race.qualidate, race.racedate\nFROM races race\n\n-- Join the races to the raceresults (keeps all races rows)\nLEFT JOIN raceresults raceresult ON race.id = raceresult.race\n\n-- Choose entries that don't have a raceresult\nWHERE raceresult.race IS NULL\n\n-- Order by race step\nORDER BY race.step ASC\n\n-- Only choose the first entry\nLIMIT 1;"
},
{
"id": "pbc_3434655479",
"listRule": "",
"viewRule": "",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "hottakes",
"type": "view",
"fields": [
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3208210256",
"max": 0,
"min": 0,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1736455494",
"hidden": false,
"id": "_clone_m714",
"maxSelect": 1,
"minSelect": 0,
"name": "user",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_kDMs",
"max": 0,
"min": 0,
"name": "hottake",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
}
],
"indexes": [],
"system": false,
"viewQuery": "SELECT sp.id, sp.user, sp.hottake\nFROM seasonpicks sp;"
},
{
"id": "pbc_2367054703",
"listRule": "",
"viewRule": "",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "racepickpoints",
"type": "view",
"fields": [
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3208210256",
"max": 0,
"min": 0,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1736455494",
"hidden": false,
"id": "_clone_jTU8",
"maxSelect": 1,
"minSelect": 0,
"name": "user",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"hidden": false,
"id": "_clone_VwLb",
"max": null,
"min": null,
"name": "step",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"hidden": false,
"id": "json1659416786",
"maxSize": 1,
"name": "pxx_points",
"presentable": false,
"required": false,
"system": false,
"type": "json"
},
{
"hidden": false,
"id": "json4198926754",
"maxSize": 1,
"name": "dnf_points",
"presentable": false,
"required": false,
"system": false,
"type": "json"
}
],
"indexes": [],
"system": false,
"viewQuery": "SELECT\n rp.id,\n rp.user,\n -- rp.race,\n r.step,\n \n -- rp.pxx,\n -- rr.pxxs,\n (CASE\n -- Correct pxx pick\n WHEN rp.pxx = JSON_EXTRACT(rr.pxxs, '$[3]') THEN 10\n \n WHEN rp.pxx = JSON_EXTRACT(rr.pxxs, '$[2]') THEN 6\n WHEN rp.pxx = JSON_EXTRACT(rr.pxxs, '$[4]') THEN 6\n WHEN rp.pxx = JSON_EXTRACT(rr.pxxs, '$[1]') THEN 3\n WHEN rp.pxx = JSON_EXTRACT(rr.pxxs, '$[5]') THEN 3\n WHEN rp.pxx = JSON_EXTRACT(rr.pxxs, '$[0]') THEN 1\n WHEN rp.pxx = JSON_EXTRACT(rr.pxxs, '$[6]') THEN 1\n \n ELSE 0 \n END) AS pxx_points,\n \n -- rp.dnf,\n -- rr.dnfs,\n (CASE\n -- Correct dnf pick with a single DNF\n -- WHEN rr.dnfs LIKE '[\"' || rp.dnf || '\"]' THEN 10\n \n -- Correct dnf pick with single or multiple DNFs\n WHEN rr.dnfs LIKE '[%\"' || rp.dnf || '\"%]' THEN 10\n \n ELSE 0 \n END) AS dnf_points\nFROM racepicks rp\nJOIN races r ON rp.race = r.id\nJOIN raceresults rr ON rp.race = rr.race\n-- WHERE pxx_points > 0 OR dnf_points > 0\nORDER BY r.step ASC;"
},
{
"id": "pbc_4223880558",
"listRule": "",
"viewRule": "",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "racepickpointsacc",
"type": "view",
"fields": [
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3208210256",
"max": 0,
"min": 0,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1736455494",
"hidden": false,
"id": "_clone_fDe7",
"maxSelect": 1,
"minSelect": 0,
"name": "user",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"hidden": false,
"id": "_clone_dFLq",
"max": null,
"min": null,
"name": "step",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"hidden": false,
"id": "json1186524854",
"maxSize": 1,
"name": "acc_pxx_points",
"presentable": false,
"required": false,
"system": false,
"type": "json"
},
{
"hidden": false,
"id": "json3726038982",
"maxSize": 1,
"name": "acc_dnf_points",
"presentable": false,
"required": false,
"system": false,
"type": "json"
},
{
"hidden": false,
"id": "json2780867541",
"maxSize": 1,
"name": "acc_points",
"presentable": false,
"required": false,
"system": false,
"type": "json"
}
],
"indexes": [],
"system": false,
"viewQuery": "SELECT\n p.id,\n p.user,\n p.step,\n (SUM(p.pxx_points) OVER(PARTITION BY p.user ORDER BY p.step ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)) AS acc_pxx_points,\n (SUM(p.dnf_points) OVER(PARTITION BY p.user ORDER BY p.step ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)) AS acc_dnf_points,\n (SUM(p.pxx_points + p.dnf_points) OVER(PARTITION BY p.user ORDER BY p.step ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)) AS acc_points\nFROM racepickpoints p\nORDER BY step ASC;"
},
{
"id": "pbc_3585110310",
"listRule": "",
"viewRule": "",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "racepickpointstotal",
"type": "view",
"fields": [
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3208210256",
"max": 0,
"min": 0,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1736455494",
"hidden": false,
"id": "_clone_M37B",
"maxSelect": 1,
"minSelect": 0,
"name": "user",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"hidden": false,
"id": "json2525027839",
"maxSize": 1,
"name": "total_pxx_points",
"presentable": false,
"required": false,
"system": false,
"type": "json"
},
{
"hidden": false,
"id": "json237954191",
"maxSize": 1,
"name": "total_dnf_points",
"presentable": false,
"required": false,
"system": false,
"type": "json"
},
{
"hidden": false,
"id": "json4021202239",
"maxSize": 1,
"name": "total_points",
"presentable": false,
"required": false,
"system": false,
"type": "json"
},
{
"hidden": false,
"id": "json1247457462",
"maxSize": 1,
"name": "total_points_per_pick",
"presentable": false,
"required": false,
"system": false,
"type": "json"
}
],
"indexes": [],
"system": false,
"viewQuery": "SELECT\n p.id,\n p.user,\n SUM(p.pxx_points) AS total_pxx_points,\n SUM(p.dnf_points) AS total_dnf_points,\n SUM(p.pxx_points + p.dnf_points) AS total_points,\n (CAST(SUM(p.pxx_points + p.dnf_points) AS REAL) / COUNT(*)) AS total_points_per_pick\nFROM racepickpoints p\nGROUP BY user\nORDER BY total_points DESC;"
},
{
"id": "pbc_2823555101",
"listRule": "",
"viewRule": "",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "raceresultsdesc",
"type": "view",
"fields": [
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3208210256",
"max": 0,
"min": 0,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"cascadeDelete": false,
"collectionId": "pbc_2533072930",
"hidden": false,
"id": "_clone_Lw6s",
"maxSelect": 1,
"minSelect": 0,
"name": "race",
"presentable": true,
"required": false,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "_clone_dlrx",
"maxSelect": 7,
"minSelect": 0,
"name": "pxxs",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "_clone_YWtq",
"maxSelect": 20,
"minSelect": 0,
"name": "dnfs",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
}
],
"indexes": [],
"system": false,
"viewQuery": "-- This query simply returns the raceresults sorted by their race steps (descending).\nSELECT result.id, result.race, result.pxxs, result.dnfs\nFROM raceresults result\nJOIN races race ON result.race = race.id\nORDER BY race.step DESC;"
},
{
"id": "pbc_3189024959",
"listRule": "",
"viewRule": "",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "scraped_raceresultsacc",
"type": "view",
"fields": [
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3208210256",
"max": 0,
"min": 0,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"hidden": false,
"id": "_clone_YEQY",
"max": 24,
"min": 1,
"name": "race_step",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_lePz",
"max": 3,
"min": 3,
"name": "driver_code",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "json2780867541",
"maxSize": 1,
"name": "acc_points",
"presentable": false,
"required": false,
"system": false,
"type": "json"
}
],
"indexes": [],
"system": false,
"viewQuery": "SELECT\n r.id,\n r.race_step,\n r.driver_code,\n (SUM(r.points) OVER(PARTITION BY r.driver_code ORDER BY r.race_step ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)) AS acc_points\nFROM scraped_raceresults r\nORDER BY race_step ASC;"
},
{
"id": "pbc_1743016826",
"listRule": "",
"viewRule": "",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "seasonpickedusers",
"type": "view",
"fields": [
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3208210256",
"max": 0,
"min": 0,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_u2Xp",
"max": 10,
"min": 3,
"name": "username",
"pattern": "",
"presentable": true,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_IGYL",
"max": 0,
"min": 0,
"name": "firstname",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"hidden": false,
"id": "_clone_sEZH",
"maxSelect": 1,
"maxSize": 0,
"mimeTypes": [
"image/avif"
],
"name": "avatar",
"presentable": false,
"protected": false,
"required": false,
"system": false,
"thumbs": [],
"type": "file"
},
{
"hidden": false,
"id": "_clone_Aev1",
"name": "admin",
"presentable": false,
"required": false,
"system": false,
"type": "bool"
},
{
"hidden": false,
"id": "json294059985",
"maxSize": 1,
"name": "picked",
"presentable": false,
"required": false,
"system": false,
"type": "json"
}
],
"indexes": [],
"system": false,
"viewQuery": "-- This query returns users with an extra field \"picked\", depending on if they made their season picks yet\nSELECT\n user.id, user.username, user.firstname, user.avatar, user.admin,\n -- Generate the additional field \"picked\" that contains the season pick ID if the user occurs in the seasonpicks and false otherwise\n (CASE\n WHEN sp.user IS NOT NULL THEN sp.id\n ELSE NULL\n END) AS picked\nFROM\n users user\n-- Join users and seasonpicks (user ids that are missing from this join will receive picked=false)\nLEFT JOIN\n seasonpicks sp ON user.id = sp.user\nORDER BY user.id ASC;"
},
{
"id": "pbc_575507001",
"listRule": "",
"viewRule": "",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "visibleracepicks",
"type": "view",
"fields": [
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3208210256",
"max": 0,
"min": 0,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1736455494",
"hidden": false,
"id": "_clone_a4Gn",
"maxSelect": 1,
"minSelect": 0,
"name": "user",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_2533072930",
"hidden": false,
"id": "_clone_scFa",
"maxSelect": 1,
"minSelect": 0,
"name": "race",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "_clone_Z5l5",
"maxSelect": 1,
"minSelect": 0,
"name": "pxx",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "_clone_0ry6",
"maxSelect": 1,
"minSelect": 0,
"name": "dnf",
"presentable": false,
"required": false,
"system": false,
"type": "relation"
}
],
"indexes": [],
"system": false,
"viewQuery": "-- This query returns all racepicks except the ones for the currentrace\nSELECT pick.id, pick.user, pick.race, pick.pxx, pick.dnf\nFROM racepicks pick\nWHERE pick.race NOT IN (SELECT cr.id FROM currentrace cr);"
},
{
"id": "pbc_1284403322",
"listRule": "",
"viewRule": "",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "visibleseasonpicks",
"type": "view",
"fields": [
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3208210256",
"max": 0,
"min": 0,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1736455494",
"hidden": false,
"id": "_clone_Z44W",
"maxSelect": 1,
"minSelect": 0,
"name": "user",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"autogeneratePattern": "",
"hidden": false,
"id": "_clone_ivB8",
"max": 0,
"min": 0,
"name": "hottake",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": true,
"system": false,
"type": "text"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "_clone_RgzD",
"maxSelect": 1,
"minSelect": 0,
"name": "wdcwinner",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1568971955",
"hidden": false,
"id": "_clone_nnZX",
"maxSelect": 1,
"minSelect": 0,
"name": "wccwinner",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "_clone_wNY4",
"maxSelect": 1,
"minSelect": 0,
"name": "mostovertakes",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "_clone_okPh",
"maxSelect": 1,
"minSelect": 0,
"name": "mostdnfs",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"hidden": false,
"id": "_clone_9rOH",
"max": null,
"min": null,
"name": "doohanstarts",
"onlyInt": true,
"presentable": false,
"required": true,
"system": false,
"type": "number"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "_clone_WZjB",
"maxSelect": 10,
"minSelect": 10,
"name": "teamwinners",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
},
{
"cascadeDelete": false,
"collectionId": "pbc_1967373549",
"hidden": false,
"id": "_clone_870o",
"maxSelect": 20,
"minSelect": 3,
"name": "podiums",
"presentable": false,
"required": true,
"system": false,
"type": "relation"
}
],
"indexes": [],
"system": false,
"viewQuery": "-- This query only returns the season picks if the first race has started\nSELECT pick.id, pick.user, pick.hottake, pick.wdcwinner, pick.wccwinner, pick.mostovertakes, pick.mostdnfs, pick.doohanstarts, pick.teamwinners, pick.podiums\nFROM seasonpicks pick\nWHERE DATETIME('now') >= (SELECT MIN(qualidate) FROM races);"
},
{
"id": "pbc_638641526",
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"name": "visibleseasonpickslength",
"type": "view",
"fields": [
{
"autogeneratePattern": "",
"hidden": false,
"id": "text3208210256",
"max": 0,
"min": 0,
"name": "id",
"pattern": "^[a-z0-9]+$",
"presentable": false,
"primaryKey": true,
"required": true,
"system": true,
"type": "text"
},
{
"hidden": false,
"id": "number3257917790",
"max": null,
"min": null,
"name": "total",
"onlyInt": false,
"presentable": false,
"required": false,
"system": false,
"type": "number"
}
],
"indexes": [],
"system": false,
"viewQuery": "-- This is used inside the seasonpicks API filters\nSELECT\n (ROW_NUMBER() OVER()) as id,\n COUNT(\"*\") as total\nFROM visibleseasonpicks"
}
]