6223 lines
155 KiB
JSON
6223 lines
155 KiB
JSON
|
|
{
|
||
|
|
"id": "0fbdf221-4009-4768-a0ac-947eaf59b7ad",
|
||
|
|
"prevId": "f70be0e8-2bc5-4245-b0ae-b030306e2bd7",
|
||
|
|
"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": "'tenant_member'"
|
||
|
|
},
|
||
|
|
"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.events": {
|
||
|
|
"name": "events",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"groupId": {
|
||
|
|
"name": "groupId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"responsibleUserId": {
|
||
|
|
"name": "responsibleUserId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"title": {
|
||
|
|
"name": "title",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"slug": {
|
||
|
|
"name": "slug",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"description": {
|
||
|
|
"name": "description",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"startDate": {
|
||
|
|
"name": "startDate",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"startTime": {
|
||
|
|
"name": "startTime",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"endDate": {
|
||
|
|
"name": "endDate",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"endTime": {
|
||
|
|
"name": "endTime",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"location": {
|
||
|
|
"name": "location",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"published": {
|
||
|
|
"name": "published",
|
||
|
|
"type": "boolean",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": false
|
||
|
|
},
|
||
|
|
"visibility": {
|
||
|
|
"name": "visibility",
|
||
|
|
"type": "visibility",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'public'"
|
||
|
|
},
|
||
|
|
"printYear": {
|
||
|
|
"name": "printYear",
|
||
|
|
"type": "integer",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"isPrintable": {
|
||
|
|
"name": "isPrintable",
|
||
|
|
"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": {
|
||
|
|
"events_tenantId_tenants_id_fk": {
|
||
|
|
"name": "events_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "events",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "set null",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"events_groupId_groups_id_fk": {
|
||
|
|
"name": "events_groupId_groups_id_fk",
|
||
|
|
"tableFrom": "events",
|
||
|
|
"tableTo": "groups",
|
||
|
|
"columnsFrom": [
|
||
|
|
"groupId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "set null",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"events_responsibleUserId_user_id_fk": {
|
||
|
|
"name": "events_responsibleUserId_user_id_fk",
|
||
|
|
"tableFrom": "events",
|
||
|
|
"tableTo": "user",
|
||
|
|
"columnsFrom": [
|
||
|
|
"responsibleUserId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "set null",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.groups": {
|
||
|
|
"name": "groups",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"code": {
|
||
|
|
"name": "code",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"name": {
|
||
|
|
"name": "name",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"description": {
|
||
|
|
"name": "description",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"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": {
|
||
|
|
"groups_tenantId_tenants_id_fk": {
|
||
|
|
"name": "groups_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "groups",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.houseBookings": {
|
||
|
|
"name": "houseBookings",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"houseId": {
|
||
|
|
"name": "houseId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"startDate": {
|
||
|
|
"name": "startDate",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"endDate": {
|
||
|
|
"name": "endDate",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"bookingType": {
|
||
|
|
"name": "bookingType",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'private'"
|
||
|
|
},
|
||
|
|
"title": {
|
||
|
|
"name": "title",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"description": {
|
||
|
|
"name": "description",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"internalNotes": {
|
||
|
|
"name": "internalNotes",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"status": {
|
||
|
|
"name": "status",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'confirmed'"
|
||
|
|
},
|
||
|
|
"isPublic": {
|
||
|
|
"name": "isPublic",
|
||
|
|
"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": {
|
||
|
|
"houseBookings_houseId_houses_id_fk": {
|
||
|
|
"name": "houseBookings_houseId_houses_id_fk",
|
||
|
|
"tableFrom": "houseBookings",
|
||
|
|
"tableTo": "houses",
|
||
|
|
"columnsFrom": [
|
||
|
|
"houseId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.houses": {
|
||
|
|
"name": "houses",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"name": {
|
||
|
|
"name": "name",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"description": {
|
||
|
|
"name": "description",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"ownerOrganization": {
|
||
|
|
"name": "ownerOrganization",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"lesseeTenantId": {
|
||
|
|
"name": "lesseeTenantId",
|
||
|
|
"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": {
|
||
|
|
"houses_lesseeTenantId_tenants_id_fk": {
|
||
|
|
"name": "houses_lesseeTenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "houses",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"lesseeTenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "set null",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.member_membership_periods": {
|
||
|
|
"name": "member_membership_periods",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"memberRefId": {
|
||
|
|
"name": "memberRefId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"memberSince": {
|
||
|
|
"name": "memberSince",
|
||
|
|
"type": "date",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"leftAt": {
|
||
|
|
"name": "leftAt",
|
||
|
|
"type": "date",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"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": {
|
||
|
|
"member_membership_periods_tenant_member_since_unique": {
|
||
|
|
"name": "member_membership_periods_tenant_member_since_unique",
|
||
|
|
"columns": [
|
||
|
|
{
|
||
|
|
"expression": "tenantId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"expression": "memberRefId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"expression": "memberSince",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"isUnique": true,
|
||
|
|
"concurrently": false,
|
||
|
|
"method": "btree",
|
||
|
|
"with": {}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"foreignKeys": {
|
||
|
|
"member_membership_periods_tenantId_tenants_id_fk": {
|
||
|
|
"name": "member_membership_periods_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "member_membership_periods",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.member_relations": {
|
||
|
|
"name": "member_relations",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"ownerMemberRefId": {
|
||
|
|
"name": "ownerMemberRefId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"linkedMemberRefId": {
|
||
|
|
"name": "linkedMemberRefId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"relationType": {
|
||
|
|
"name": "relationType",
|
||
|
|
"type": "member_relation_type",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'other'"
|
||
|
|
},
|
||
|
|
"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": {
|
||
|
|
"member_relations_owner_linked_unique": {
|
||
|
|
"name": "member_relations_owner_linked_unique",
|
||
|
|
"columns": [
|
||
|
|
{
|
||
|
|
"expression": "tenantId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"expression": "ownerMemberRefId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"expression": "linkedMemberRefId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"isUnique": true,
|
||
|
|
"concurrently": false,
|
||
|
|
"method": "btree",
|
||
|
|
"with": {}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"foreignKeys": {
|
||
|
|
"member_relations_tenantId_tenants_id_fk": {
|
||
|
|
"name": "member_relations_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "member_relations",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.member_user_links": {
|
||
|
|
"name": "member_user_links",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"memberId": {
|
||
|
|
"name": "memberId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"userId": {
|
||
|
|
"name": "userId",
|
||
|
|
"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()"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"indexes": {
|
||
|
|
"member_user_links_tenant_member_unique": {
|
||
|
|
"name": "member_user_links_tenant_member_unique",
|
||
|
|
"columns": [
|
||
|
|
{
|
||
|
|
"expression": "tenantId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"expression": "memberId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"isUnique": true,
|
||
|
|
"concurrently": false,
|
||
|
|
"method": "btree",
|
||
|
|
"with": {}
|
||
|
|
},
|
||
|
|
"member_user_links_tenant_user_unique": {
|
||
|
|
"name": "member_user_links_tenant_user_unique",
|
||
|
|
"columns": [
|
||
|
|
{
|
||
|
|
"expression": "tenantId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"expression": "userId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"isUnique": true,
|
||
|
|
"concurrently": false,
|
||
|
|
"method": "btree",
|
||
|
|
"with": {}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"foreignKeys": {
|
||
|
|
"member_user_links_tenantId_tenants_id_fk": {
|
||
|
|
"name": "member_user_links_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "member_user_links",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"member_user_links_memberId_members_id_fk": {
|
||
|
|
"name": "member_user_links_memberId_members_id_fk",
|
||
|
|
"tableFrom": "member_user_links",
|
||
|
|
"tableTo": "members",
|
||
|
|
"columnsFrom": [
|
||
|
|
"memberId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"member_user_links_userId_user_id_fk": {
|
||
|
|
"name": "member_user_links_userId_user_id_fk",
|
||
|
|
"tableFrom": "member_user_links",
|
||
|
|
"tableTo": "user",
|
||
|
|
"columnsFrom": [
|
||
|
|
"userId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.members": {
|
||
|
|
"name": "members",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"userId": {
|
||
|
|
"name": "userId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"firstName": {
|
||
|
|
"name": "firstName",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"lastName": {
|
||
|
|
"name": "lastName",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"email": {
|
||
|
|
"name": "email",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"phone": {
|
||
|
|
"name": "phone",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"mobile": {
|
||
|
|
"name": "mobile",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"street": {
|
||
|
|
"name": "street",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"postalCode": {
|
||
|
|
"name": "postalCode",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"city": {
|
||
|
|
"name": "city",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"memberType": {
|
||
|
|
"name": "memberType",
|
||
|
|
"type": "member_type",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'single'"
|
||
|
|
},
|
||
|
|
"birthDate": {
|
||
|
|
"name": "birthDate",
|
||
|
|
"type": "date",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"memberSince": {
|
||
|
|
"name": "memberSince",
|
||
|
|
"type": "date",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"leftAt": {
|
||
|
|
"name": "leftAt",
|
||
|
|
"type": "date",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"rejoinedAt": {
|
||
|
|
"name": "rejoinedAt",
|
||
|
|
"type": "date",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"deceasedAt": {
|
||
|
|
"name": "deceasedAt",
|
||
|
|
"type": "date",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"isNaturfreund": {
|
||
|
|
"name": "isNaturfreund",
|
||
|
|
"type": "boolean",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": true
|
||
|
|
},
|
||
|
|
"hadOldWebsiteAccess": {
|
||
|
|
"name": "hadOldWebsiteAccess",
|
||
|
|
"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": {
|
||
|
|
"members_tenantId_tenants_id_fk": {
|
||
|
|
"name": "members_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "members",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"members_userId_user_id_fk": {
|
||
|
|
"name": "members_userId_user_id_fk",
|
||
|
|
"tableFrom": "members",
|
||
|
|
"tableTo": "user",
|
||
|
|
"columnsFrom": [
|
||
|
|
"userId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "set null",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.news": {
|
||
|
|
"name": "news",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"title": {
|
||
|
|
"name": "title",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"slug": {
|
||
|
|
"name": "slug",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"teaser": {
|
||
|
|
"name": "teaser",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"content": {
|
||
|
|
"name": "content",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"coverImage": {
|
||
|
|
"name": "coverImage",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"source": {
|
||
|
|
"name": "source",
|
||
|
|
"type": "news_source",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'native'"
|
||
|
|
},
|
||
|
|
"lifecycleStatus": {
|
||
|
|
"name": "lifecycleStatus",
|
||
|
|
"type": "news_lifecycle_status",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'draft'"
|
||
|
|
},
|
||
|
|
"isPinned": {
|
||
|
|
"name": "isPinned",
|
||
|
|
"type": "boolean",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": false
|
||
|
|
},
|
||
|
|
"archivedAt": {
|
||
|
|
"name": "archivedAt",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"status": {
|
||
|
|
"name": "status",
|
||
|
|
"type": "news_status",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'draft'"
|
||
|
|
},
|
||
|
|
"visibility": {
|
||
|
|
"name": "visibility",
|
||
|
|
"type": "visibility",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'public'"
|
||
|
|
},
|
||
|
|
"publishedAt": {
|
||
|
|
"name": "publishedAt",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"authorId": {
|
||
|
|
"name": "authorId",
|
||
|
|
"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": {
|
||
|
|
"news_tenantId_tenants_id_fk": {
|
||
|
|
"name": "news_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "news",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "set null",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"news_authorId_user_id_fk": {
|
||
|
|
"name": "news_authorId_user_id_fk",
|
||
|
|
"tableFrom": "news",
|
||
|
|
"tableTo": "user",
|
||
|
|
"columnsFrom": [
|
||
|
|
"authorId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "set null",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {
|
||
|
|
"news_slug_unique": {
|
||
|
|
"name": "news_slug_unique",
|
||
|
|
"nullsNotDistinct": false,
|
||
|
|
"columns": [
|
||
|
|
"slug"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.permissions": {
|
||
|
|
"name": "permissions",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"key": {
|
||
|
|
"name": "key",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"label": {
|
||
|
|
"name": "label",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"category": {
|
||
|
|
"name": "category",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"description": {
|
||
|
|
"name": "description",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"sortOrder": {
|
||
|
|
"name": "sortOrder",
|
||
|
|
"type": "integer",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": 0
|
||
|
|
},
|
||
|
|
"isPlatformOnly": {
|
||
|
|
"name": "isPlatformOnly",
|
||
|
|
"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": {},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.role_permissions": {
|
||
|
|
"name": "role_permissions",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"roleId": {
|
||
|
|
"name": "roleId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"permissionKey": {
|
||
|
|
"name": "permissionKey",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"createdAt": {
|
||
|
|
"name": "createdAt",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "now()"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"indexes": {},
|
||
|
|
"foreignKeys": {
|
||
|
|
"role_permissions_roleId_roles_roleId_fk": {
|
||
|
|
"name": "role_permissions_roleId_roles_roleId_fk",
|
||
|
|
"tableFrom": "role_permissions",
|
||
|
|
"tableTo": "roles",
|
||
|
|
"columnsFrom": [
|
||
|
|
"roleId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"roleId"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"role_permissions_permissionKey_permissions_key_fk": {
|
||
|
|
"name": "role_permissions_permissionKey_permissions_key_fk",
|
||
|
|
"tableFrom": "role_permissions",
|
||
|
|
"tableTo": "permissions",
|
||
|
|
"columnsFrom": [
|
||
|
|
"permissionKey"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"key"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {
|
||
|
|
"role_permissions_roleId_permissionKey_pk": {
|
||
|
|
"name": "role_permissions_roleId_permissionKey_pk",
|
||
|
|
"columns": [
|
||
|
|
"roleId",
|
||
|
|
"permissionKey"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.roles": {
|
||
|
|
"name": "roles",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"roleId": {
|
||
|
|
"name": "roleId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"scope": {
|
||
|
|
"name": "scope",
|
||
|
|
"type": "role_scope",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"name": {
|
||
|
|
"name": "name",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"description": {
|
||
|
|
"name": "description",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"isEditable": {
|
||
|
|
"name": "isEditable",
|
||
|
|
"type": "boolean",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": true
|
||
|
|
},
|
||
|
|
"isSystem": {
|
||
|
|
"name": "isSystem",
|
||
|
|
"type": "boolean",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": false
|
||
|
|
},
|
||
|
|
"basedOnRoleId": {
|
||
|
|
"name": "basedOnRoleId",
|
||
|
|
"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": {
|
||
|
|
"roles_tenantId_tenants_id_fk": {
|
||
|
|
"name": "roles_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "roles",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.user_role_assignments": {
|
||
|
|
"name": "user_role_assignments",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"assignmentId": {
|
||
|
|
"name": "assignmentId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"userId": {
|
||
|
|
"name": "userId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"roleId": {
|
||
|
|
"name": "roleId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"validFrom": {
|
||
|
|
"name": "validFrom",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"validTo": {
|
||
|
|
"name": "validTo",
|
||
|
|
"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": {
|
||
|
|
"user_role_assignments_tenant_user_role_unique": {
|
||
|
|
"name": "user_role_assignments_tenant_user_role_unique",
|
||
|
|
"columns": [
|
||
|
|
{
|
||
|
|
"expression": "tenantId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"expression": "userId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"expression": "roleId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"isUnique": true,
|
||
|
|
"concurrently": false,
|
||
|
|
"method": "btree",
|
||
|
|
"with": {}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"foreignKeys": {
|
||
|
|
"user_role_assignments_tenantId_tenants_id_fk": {
|
||
|
|
"name": "user_role_assignments_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "user_role_assignments",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"user_role_assignments_userId_user_id_fk": {
|
||
|
|
"name": "user_role_assignments_userId_user_id_fk",
|
||
|
|
"tableFrom": "user_role_assignments",
|
||
|
|
"tableTo": "user",
|
||
|
|
"columnsFrom": [
|
||
|
|
"userId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"user_role_assignments_roleId_roles_roleId_fk": {
|
||
|
|
"name": "user_role_assignments_roleId_roles_roleId_fk",
|
||
|
|
"tableFrom": "user_role_assignments",
|
||
|
|
"tableTo": "roles",
|
||
|
|
"columnsFrom": [
|
||
|
|
"roleId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"roleId"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.tenant_pages": {
|
||
|
|
"name": "tenant_pages",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"title": {
|
||
|
|
"name": "title",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"slug": {
|
||
|
|
"name": "slug",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"parentPageId": {
|
||
|
|
"name": "parentPageId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"sortOrder": {
|
||
|
|
"name": "sortOrder",
|
||
|
|
"type": "integer",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": 0
|
||
|
|
},
|
||
|
|
"content": {
|
||
|
|
"name": "content",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"lifecycleStatus": {
|
||
|
|
"name": "lifecycleStatus",
|
||
|
|
"type": "news_lifecycle_status",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'draft'"
|
||
|
|
},
|
||
|
|
"status": {
|
||
|
|
"name": "status",
|
||
|
|
"type": "news_status",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'draft'"
|
||
|
|
},
|
||
|
|
"visibility": {
|
||
|
|
"name": "visibility",
|
||
|
|
"type": "visibility",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'public'"
|
||
|
|
},
|
||
|
|
"publishedAt": {
|
||
|
|
"name": "publishedAt",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"archivedAt": {
|
||
|
|
"name": "archivedAt",
|
||
|
|
"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": {
|
||
|
|
"tenant_pages_tenant_slug_unique": {
|
||
|
|
"name": "tenant_pages_tenant_slug_unique",
|
||
|
|
"columns": [
|
||
|
|
{
|
||
|
|
"expression": "tenantId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"expression": "slug",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"isUnique": true,
|
||
|
|
"concurrently": false,
|
||
|
|
"method": "btree",
|
||
|
|
"with": {}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"foreignKeys": {
|
||
|
|
"tenant_pages_tenantId_tenants_id_fk": {
|
||
|
|
"name": "tenant_pages_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "tenant_pages",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "set null",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.tenant_navigation_items": {
|
||
|
|
"name": "tenant_navigation_items",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"area": {
|
||
|
|
"name": "area",
|
||
|
|
"type": "navigation_area",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"pageId": {
|
||
|
|
"name": "pageId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"label": {
|
||
|
|
"name": "label",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"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": {
|
||
|
|
"tenant_navigation_items_tenantId_tenants_id_fk": {
|
||
|
|
"name": "tenant_navigation_items_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "tenant_navigation_items",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"tenant_navigation_items_pageId_tenant_pages_id_fk": {
|
||
|
|
"name": "tenant_navigation_items_pageId_tenant_pages_id_fk",
|
||
|
|
"tableFrom": "tenant_navigation_items",
|
||
|
|
"tableTo": "tenant_pages",
|
||
|
|
"columnsFrom": [
|
||
|
|
"pageId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.tenant_domains": {
|
||
|
|
"name": "tenant_domains",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"hostname": {
|
||
|
|
"name": "hostname",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"type": {
|
||
|
|
"name": "type",
|
||
|
|
"type": "tenant_domain_type",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"verificationStatus": {
|
||
|
|
"name": "verificationStatus",
|
||
|
|
"type": "domain_verification_status",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'pending'"
|
||
|
|
},
|
||
|
|
"verificationToken": {
|
||
|
|
"name": "verificationToken",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"verificationCheckedAt": {
|
||
|
|
"name": "verificationCheckedAt",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"verifiedAt": {
|
||
|
|
"name": "verifiedAt",
|
||
|
|
"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": {
|
||
|
|
"tenant_domains_hostname_unique": {
|
||
|
|
"name": "tenant_domains_hostname_unique",
|
||
|
|
"columns": [
|
||
|
|
{
|
||
|
|
"expression": "hostname",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"isUnique": true,
|
||
|
|
"concurrently": false,
|
||
|
|
"method": "btree",
|
||
|
|
"with": {}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"foreignKeys": {
|
||
|
|
"tenant_domains_tenantId_tenants_id_fk": {
|
||
|
|
"name": "tenant_domains_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "tenant_domains",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.tenant_newsletter_lists": {
|
||
|
|
"name": "tenant_newsletter_lists",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"key": {
|
||
|
|
"name": "key",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"name": {
|
||
|
|
"name": "name",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"description": {
|
||
|
|
"name": "description",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"isActive": {
|
||
|
|
"name": "isActive",
|
||
|
|
"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": {
|
||
|
|
"tenant_newsletter_lists_tenant_key_unique": {
|
||
|
|
"name": "tenant_newsletter_lists_tenant_key_unique",
|
||
|
|
"columns": [
|
||
|
|
{
|
||
|
|
"expression": "tenantId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"expression": "key",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"isUnique": true,
|
||
|
|
"concurrently": false,
|
||
|
|
"method": "btree",
|
||
|
|
"with": {}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"foreignKeys": {
|
||
|
|
"tenant_newsletter_lists_tenantId_tenants_id_fk": {
|
||
|
|
"name": "tenant_newsletter_lists_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "tenant_newsletter_lists",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.tenant_newsletter_subscriptions": {
|
||
|
|
"name": "tenant_newsletter_subscriptions",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"userId": {
|
||
|
|
"name": "userId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"newsletterListId": {
|
||
|
|
"name": "newsletterListId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"status": {
|
||
|
|
"name": "status",
|
||
|
|
"type": "newsletter_subscription_status",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'pending_double_opt_in'"
|
||
|
|
},
|
||
|
|
"doubleOptInRequestedAt": {
|
||
|
|
"name": "doubleOptInRequestedAt",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"doubleOptInConfirmedAt": {
|
||
|
|
"name": "doubleOptInConfirmedAt",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"unsubscribedAt": {
|
||
|
|
"name": "unsubscribedAt",
|
||
|
|
"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": {
|
||
|
|
"tenant_newsletter_subscriptions_tenant_user_list_unique": {
|
||
|
|
"name": "tenant_newsletter_subscriptions_tenant_user_list_unique",
|
||
|
|
"columns": [
|
||
|
|
{
|
||
|
|
"expression": "tenantId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"expression": "userId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"expression": "newsletterListId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"isUnique": true,
|
||
|
|
"concurrently": false,
|
||
|
|
"method": "btree",
|
||
|
|
"with": {}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"foreignKeys": {
|
||
|
|
"tenant_newsletter_subscriptions_tenantId_tenants_id_fk": {
|
||
|
|
"name": "tenant_newsletter_subscriptions_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "tenant_newsletter_subscriptions",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"tenant_newsletter_subscriptions_userId_user_id_fk": {
|
||
|
|
"name": "tenant_newsletter_subscriptions_userId_user_id_fk",
|
||
|
|
"tableFrom": "tenant_newsletter_subscriptions",
|
||
|
|
"tableTo": "user",
|
||
|
|
"columnsFrom": [
|
||
|
|
"userId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"tenant_newsletter_subscriptions_newsletterListId_tenant_newsletter_lists_id_fk": {
|
||
|
|
"name": "tenant_newsletter_subscriptions_newsletterListId_tenant_newsletter_lists_id_fk",
|
||
|
|
"tableFrom": "tenant_newsletter_subscriptions",
|
||
|
|
"tableTo": "tenant_newsletter_lists",
|
||
|
|
"columnsFrom": [
|
||
|
|
"newsletterListId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.tenant_invitations": {
|
||
|
|
"name": "tenant_invitations",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"email": {
|
||
|
|
"name": "email",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"emailNormalized": {
|
||
|
|
"name": "emailNormalized",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"role": {
|
||
|
|
"name": "role",
|
||
|
|
"type": "tenant_member_role",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'member'"
|
||
|
|
},
|
||
|
|
"status": {
|
||
|
|
"name": "status",
|
||
|
|
"type": "tenant_invite_status",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'pending'"
|
||
|
|
},
|
||
|
|
"tokenHash": {
|
||
|
|
"name": "tokenHash",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"invitedByUserId": {
|
||
|
|
"name": "invitedByUserId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"acceptedByUserId": {
|
||
|
|
"name": "acceptedByUserId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"expiresAt": {
|
||
|
|
"name": "expiresAt",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"acceptedAt": {
|
||
|
|
"name": "acceptedAt",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"revokedAt": {
|
||
|
|
"name": "revokedAt",
|
||
|
|
"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": {
|
||
|
|
"tenant_invitations_token_hash_unique": {
|
||
|
|
"name": "tenant_invitations_token_hash_unique",
|
||
|
|
"columns": [
|
||
|
|
{
|
||
|
|
"expression": "tokenHash",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"isUnique": true,
|
||
|
|
"concurrently": false,
|
||
|
|
"method": "btree",
|
||
|
|
"with": {}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"foreignKeys": {
|
||
|
|
"tenant_invitations_tenantId_tenants_id_fk": {
|
||
|
|
"name": "tenant_invitations_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "tenant_invitations",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"tenant_invitations_invitedByUserId_user_id_fk": {
|
||
|
|
"name": "tenant_invitations_invitedByUserId_user_id_fk",
|
||
|
|
"tableFrom": "tenant_invitations",
|
||
|
|
"tableTo": "user",
|
||
|
|
"columnsFrom": [
|
||
|
|
"invitedByUserId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"tenant_invitations_acceptedByUserId_user_id_fk": {
|
||
|
|
"name": "tenant_invitations_acceptedByUserId_user_id_fk",
|
||
|
|
"tableFrom": "tenant_invitations",
|
||
|
|
"tableTo": "user",
|
||
|
|
"columnsFrom": [
|
||
|
|
"acceptedByUserId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "set null",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.tenant_members": {
|
||
|
|
"name": "tenant_members",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"userId": {
|
||
|
|
"name": "userId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"role": {
|
||
|
|
"name": "role",
|
||
|
|
"type": "tenant_member_role",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'member'"
|
||
|
|
},
|
||
|
|
"createdAt": {
|
||
|
|
"name": "createdAt",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "now()"
|
||
|
|
},
|
||
|
|
"updatedAt": {
|
||
|
|
"name": "updatedAt",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "now()"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"indexes": {},
|
||
|
|
"foreignKeys": {
|
||
|
|
"tenant_members_tenantId_tenants_id_fk": {
|
||
|
|
"name": "tenant_members_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "tenant_members",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"tenant_members_userId_user_id_fk": {
|
||
|
|
"name": "tenant_members_userId_user_id_fk",
|
||
|
|
"tableFrom": "tenant_members",
|
||
|
|
"tableTo": "user",
|
||
|
|
"columnsFrom": [
|
||
|
|
"userId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {
|
||
|
|
"tenant_members_tenantId_userId_pk": {
|
||
|
|
"name": "tenant_members_tenantId_userId_pk",
|
||
|
|
"columns": [
|
||
|
|
"tenantId",
|
||
|
|
"userId"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.tenant_users": {
|
||
|
|
"name": "tenant_users",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"tenantId": {
|
||
|
|
"name": "tenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"userId": {
|
||
|
|
"name": "userId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"status": {
|
||
|
|
"name": "status",
|
||
|
|
"type": "tenant_user_status",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'invited'"
|
||
|
|
},
|
||
|
|
"invitedAt": {
|
||
|
|
"name": "invitedAt",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "now()"
|
||
|
|
},
|
||
|
|
"activatedAt": {
|
||
|
|
"name": "activatedAt",
|
||
|
|
"type": "timestamp",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"suspendedAt": {
|
||
|
|
"name": "suspendedAt",
|
||
|
|
"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": {
|
||
|
|
"tenant_users_tenant_user_unique": {
|
||
|
|
"name": "tenant_users_tenant_user_unique",
|
||
|
|
"columns": [
|
||
|
|
{
|
||
|
|
"expression": "tenantId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"expression": "userId",
|
||
|
|
"isExpression": false,
|
||
|
|
"asc": true,
|
||
|
|
"nulls": "last"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"isUnique": true,
|
||
|
|
"concurrently": false,
|
||
|
|
"method": "btree",
|
||
|
|
"with": {}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"foreignKeys": {
|
||
|
|
"tenant_users_tenantId_tenants_id_fk": {
|
||
|
|
"name": "tenant_users_tenantId_tenants_id_fk",
|
||
|
|
"tableFrom": "tenant_users",
|
||
|
|
"tableTo": "tenants",
|
||
|
|
"columnsFrom": [
|
||
|
|
"tenantId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
},
|
||
|
|
"tenant_users_userId_user_id_fk": {
|
||
|
|
"name": "tenant_users_userId_user_id_fk",
|
||
|
|
"tableFrom": "tenant_users",
|
||
|
|
"tableTo": "user",
|
||
|
|
"columnsFrom": [
|
||
|
|
"userId"
|
||
|
|
],
|
||
|
|
"columnsTo": [
|
||
|
|
"id"
|
||
|
|
],
|
||
|
|
"onDelete": "cascade",
|
||
|
|
"onUpdate": "no action"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"compositePrimaryKeys": {},
|
||
|
|
"uniqueConstraints": {},
|
||
|
|
"policies": {},
|
||
|
|
"checkConstraints": {},
|
||
|
|
"isRLSEnabled": false
|
||
|
|
},
|
||
|
|
"public.tenants": {
|
||
|
|
"name": "tenants",
|
||
|
|
"schema": "",
|
||
|
|
"columns": {
|
||
|
|
"id": {
|
||
|
|
"name": "id",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": true,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"parentTenantId": {
|
||
|
|
"name": "parentTenantId",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"slug": {
|
||
|
|
"name": "slug",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"name": {
|
||
|
|
"name": "name",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true
|
||
|
|
},
|
||
|
|
"description": {
|
||
|
|
"name": "description",
|
||
|
|
"type": "text",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": false
|
||
|
|
},
|
||
|
|
"status": {
|
||
|
|
"name": "status",
|
||
|
|
"type": "tenant_status",
|
||
|
|
"typeSchema": "public",
|
||
|
|
"primaryKey": false,
|
||
|
|
"notNull": true,
|
||
|
|
"default": "'active'"
|
||
|
|
},
|
||
|
|
"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": {
|
||
|
|
"tenants_slug_unique": {
|
||
|
|
"name": "tenants_slug_unique",
|
||
|
|
"nullsNotDistinct": false,
|
||
|
|
"columns": [
|
||
|
|
"slug"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"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": {}
|
||
|
|
}
|
||
|
|
}
|