Mobile-first Web-App fuer persoenliches Health-, Ernaehrungs-, Aktivitaets- und Einkaufs-Tracking im Home-Lab-Betrieb. Stack: pnpm Monorepo - Next.js 16 + React 19 + Tailwind (apps/admin) - Hono + tRPC + Better Auth mit 2FA und Passkeys (packages/api) - PostgreSQL + Drizzle ORM (packages/db) - Docker fuer Postgres und pgAdmin. Module: - Auth mit Login, 2FA (TOTP + Backup-Codes), Passkeys und Admin-Recovery - Tagesansicht mit Essen, Trinken, Gewicht, Aktivitaeten und Coach-Hinweisen - Lebensmittelkatalog mit Naehrwerten, Portionen, OCR/Barcode/Open Food Facts - Rezepte mit Live-Naehrwertberechnung und Community-Vorschlaegen - Essensplanung und Wochenbudget mit Sportbonus - Einkaufslisten mit Maerkten und Laufweg-Sortierung - Hellfireclub mit Aktivitaetspunkten und gemeinsamer Aktivitaetsplanung - Wearables-Vorbereitung (Fitbit / Google Fit / Health Connect) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3746 lines
No EOL
92 KiB
JSON
3746 lines
No EOL
92 KiB
JSON
{
|
|
"id": "cfd59aab-426c-4514-a196-661bed8de079",
|
|
"prevId": "0fbdf221-4009-4768-a0ac-947eaf59b7ad",
|
|
"version": "7",
|
|
"dialect": "postgresql",
|
|
"tables": {
|
|
"public.account": {
|
|
"name": "account",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"accountId": {
|
|
"name": "accountId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"providerId": {
|
|
"name": "providerId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"accessToken": {
|
|
"name": "accessToken",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"refreshToken": {
|
|
"name": "refreshToken",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"idToken": {
|
|
"name": "idToken",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"accessTokenExpiresAt": {
|
|
"name": "accessTokenExpiresAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"refreshTokenExpiresAt": {
|
|
"name": "refreshTokenExpiresAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"scope": {
|
|
"name": "scope",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"password": {
|
|
"name": "password",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"account_userId_user_id_fk": {
|
|
"name": "account_userId_user_id_fk",
|
|
"tableFrom": "account",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.passkey": {
|
|
"name": "passkey",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"publicKey": {
|
|
"name": "publicKey",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"credentialID": {
|
|
"name": "credentialID",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"counter": {
|
|
"name": "counter",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"deviceType": {
|
|
"name": "deviceType",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"backedUp": {
|
|
"name": "backedUp",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"transports": {
|
|
"name": "transports",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"aaguid": {
|
|
"name": "aaguid",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"passkey_userId_user_id_fk": {
|
|
"name": "passkey_userId_user_id_fk",
|
|
"tableFrom": "passkey",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.session": {
|
|
"name": "session",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"expiresAt": {
|
|
"name": "expiresAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"token": {
|
|
"name": "token",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"ipAddress": {
|
|
"name": "ipAddress",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"userAgent": {
|
|
"name": "userAgent",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"impersonatedBy": {
|
|
"name": "impersonatedBy",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"session_userId_user_id_fk": {
|
|
"name": "session_userId_user_id_fk",
|
|
"tableFrom": "session",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"session_token_unique": {
|
|
"name": "session_token_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"token"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.twoFactor": {
|
|
"name": "twoFactor",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"secret": {
|
|
"name": "secret",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"backupCodes": {
|
|
"name": "backupCodes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"enabled": {
|
|
"name": "enabled",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"twoFactor_userId_user_id_fk": {
|
|
"name": "twoFactor_userId_user_id_fk",
|
|
"tableFrom": "twoFactor",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.user": {
|
|
"name": "user",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"role": {
|
|
"name": "role",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'user'"
|
|
},
|
|
"twoFactorEnabled": {
|
|
"name": "twoFactorEnabled",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"twoFactorRecoveryRequired": {
|
|
"name": "twoFactorRecoveryRequired",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"twoFactorRecoveryStartedAt": {
|
|
"name": "twoFactorRecoveryStartedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"twoFactorRecoveryStartedBy": {
|
|
"name": "twoFactorRecoveryStartedBy",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"banned": {
|
|
"name": "banned",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"banReason": {
|
|
"name": "banReason",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"banExpires": {
|
|
"name": "banExpires",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"emailVerified": {
|
|
"name": "emailVerified",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"image": {
|
|
"name": "image",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"theme": {
|
|
"name": "theme",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"user_email_unique": {
|
|
"name": "user_email_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"email"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.verification": {
|
|
"name": "verification",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"identifier": {
|
|
"name": "identifier",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"value": {
|
|
"name": "value",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"expiresAt": {
|
|
"name": "expiresAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.platform_settings": {
|
|
"name": "platform_settings",
|
|
"schema": "",
|
|
"columns": {
|
|
"key": {
|
|
"name": "key",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"value": {
|
|
"name": "value",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.activity_logs": {
|
|
"name": "activity_logs",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"templateId": {
|
|
"name": "templateId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"date": {
|
|
"name": "date",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"minutes": {
|
|
"name": "minutes",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"points": {
|
|
"name": "points",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"calories": {
|
|
"name": "calories",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"source": {
|
|
"name": "source",
|
|
"type": "activity_source",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'manual'"
|
|
},
|
|
"externalId": {
|
|
"name": "externalId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"note": {
|
|
"name": "note",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"activity_logs_user_date_idx": {
|
|
"name": "activity_logs_user_date_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "userId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "date",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"activity_logs_source_external_unique": {
|
|
"name": "activity_logs_source_external_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "userId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "source",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "externalId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"activity_logs_userId_user_id_fk": {
|
|
"name": "activity_logs_userId_user_id_fk",
|
|
"tableFrom": "activity_logs",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"activity_logs_templateId_activity_templates_id_fk": {
|
|
"name": "activity_logs_templateId_activity_templates_id_fk",
|
|
"tableFrom": "activity_logs",
|
|
"tableTo": "activity_templates",
|
|
"columnsFrom": [
|
|
"templateId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.activity_templates": {
|
|
"name": "activity_templates",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"ownerUserId": {
|
|
"name": "ownerUserId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"category": {
|
|
"name": "category",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'habit'"
|
|
},
|
|
"defaultMinutes": {
|
|
"name": "defaultMinutes",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 10
|
|
},
|
|
"defaultPoints": {
|
|
"name": "defaultPoints",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 10
|
|
},
|
|
"defaultCalories": {
|
|
"name": "defaultCalories",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"icon": {
|
|
"name": "icon",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'custom'"
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"activity_templates_owner_idx": {
|
|
"name": "activity_templates_owner_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "ownerUserId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"activity_templates_ownerUserId_user_id_fk": {
|
|
"name": "activity_templates_ownerUserId_user_id_fk",
|
|
"tableFrom": "activity_templates",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"ownerUserId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.club_activities": {
|
|
"name": "club_activities",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"hostUserId": {
|
|
"name": "hostUserId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"category": {
|
|
"name": "category",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'other'"
|
|
},
|
|
"startsAt": {
|
|
"name": "startsAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"durationMinutes": {
|
|
"name": "durationMinutes",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 30
|
|
},
|
|
"points": {
|
|
"name": "points",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 20
|
|
},
|
|
"note": {
|
|
"name": "note",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"club_activities_starts_at_idx": {
|
|
"name": "club_activities_starts_at_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "startsAt",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"club_activities_hostUserId_user_id_fk": {
|
|
"name": "club_activities_hostUserId_user_id_fk",
|
|
"tableFrom": "club_activities",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"hostUserId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.club_activity_participants": {
|
|
"name": "club_activity_participants",
|
|
"schema": "",
|
|
"columns": {
|
|
"activityId": {
|
|
"name": "activityId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"displayName": {
|
|
"name": "displayName",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"joinedAt": {
|
|
"name": "joinedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"completedAt": {
|
|
"name": "completedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"club_activity_participants_activityId_club_activities_id_fk": {
|
|
"name": "club_activity_participants_activityId_club_activities_id_fk",
|
|
"tableFrom": "club_activity_participants",
|
|
"tableTo": "club_activities",
|
|
"columnsFrom": [
|
|
"activityId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"club_activity_participants_userId_user_id_fk": {
|
|
"name": "club_activity_participants_userId_user_id_fk",
|
|
"tableFrom": "club_activity_participants",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"club_activity_participants_activityId_userId_pk": {
|
|
"name": "club_activity_participants_activityId_userId_pk",
|
|
"columns": [
|
|
"activityId",
|
|
"userId"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.coach_principles": {
|
|
"name": "coach_principles",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"body": {
|
|
"name": "body",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"category": {
|
|
"name": "category",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'general'"
|
|
},
|
|
"isActive": {
|
|
"name": "isActive",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"sortOrder": {
|
|
"name": "sortOrder",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.coach_recommendations": {
|
|
"name": "coach_recommendations",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"body": {
|
|
"name": "body",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"priority": {
|
|
"name": "priority",
|
|
"type": "coach_priority",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'medium'"
|
|
},
|
|
"category": {
|
|
"name": "category",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'daily'"
|
|
},
|
|
"source": {
|
|
"name": "source",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'rule'"
|
|
},
|
|
"validFrom": {
|
|
"name": "validFrom",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"validTo": {
|
|
"name": "validTo",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"dismissedAt": {
|
|
"name": "dismissedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"coach_recommendations_user_idx": {
|
|
"name": "coach_recommendations_user_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "userId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"coach_recommendations_userId_user_id_fk": {
|
|
"name": "coach_recommendations_userId_user_id_fk",
|
|
"tableFrom": "coach_recommendations",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.drink_logs": {
|
|
"name": "drink_logs",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"date": {
|
|
"name": "date",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"amountMl": {
|
|
"name": "amountMl",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"drink_logs_user_date_idx": {
|
|
"name": "drink_logs_user_date_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "userId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "date",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"drink_logs_userId_user_id_fk": {
|
|
"name": "drink_logs_userId_user_id_fk",
|
|
"tableFrom": "drink_logs",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.food_portions": {
|
|
"name": "food_portions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"foodId": {
|
|
"name": "foodId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"label": {
|
|
"name": "label",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"unit": {
|
|
"name": "unit",
|
|
"type": "portion_unit",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"amount": {
|
|
"name": "amount",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"gramsEquivalent": {
|
|
"name": "gramsEquivalent",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"food_portions_food_idx": {
|
|
"name": "food_portions_food_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "foodId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"food_portions_foodId_foods_id_fk": {
|
|
"name": "food_portions_foodId_foods_id_fk",
|
|
"tableFrom": "food_portions",
|
|
"tableTo": "foods",
|
|
"columnsFrom": [
|
|
"foodId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.food_stores": {
|
|
"name": "food_stores",
|
|
"schema": "",
|
|
"columns": {
|
|
"foodId": {
|
|
"name": "foodId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"storeId": {
|
|
"name": "storeId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"departmentId": {
|
|
"name": "departmentId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"lastPrice": {
|
|
"name": "lastPrice",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"availabilityTags": {
|
|
"name": "availabilityTags",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'[]'::jsonb"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"food_stores_store_idx": {
|
|
"name": "food_stores_store_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "storeId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"food_stores_foodId_foods_id_fk": {
|
|
"name": "food_stores_foodId_foods_id_fk",
|
|
"tableFrom": "food_stores",
|
|
"tableTo": "foods",
|
|
"columnsFrom": [
|
|
"foodId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"food_stores_storeId_stores_id_fk": {
|
|
"name": "food_stores_storeId_stores_id_fk",
|
|
"tableFrom": "food_stores",
|
|
"tableTo": "stores",
|
|
"columnsFrom": [
|
|
"storeId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"food_stores_departmentId_store_departments_id_fk": {
|
|
"name": "food_stores_departmentId_store_departments_id_fk",
|
|
"tableFrom": "food_stores",
|
|
"tableTo": "store_departments",
|
|
"columnsFrom": [
|
|
"departmentId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"food_stores_foodId_storeId_pk": {
|
|
"name": "food_stores_foodId_storeId_pk",
|
|
"columns": [
|
|
"foodId",
|
|
"storeId"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.foods": {
|
|
"name": "foods",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"ownerUserId": {
|
|
"name": "ownerUserId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"brand": {
|
|
"name": "brand",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"barcode": {
|
|
"name": "barcode",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"category": {
|
|
"name": "category",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'Sonstiges'"
|
|
},
|
|
"kcalPer100g": {
|
|
"name": "kcalPer100g",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'0'"
|
|
},
|
|
"proteinPer100g": {
|
|
"name": "proteinPer100g",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'0'"
|
|
},
|
|
"carbsPer100g": {
|
|
"name": "carbsPer100g",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'0'"
|
|
},
|
|
"fatPer100g": {
|
|
"name": "fatPer100g",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'0'"
|
|
},
|
|
"servingG": {
|
|
"name": "servingG",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'100'"
|
|
},
|
|
"preferredUnit": {
|
|
"name": "preferredUnit",
|
|
"type": "portion_unit",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'g'"
|
|
},
|
|
"densityGPerMl": {
|
|
"name": "densityGPerMl",
|
|
"type": "numeric(8, 4)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"source": {
|
|
"name": "source",
|
|
"type": "food_source",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'manual'"
|
|
},
|
|
"isVerified": {
|
|
"name": "isVerified",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"isCommunity": {
|
|
"name": "isCommunity",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"availableEverywhere": {
|
|
"name": "availableEverywhere",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"metadata": {
|
|
"name": "metadata",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::jsonb"
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"foods_owner_idx": {
|
|
"name": "foods_owner_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "ownerUserId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"foods_barcode_idx": {
|
|
"name": "foods_barcode_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "barcode",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"foods_name_idx": {
|
|
"name": "foods_name_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "name",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"foods_ownerUserId_user_id_fk": {
|
|
"name": "foods_ownerUserId_user_id_fk",
|
|
"tableFrom": "foods",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"ownerUserId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.health_goals": {
|
|
"name": "health_goals",
|
|
"schema": "",
|
|
"columns": {
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"drinkMl": {
|
|
"name": "drinkMl",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 2500
|
|
},
|
|
"calories": {
|
|
"name": "calories",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 2000
|
|
},
|
|
"carbsG": {
|
|
"name": "carbsG",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 200
|
|
},
|
|
"fatG": {
|
|
"name": "fatG",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 67
|
|
},
|
|
"proteinG": {
|
|
"name": "proteinG",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 150
|
|
},
|
|
"weightKg": {
|
|
"name": "weightKg",
|
|
"type": "numeric(6, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"fastingHours": {
|
|
"name": "fastingHours",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 12
|
|
},
|
|
"weeklyCalories": {
|
|
"name": "weeklyCalories",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"sportAddsCalories": {
|
|
"name": "sportAddsCalories",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"health_goals_userId_user_id_fk": {
|
|
"name": "health_goals_userId_user_id_fk",
|
|
"tableFrom": "health_goals",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.health_profiles": {
|
|
"name": "health_profiles",
|
|
"schema": "",
|
|
"columns": {
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"goal": {
|
|
"name": "goal",
|
|
"type": "health_goal",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'healthier'"
|
|
},
|
|
"age": {
|
|
"name": "age",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"heightCm": {
|
|
"name": "heightCm",
|
|
"type": "numeric(6, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"currentWeightKg": {
|
|
"name": "currentWeightKg",
|
|
"type": "numeric(6, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"targetWeightKg": {
|
|
"name": "targetWeightKg",
|
|
"type": "numeric(6, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"activityLevel": {
|
|
"name": "activityLevel",
|
|
"type": "activity_level",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'moderate'"
|
|
},
|
|
"dietStyle": {
|
|
"name": "dietStyle",
|
|
"type": "diet_style",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'flexible'"
|
|
},
|
|
"mealsPerDay": {
|
|
"name": "mealsPerDay",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 3
|
|
},
|
|
"cookingTime": {
|
|
"name": "cookingTime",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'medium'"
|
|
},
|
|
"budgetFocus": {
|
|
"name": "budgetFocus",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"excludedFoods": {
|
|
"name": "excludedFoods",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"biggestChallenge": {
|
|
"name": "biggestChallenge",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"medicalNote": {
|
|
"name": "medicalNote",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"completedAt": {
|
|
"name": "completedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"health_profiles_userId_user_id_fk": {
|
|
"name": "health_profiles_userId_user_id_fk",
|
|
"tableFrom": "health_profiles",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.meal_logs": {
|
|
"name": "meal_logs",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"date": {
|
|
"name": "date",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"mealType": {
|
|
"name": "mealType",
|
|
"type": "meal_type",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"foodId": {
|
|
"name": "foodId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"recipeId": {
|
|
"name": "recipeId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"amountLabel": {
|
|
"name": "amountLabel",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"amountG": {
|
|
"name": "amountG",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"calories": {
|
|
"name": "calories",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"proteinG": {
|
|
"name": "proteinG",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'0'"
|
|
},
|
|
"carbsG": {
|
|
"name": "carbsG",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'0'"
|
|
},
|
|
"fatG": {
|
|
"name": "fatG",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'0'"
|
|
},
|
|
"source": {
|
|
"name": "source",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'manual'"
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"meal_logs_user_date_idx": {
|
|
"name": "meal_logs_user_date_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "userId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "date",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"meal_logs_userId_user_id_fk": {
|
|
"name": "meal_logs_userId_user_id_fk",
|
|
"tableFrom": "meal_logs",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"meal_logs_foodId_foods_id_fk": {
|
|
"name": "meal_logs_foodId_foods_id_fk",
|
|
"tableFrom": "meal_logs",
|
|
"tableTo": "foods",
|
|
"columnsFrom": [
|
|
"foodId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"meal_logs_recipeId_recipes_id_fk": {
|
|
"name": "meal_logs_recipeId_recipes_id_fk",
|
|
"tableFrom": "meal_logs",
|
|
"tableTo": "recipes",
|
|
"columnsFrom": [
|
|
"recipeId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.meal_plans": {
|
|
"name": "meal_plans",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"date": {
|
|
"name": "date",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"mealType": {
|
|
"name": "mealType",
|
|
"type": "meal_type",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"recipeId": {
|
|
"name": "recipeId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"portions": {
|
|
"name": "portions",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'1'"
|
|
},
|
|
"note": {
|
|
"name": "note",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"meal_plans_user_date_idx": {
|
|
"name": "meal_plans_user_date_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "userId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "date",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"meal_plans_userId_user_id_fk": {
|
|
"name": "meal_plans_userId_user_id_fk",
|
|
"tableFrom": "meal_plans",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"meal_plans_recipeId_recipes_id_fk": {
|
|
"name": "meal_plans_recipeId_recipes_id_fk",
|
|
"tableFrom": "meal_plans",
|
|
"tableTo": "recipes",
|
|
"columnsFrom": [
|
|
"recipeId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.recipe_ingredients": {
|
|
"name": "recipe_ingredients",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"recipeId": {
|
|
"name": "recipeId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"foodId": {
|
|
"name": "foodId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"amountG": {
|
|
"name": "amountG",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"displayAmount": {
|
|
"name": "displayAmount",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"displayUnit": {
|
|
"name": "displayUnit",
|
|
"type": "portion_unit",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"portionId": {
|
|
"name": "portionId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"sortOrder": {
|
|
"name": "sortOrder",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
}
|
|
},
|
|
"indexes": {
|
|
"recipe_ingredients_recipe_idx": {
|
|
"name": "recipe_ingredients_recipe_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "recipeId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"recipe_ingredients_recipeId_recipes_id_fk": {
|
|
"name": "recipe_ingredients_recipeId_recipes_id_fk",
|
|
"tableFrom": "recipe_ingredients",
|
|
"tableTo": "recipes",
|
|
"columnsFrom": [
|
|
"recipeId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"recipe_ingredients_foodId_foods_id_fk": {
|
|
"name": "recipe_ingredients_foodId_foods_id_fk",
|
|
"tableFrom": "recipe_ingredients",
|
|
"tableTo": "foods",
|
|
"columnsFrom": [
|
|
"foodId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
},
|
|
"recipe_ingredients_portionId_food_portions_id_fk": {
|
|
"name": "recipe_ingredients_portionId_food_portions_id_fk",
|
|
"tableFrom": "recipe_ingredients",
|
|
"tableTo": "food_portions",
|
|
"columnsFrom": [
|
|
"portionId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.recipe_ratings": {
|
|
"name": "recipe_ratings",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"recipeId": {
|
|
"name": "recipeId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"rating": {
|
|
"name": "rating",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"comment": {
|
|
"name": "comment",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"recipe_ratings_user_recipe_unique": {
|
|
"name": "recipe_ratings_user_recipe_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "recipeId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "userId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"recipe_ratings_recipeId_recipes_id_fk": {
|
|
"name": "recipe_ratings_recipeId_recipes_id_fk",
|
|
"tableFrom": "recipe_ratings",
|
|
"tableTo": "recipes",
|
|
"columnsFrom": [
|
|
"recipeId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"recipe_ratings_userId_user_id_fk": {
|
|
"name": "recipe_ratings_userId_user_id_fk",
|
|
"tableFrom": "recipe_ratings",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.recipes": {
|
|
"name": "recipes",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"ownerUserId": {
|
|
"name": "ownerUserId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"portions": {
|
|
"name": "portions",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 1
|
|
},
|
|
"minutes": {
|
|
"name": "minutes",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"notes": {
|
|
"name": "notes",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"mealPrepDays": {
|
|
"name": "mealPrepDays",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"isPublic": {
|
|
"name": "isPublic",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"recipes_owner_idx": {
|
|
"name": "recipes_owner_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "ownerUserId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"recipes_ownerUserId_user_id_fk": {
|
|
"name": "recipes_ownerUserId_user_id_fk",
|
|
"tableFrom": "recipes",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"ownerUserId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.reminder_rules": {
|
|
"name": "reminder_rules",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"kind": {
|
|
"name": "kind",
|
|
"type": "reminder_kind",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"enabled": {
|
|
"name": "enabled",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"intervalMinutes": {
|
|
"name": "intervalMinutes",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 90
|
|
},
|
|
"startTime": {
|
|
"name": "startTime",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'08:00'"
|
|
},
|
|
"endTime": {
|
|
"name": "endTime",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'20:00'"
|
|
},
|
|
"message": {
|
|
"name": "message",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"quietDays": {
|
|
"name": "quietDays",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'[]'::jsonb"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"reminder_rules_user_kind_unique": {
|
|
"name": "reminder_rules_user_kind_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "userId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "kind",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"reminder_rules_userId_user_id_fk": {
|
|
"name": "reminder_rules_userId_user_id_fk",
|
|
"tableFrom": "reminder_rules",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.shopping_list_items": {
|
|
"name": "shopping_list_items",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"shoppingListId": {
|
|
"name": "shoppingListId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"foodId": {
|
|
"name": "foodId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"category": {
|
|
"name": "category",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'Sonstiges'"
|
|
},
|
|
"amountG": {
|
|
"name": "amountG",
|
|
"type": "numeric(8, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'0'"
|
|
},
|
|
"purchaseAmount": {
|
|
"name": "purchaseAmount",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"checked": {
|
|
"name": "checked",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"sortOrder": {
|
|
"name": "sortOrder",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
}
|
|
},
|
|
"indexes": {
|
|
"shopping_list_items_list_idx": {
|
|
"name": "shopping_list_items_list_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "shoppingListId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"shopping_list_items_shoppingListId_shopping_lists_id_fk": {
|
|
"name": "shopping_list_items_shoppingListId_shopping_lists_id_fk",
|
|
"tableFrom": "shopping_list_items",
|
|
"tableTo": "shopping_lists",
|
|
"columnsFrom": [
|
|
"shoppingListId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"shopping_list_items_foodId_foods_id_fk": {
|
|
"name": "shopping_list_items_foodId_foods_id_fk",
|
|
"tableFrom": "shopping_list_items",
|
|
"tableTo": "foods",
|
|
"columnsFrom": [
|
|
"foodId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.shopping_lists": {
|
|
"name": "shopping_lists",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"storeId": {
|
|
"name": "storeId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"startsOn": {
|
|
"name": "startsOn",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"endsOn": {
|
|
"name": "endsOn",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"shopping_lists_user_idx": {
|
|
"name": "shopping_lists_user_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "userId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"shopping_lists_userId_user_id_fk": {
|
|
"name": "shopping_lists_userId_user_id_fk",
|
|
"tableFrom": "shopping_lists",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"shopping_lists_storeId_stores_id_fk": {
|
|
"name": "shopping_lists_storeId_stores_id_fk",
|
|
"tableFrom": "shopping_lists",
|
|
"tableTo": "stores",
|
|
"columnsFrom": [
|
|
"storeId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.store_departments": {
|
|
"name": "store_departments",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"storeId": {
|
|
"name": "storeId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"sortOrder": {
|
|
"name": "sortOrder",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
}
|
|
},
|
|
"indexes": {
|
|
"store_departments_store_idx": {
|
|
"name": "store_departments_store_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "storeId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"store_departments_storeId_stores_id_fk": {
|
|
"name": "store_departments_storeId_stores_id_fk",
|
|
"tableFrom": "store_departments",
|
|
"tableTo": "stores",
|
|
"columnsFrom": [
|
|
"storeId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.stores": {
|
|
"name": "stores",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"ownerUserId": {
|
|
"name": "ownerUserId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"favorite": {
|
|
"name": "favorite",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"stores_ownerUserId_user_id_fk": {
|
|
"name": "stores_ownerUserId_user_id_fk",
|
|
"tableFrom": "stores",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"ownerUserId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.wearable_connections": {
|
|
"name": "wearable_connections",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"provider": {
|
|
"name": "provider",
|
|
"type": "wearable_provider",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"providerUserId": {
|
|
"name": "providerUserId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"accessTokenEncrypted": {
|
|
"name": "accessTokenEncrypted",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"refreshTokenEncrypted": {
|
|
"name": "refreshTokenEncrypted",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"scopes": {
|
|
"name": "scopes",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'[]'::jsonb"
|
|
},
|
|
"expiresAt": {
|
|
"name": "expiresAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"lastSyncAt": {
|
|
"name": "lastSyncAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"syncEnabled": {
|
|
"name": "syncEnabled",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"wearable_connections_user_provider_unique": {
|
|
"name": "wearable_connections_user_provider_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "userId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "provider",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"wearable_connections_userId_user_id_fk": {
|
|
"name": "wearable_connections_userId_user_id_fk",
|
|
"tableFrom": "wearable_connections",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.wearable_imports": {
|
|
"name": "wearable_imports",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"connectionId": {
|
|
"name": "connectionId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"provider": {
|
|
"name": "provider",
|
|
"type": "wearable_provider",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"externalId": {
|
|
"name": "externalId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"date": {
|
|
"name": "date",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"payload": {
|
|
"name": "payload",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::jsonb"
|
|
},
|
|
"importedAt": {
|
|
"name": "importedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"wearable_imports_provider_external_unique": {
|
|
"name": "wearable_imports_provider_external_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "provider",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "externalId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"wearable_imports_user_date_idx": {
|
|
"name": "wearable_imports_user_date_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "userId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "date",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"wearable_imports_connectionId_wearable_connections_id_fk": {
|
|
"name": "wearable_imports_connectionId_wearable_connections_id_fk",
|
|
"tableFrom": "wearable_imports",
|
|
"tableTo": "wearable_connections",
|
|
"columnsFrom": [
|
|
"connectionId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"wearable_imports_userId_user_id_fk": {
|
|
"name": "wearable_imports_userId_user_id_fk",
|
|
"tableFrom": "wearable_imports",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.weekly_calorie_plans": {
|
|
"name": "weekly_calorie_plans",
|
|
"schema": "",
|
|
"columns": {
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"date": {
|
|
"name": "date",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"plannedCalories": {
|
|
"name": "plannedCalories",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"note": {
|
|
"name": "note",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"updatedAt": {
|
|
"name": "updatedAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"weekly_calorie_plans_userId_user_id_fk": {
|
|
"name": "weekly_calorie_plans_userId_user_id_fk",
|
|
"tableFrom": "weekly_calorie_plans",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"weekly_calorie_plans_userId_date_pk": {
|
|
"name": "weekly_calorie_plans_userId_date_pk",
|
|
"columns": [
|
|
"userId",
|
|
"date"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.weight_logs": {
|
|
"name": "weight_logs",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"userId": {
|
|
"name": "userId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"date": {
|
|
"name": "date",
|
|
"type": "date",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"weightKg": {
|
|
"name": "weightKg",
|
|
"type": "numeric(6, 2)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"note": {
|
|
"name": "note",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"createdAt": {
|
|
"name": "createdAt",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"weight_logs_user_date_unique": {
|
|
"name": "weight_logs_user_date_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "userId",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "date",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"weight_logs_userId_user_id_fk": {
|
|
"name": "weight_logs_userId_user_id_fk",
|
|
"tableFrom": "weight_logs",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"userId"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
}
|
|
},
|
|
"enums": {
|
|
"public.activity_level": {
|
|
"name": "activity_level",
|
|
"schema": "public",
|
|
"values": [
|
|
"low",
|
|
"moderate",
|
|
"active"
|
|
]
|
|
},
|
|
"public.activity_source": {
|
|
"name": "activity_source",
|
|
"schema": "public",
|
|
"values": [
|
|
"manual",
|
|
"fitbit",
|
|
"health_connect",
|
|
"system"
|
|
]
|
|
},
|
|
"public.booking_status": {
|
|
"name": "booking_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"pending",
|
|
"confirmed",
|
|
"rejected"
|
|
]
|
|
},
|
|
"public.coach_priority": {
|
|
"name": "coach_priority",
|
|
"schema": "public",
|
|
"values": [
|
|
"high",
|
|
"medium",
|
|
"low"
|
|
]
|
|
},
|
|
"public.diet_style": {
|
|
"name": "diet_style",
|
|
"schema": "public",
|
|
"values": [
|
|
"mixed",
|
|
"vegetarian",
|
|
"vegan",
|
|
"low_carb",
|
|
"flexible"
|
|
]
|
|
},
|
|
"public.domain_verification_status": {
|
|
"name": "domain_verification_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"pending",
|
|
"verified",
|
|
"failed"
|
|
]
|
|
},
|
|
"public.food_source": {
|
|
"name": "food_source",
|
|
"schema": "public",
|
|
"values": [
|
|
"seed",
|
|
"manual",
|
|
"openfoodfacts",
|
|
"ocr",
|
|
"community"
|
|
]
|
|
},
|
|
"public.health_goal": {
|
|
"name": "health_goal",
|
|
"schema": "public",
|
|
"values": [
|
|
"lose_weight",
|
|
"maintain",
|
|
"build_muscle",
|
|
"healthier"
|
|
]
|
|
},
|
|
"public.meal_type": {
|
|
"name": "meal_type",
|
|
"schema": "public",
|
|
"values": [
|
|
"breakfast",
|
|
"lunch",
|
|
"dinner",
|
|
"snack"
|
|
]
|
|
},
|
|
"public.member_relation_type": {
|
|
"name": "member_relation_type",
|
|
"schema": "public",
|
|
"values": [
|
|
"partner",
|
|
"child",
|
|
"parent",
|
|
"other"
|
|
]
|
|
},
|
|
"public.member_type": {
|
|
"name": "member_type",
|
|
"schema": "public",
|
|
"values": [
|
|
"single",
|
|
"family",
|
|
"child"
|
|
]
|
|
},
|
|
"public.navigation_area": {
|
|
"name": "navigation_area",
|
|
"schema": "public",
|
|
"values": [
|
|
"main",
|
|
"footer_1",
|
|
"footer_2",
|
|
"footer_3",
|
|
"footer_4"
|
|
]
|
|
},
|
|
"public.news_lifecycle_status": {
|
|
"name": "news_lifecycle_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"draft",
|
|
"scheduled",
|
|
"published",
|
|
"archived"
|
|
]
|
|
},
|
|
"public.news_source": {
|
|
"name": "news_source",
|
|
"schema": "public",
|
|
"values": [
|
|
"native",
|
|
"imported"
|
|
]
|
|
},
|
|
"public.news_status": {
|
|
"name": "news_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"draft",
|
|
"published"
|
|
]
|
|
},
|
|
"public.newsletter_subscription_status": {
|
|
"name": "newsletter_subscription_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"pending_double_opt_in",
|
|
"subscribed",
|
|
"unsubscribed"
|
|
]
|
|
},
|
|
"public.portion_unit": {
|
|
"name": "portion_unit",
|
|
"schema": "public",
|
|
"values": [
|
|
"g",
|
|
"ml",
|
|
"tsp",
|
|
"tbsp",
|
|
"piece",
|
|
"pack",
|
|
"bottle",
|
|
"cup",
|
|
"slice"
|
|
]
|
|
},
|
|
"public.reminder_kind": {
|
|
"name": "reminder_kind",
|
|
"schema": "public",
|
|
"values": [
|
|
"water",
|
|
"snack",
|
|
"movement",
|
|
"meal",
|
|
"shopping",
|
|
"activity"
|
|
]
|
|
},
|
|
"public.role_scope": {
|
|
"name": "role_scope",
|
|
"schema": "public",
|
|
"values": [
|
|
"platform",
|
|
"tenant"
|
|
]
|
|
},
|
|
"public.tenant_domain_type": {
|
|
"name": "tenant_domain_type",
|
|
"schema": "public",
|
|
"values": [
|
|
"subdomain",
|
|
"custom"
|
|
]
|
|
},
|
|
"public.tenant_invite_status": {
|
|
"name": "tenant_invite_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"pending",
|
|
"accepted",
|
|
"revoked",
|
|
"expired"
|
|
]
|
|
},
|
|
"public.tenant_member_role": {
|
|
"name": "tenant_member_role",
|
|
"schema": "public",
|
|
"values": [
|
|
"admin",
|
|
"tenant_admin",
|
|
"editor",
|
|
"haus_admin",
|
|
"member_manager",
|
|
"member",
|
|
"verband_admin",
|
|
"landes_admin"
|
|
]
|
|
},
|
|
"public.tenant_status": {
|
|
"name": "tenant_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"active",
|
|
"disabled"
|
|
]
|
|
},
|
|
"public.tenant_user_status": {
|
|
"name": "tenant_user_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"invited",
|
|
"active",
|
|
"suspended"
|
|
]
|
|
},
|
|
"public.user_role": {
|
|
"name": "user_role",
|
|
"schema": "public",
|
|
"values": [
|
|
"admin",
|
|
"redaktion",
|
|
"gruppenleitung",
|
|
"hausverwaltung"
|
|
]
|
|
},
|
|
"public.visibility": {
|
|
"name": "visibility",
|
|
"schema": "public",
|
|
"values": [
|
|
"public",
|
|
"members"
|
|
]
|
|
},
|
|
"public.wearable_provider": {
|
|
"name": "wearable_provider",
|
|
"schema": "public",
|
|
"values": [
|
|
"fitbit",
|
|
"health_connect",
|
|
"google_fit"
|
|
]
|
|
}
|
|
},
|
|
"schemas": {},
|
|
"sequences": {},
|
|
"roles": {},
|
|
"policies": {},
|
|
"views": {},
|
|
"_meta": {
|
|
"columns": {},
|
|
"schemas": {},
|
|
"tables": {}
|
|
}
|
|
} |