Files
FEDEO/backend/db/migrations/meta/0001_snapshot.json
2026-01-06 12:07:43 +01:00

9947 lines
261 KiB
JSON

{
"id": "91737e8e-9323-4b3f-9c03-13793e3b160c",
"prevId": "c74cefc4-5ae7-408c-b7f3-09093efb52b5",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.accounts": {
"name": "accounts",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "accounts_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"number": {
"name": "number",
"type": "text",
"primaryKey": false,
"notNull": true
},
"label": {
"name": "label",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.auth_profiles": {
"name": "auth_profiles",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"first_name": {
"name": "first_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"last_name": {
"name": "last_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"full_name": {
"name": "full_name",
"type": "text",
"primaryKey": false,
"notNull": false,
"generated": {
"as": "((first_name || ' ') || last_name)",
"type": "stored"
}
},
"mobile_tel": {
"name": "mobile_tel",
"type": "text",
"primaryKey": false,
"notNull": false
},
"fixed_tel": {
"name": "fixed_tel",
"type": "text",
"primaryKey": false,
"notNull": false
},
"salutation": {
"name": "salutation",
"type": "text",
"primaryKey": false,
"notNull": false
},
"employee_number": {
"name": "employee_number",
"type": "text",
"primaryKey": false,
"notNull": false
},
"weekly_working_hours": {
"name": "weekly_working_hours",
"type": "double precision",
"primaryKey": false,
"notNull": false,
"default": 0
},
"annual_paid_leave_days": {
"name": "annual_paid_leave_days",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"weekly_regular_working_hours": {
"name": "weekly_regular_working_hours",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'{}'"
},
"clothing_size_top": {
"name": "clothing_size_top",
"type": "text",
"primaryKey": false,
"notNull": false
},
"clothing_size_bottom": {
"name": "clothing_size_bottom",
"type": "text",
"primaryKey": false,
"notNull": false
},
"clothing_size_shoe": {
"name": "clothing_size_shoe",
"type": "text",
"primaryKey": false,
"notNull": false
},
"email_signature": {
"name": "email_signature",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'<p>Mit freundlichen Grüßen</p>'"
},
"birthday": {
"name": "birthday",
"type": "date",
"primaryKey": false,
"notNull": false
},
"entry_date": {
"name": "entry_date",
"type": "date",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"automatic_hour_corrections": {
"name": "automatic_hour_corrections",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'[]'"
},
"recreation_days_compensation": {
"name": "recreation_days_compensation",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"customer_for_portal": {
"name": "customer_for_portal",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"pinned_on_navigation": {
"name": "pinned_on_navigation",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'"
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": false
},
"token_id": {
"name": "token_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"weekly_working_days": {
"name": "weekly_working_days",
"type": "double precision",
"primaryKey": false,
"notNull": false
},
"old_profile_id": {
"name": "old_profile_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"temp_config": {
"name": "temp_config",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"state_code": {
"name": "state_code",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'DE-NI'"
},
"contract_type": {
"name": "contract_type",
"type": "text",
"primaryKey": false,
"notNull": false
},
"position": {
"name": "position",
"type": "text",
"primaryKey": false,
"notNull": false
},
"qualification": {
"name": "qualification",
"type": "text",
"primaryKey": false,
"notNull": false
},
"address_street": {
"name": "address_street",
"type": "text",
"primaryKey": false,
"notNull": false
},
"address_zip": {
"name": "address_zip",
"type": "text",
"primaryKey": false,
"notNull": false
},
"address_city": {
"name": "address_city",
"type": "text",
"primaryKey": false,
"notNull": false
},
"active": {
"name": "active",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
}
},
"indexes": {},
"foreignKeys": {
"auth_profiles_user_id_auth_users_id_fk": {
"name": "auth_profiles_user_id_auth_users_id_fk",
"tableFrom": "auth_profiles",
"tableTo": "auth_users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.auth_role_permissions": {
"name": "auth_role_permissions",
"schema": "",
"columns": {
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"role_id": {
"name": "role_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"permission": {
"name": "permission",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"auth_role_permissions_role_id_auth_roles_id_fk": {
"name": "auth_role_permissions_role_id_auth_roles_id_fk",
"tableFrom": "auth_role_permissions",
"tableTo": "auth_roles",
"columnsFrom": [
"role_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.auth_roles": {
"name": "auth_roles",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_by": {
"name": "created_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"auth_roles_created_by_auth_users_id_fk": {
"name": "auth_roles_created_by_auth_users_id_fk",
"tableFrom": "auth_roles",
"tableTo": "auth_users",
"columnsFrom": [
"created_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.auth_tenant_users": {
"name": "auth_tenant_users",
"schema": "",
"columns": {
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"created_by": {
"name": "created_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"auth_tenant_users_created_by_auth_users_id_fk": {
"name": "auth_tenant_users_created_by_auth_users_id_fk",
"tableFrom": "auth_tenant_users",
"tableTo": "auth_users",
"columnsFrom": [
"created_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.auth_user_roles": {
"name": "auth_user_roles",
"schema": "",
"columns": {
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"role_id": {
"name": "role_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"created_by": {
"name": "created_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"auth_user_roles_user_id_auth_users_id_fk": {
"name": "auth_user_roles_user_id_auth_users_id_fk",
"tableFrom": "auth_user_roles",
"tableTo": "auth_users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"auth_user_roles_role_id_auth_roles_id_fk": {
"name": "auth_user_roles_role_id_auth_roles_id_fk",
"tableFrom": "auth_user_roles",
"tableTo": "auth_roles",
"columnsFrom": [
"role_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"auth_user_roles_created_by_auth_users_id_fk": {
"name": "auth_user_roles_created_by_auth_users_id_fk",
"tableFrom": "auth_user_roles",
"tableTo": "auth_users",
"columnsFrom": [
"created_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.auth_users": {
"name": "auth_users",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"password_hash": {
"name": "password_hash",
"type": "text",
"primaryKey": false,
"notNull": true
},
"multi_tenant": {
"name": "multi_tenant",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"must_change_password": {
"name": "must_change_password",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"ported": {
"name": "ported",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.bankaccounts": {
"name": "bankaccounts",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "bankaccounts_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"iban": {
"name": "iban",
"type": "text",
"primaryKey": false,
"notNull": true
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"bankId": {
"name": "bankId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"ownerName": {
"name": "ownerName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"accountId": {
"name": "accountId",
"type": "text",
"primaryKey": false,
"notNull": true
},
"balance": {
"name": "balance",
"type": "double precision",
"primaryKey": false,
"notNull": false
},
"expired": {
"name": "expired",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"datevNumber": {
"name": "datevNumber",
"type": "text",
"primaryKey": false,
"notNull": false
},
"synced_at": {
"name": "synced_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
}
},
"indexes": {},
"foreignKeys": {
"bankaccounts_tenant_tenants_id_fk": {
"name": "bankaccounts_tenant_tenants_id_fk",
"tableFrom": "bankaccounts",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"bankaccounts_updated_by_auth_users_id_fk": {
"name": "bankaccounts_updated_by_auth_users_id_fk",
"tableFrom": "bankaccounts",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.bankrequisitions": {
"name": "bankrequisitions",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"institutionId": {
"name": "institutionId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"bankrequisitions_tenant_tenants_id_fk": {
"name": "bankrequisitions_tenant_tenants_id_fk",
"tableFrom": "bankrequisitions",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"bankrequisitions_updated_by_auth_users_id_fk": {
"name": "bankrequisitions_updated_by_auth_users_id_fk",
"tableFrom": "bankrequisitions",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.bankstatements": {
"name": "bankstatements",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "bankstatements_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"account": {
"name": "account",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"date": {
"name": "date",
"type": "text",
"primaryKey": false,
"notNull": true
},
"credIban": {
"name": "credIban",
"type": "text",
"primaryKey": false,
"notNull": false
},
"credName": {
"name": "credName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"text": {
"name": "text",
"type": "text",
"primaryKey": false,
"notNull": false
},
"amount": {
"name": "amount",
"type": "double precision",
"primaryKey": false,
"notNull": true
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"debIban": {
"name": "debIban",
"type": "text",
"primaryKey": false,
"notNull": false
},
"debName": {
"name": "debName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"gocardlessId": {
"name": "gocardlessId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"currency": {
"name": "currency",
"type": "text",
"primaryKey": false,
"notNull": false
},
"valueDate": {
"name": "valueDate",
"type": "text",
"primaryKey": false,
"notNull": false
},
"mandateId": {
"name": "mandateId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"contract": {
"name": "contract",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"bankstatements_account_bankaccounts_id_fk": {
"name": "bankstatements_account_bankaccounts_id_fk",
"tableFrom": "bankstatements",
"tableTo": "bankaccounts",
"columnsFrom": [
"account"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"bankstatements_tenant_tenants_id_fk": {
"name": "bankstatements_tenant_tenants_id_fk",
"tableFrom": "bankstatements",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"bankstatements_contract_contracts_id_fk": {
"name": "bankstatements_contract_contracts_id_fk",
"tableFrom": "bankstatements",
"tableTo": "contracts",
"columnsFrom": [
"contract"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"bankstatements_updated_by_auth_users_id_fk": {
"name": "bankstatements_updated_by_auth_users_id_fk",
"tableFrom": "bankstatements",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.checkexecutions": {
"name": "checkexecutions",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"check": {
"name": "check",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"executed_at": {
"name": "executed_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"checkexecutions_check_checks_id_fk": {
"name": "checkexecutions_check_checks_id_fk",
"tableFrom": "checkexecutions",
"tableTo": "checks",
"columnsFrom": [
"check"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.checks": {
"name": "checks",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"vehicle": {
"name": "vehicle",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"inventoryitem": {
"name": "inventoryitem",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": false
},
"distance": {
"name": "distance",
"type": "bigint",
"primaryKey": false,
"notNull": false,
"default": 1
},
"distanceUnit": {
"name": "distanceUnit",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'days'"
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"profiles": {
"name": "profiles",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"checks_vehicle_vehicles_id_fk": {
"name": "checks_vehicle_vehicles_id_fk",
"tableFrom": "checks",
"tableTo": "vehicles",
"columnsFrom": [
"vehicle"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"checks_inventoryitem_inventoryitems_id_fk": {
"name": "checks_inventoryitem_inventoryitems_id_fk",
"tableFrom": "checks",
"tableTo": "inventoryitems",
"columnsFrom": [
"inventoryitem"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"checks_tenant_tenants_id_fk": {
"name": "checks_tenant_tenants_id_fk",
"tableFrom": "checks",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"checks_updated_by_auth_users_id_fk": {
"name": "checks_updated_by_auth_users_id_fk",
"tableFrom": "checks",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.citys": {
"name": "citys",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "citys_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"short": {
"name": "short",
"type": "text",
"primaryKey": false,
"notNull": false
},
"long": {
"name": "long",
"type": "text",
"primaryKey": false,
"notNull": false
},
"geometry": {
"name": "geometry",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"zip": {
"name": "zip",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"districtCode": {
"name": "districtCode",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"countryName": {
"name": "countryName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"countryCode": {
"name": "countryCode",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"districtName": {
"name": "districtName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"geopoint": {
"name": "geopoint",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.contacts": {
"name": "contacts",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "contacts_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"firstName": {
"name": "firstName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"lastName": {
"name": "lastName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customer": {
"name": "customer",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"phoneMobile": {
"name": "phoneMobile",
"type": "text",
"primaryKey": false,
"notNull": false
},
"phoneHome": {
"name": "phoneHome",
"type": "text",
"primaryKey": false,
"notNull": false
},
"heroId": {
"name": "heroId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": false
},
"fullName": {
"name": "fullName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"salutation": {
"name": "salutation",
"type": "text",
"primaryKey": false,
"notNull": false
},
"vendor": {
"name": "vendor",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"active": {
"name": "active",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"birthday": {
"name": "birthday",
"type": "date",
"primaryKey": false,
"notNull": false
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"profiles": {
"name": "profiles",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"contacts_customer_customers_id_fk": {
"name": "contacts_customer_customers_id_fk",
"tableFrom": "contacts",
"tableTo": "customers",
"columnsFrom": [
"customer"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"contacts_updated_by_auth_users_id_fk": {
"name": "contacts_updated_by_auth_users_id_fk",
"tableFrom": "contacts",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.contracts": {
"name": "contracts",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "contracts_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"customer": {
"name": "customer",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"active": {
"name": "active",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"recurring": {
"name": "recurring",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"rhythm": {
"name": "rhythm",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"startDate": {
"name": "startDate",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"endDate": {
"name": "endDate",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"signDate": {
"name": "signDate",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"duration": {
"name": "duration",
"type": "text",
"primaryKey": false,
"notNull": false
},
"contact": {
"name": "contact",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"bankingIban": {
"name": "bankingIban",
"type": "text",
"primaryKey": false,
"notNull": false
},
"bankingBIC": {
"name": "bankingBIC",
"type": "text",
"primaryKey": false,
"notNull": false
},
"bankingName": {
"name": "bankingName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"bankingOwner": {
"name": "bankingOwner",
"type": "text",
"primaryKey": false,
"notNull": false
},
"sepaRef": {
"name": "sepaRef",
"type": "text",
"primaryKey": false,
"notNull": false
},
"sepaDate": {
"name": "sepaDate",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"paymentType": {
"name": "paymentType",
"type": "text",
"primaryKey": false,
"notNull": false
},
"invoiceDispatch": {
"name": "invoiceDispatch",
"type": "text",
"primaryKey": false,
"notNull": false
},
"ownFields": {
"name": "ownFields",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"profiles": {
"name": "profiles",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"contractNumber": {
"name": "contractNumber",
"type": "text",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"contracts_customer_customers_id_fk": {
"name": "contracts_customer_customers_id_fk",
"tableFrom": "contracts",
"tableTo": "customers",
"columnsFrom": [
"customer"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"contracts_contact_contacts_id_fk": {
"name": "contracts_contact_contacts_id_fk",
"tableFrom": "contracts",
"tableTo": "contacts",
"columnsFrom": [
"contact"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"contracts_updated_by_auth_users_id_fk": {
"name": "contracts_updated_by_auth_users_id_fk",
"tableFrom": "contracts",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.costcentres": {
"name": "costcentres",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"number": {
"name": "number",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"vehicle": {
"name": "vehicle",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"project": {
"name": "project",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"inventoryitem": {
"name": "inventoryitem",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"profiles": {
"name": "profiles",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"costcentres_tenant_tenants_id_fk": {
"name": "costcentres_tenant_tenants_id_fk",
"tableFrom": "costcentres",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"costcentres_vehicle_vehicles_id_fk": {
"name": "costcentres_vehicle_vehicles_id_fk",
"tableFrom": "costcentres",
"tableTo": "vehicles",
"columnsFrom": [
"vehicle"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"costcentres_project_projects_id_fk": {
"name": "costcentres_project_projects_id_fk",
"tableFrom": "costcentres",
"tableTo": "projects",
"columnsFrom": [
"project"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"costcentres_inventoryitem_inventoryitems_id_fk": {
"name": "costcentres_inventoryitem_inventoryitems_id_fk",
"tableFrom": "costcentres",
"tableTo": "inventoryitems",
"columnsFrom": [
"inventoryitem"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"costcentres_updated_by_auth_users_id_fk": {
"name": "costcentres_updated_by_auth_users_id_fk",
"tableFrom": "costcentres",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.countrys": {
"name": "countrys",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "countrys_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.createddocuments": {
"name": "createddocuments",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "createddocuments_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'INVOICE'"
},
"customer": {
"name": "customer",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"contact": {
"name": "contact",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"address": {
"name": "address",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"project": {
"name": "project",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"documentNumber": {
"name": "documentNumber",
"type": "text",
"primaryKey": false,
"notNull": false
},
"documentDate": {
"name": "documentDate",
"type": "text",
"primaryKey": false,
"notNull": false
},
"state": {
"name": "state",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'Entwurf'"
},
"info": {
"name": "info",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"createdBy": {
"name": "createdBy",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"startText": {
"name": "startText",
"type": "text",
"primaryKey": false,
"notNull": false
},
"endText": {
"name": "endText",
"type": "text",
"primaryKey": false,
"notNull": false
},
"rows": {
"name": "rows",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'[]'::jsonb"
},
"deliveryDateType": {
"name": "deliveryDateType",
"type": "text",
"primaryKey": false,
"notNull": false
},
"paymentDays": {
"name": "paymentDays",
"type": "smallint",
"primaryKey": false,
"notNull": false
},
"deliveryDate": {
"name": "deliveryDate",
"type": "text",
"primaryKey": false,
"notNull": false
},
"contactPerson": {
"name": "contactPerson",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"serialConfig": {
"name": "serialConfig",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'{}'::jsonb"
},
"linkedDocument": {
"name": "linkedDocument",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"agriculture": {
"name": "agriculture",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"letterhead": {
"name": "letterhead",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"advanceInvoiceResolved": {
"name": "advanceInvoiceResolved",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"usedAdvanceInvoices": {
"name": "usedAdvanceInvoices",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"deliveryDateEnd": {
"name": "deliveryDateEnd",
"type": "text",
"primaryKey": false,
"notNull": false
},
"plant": {
"name": "plant",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"taxType": {
"name": "taxType",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customSurchargePercentage": {
"name": "customSurchargePercentage",
"type": "smallint",
"primaryKey": false,
"notNull": true,
"default": 0
},
"report": {
"name": "report",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"availableInPortal": {
"name": "availableInPortal",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"created_by": {
"name": "created_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"payment_type": {
"name": "payment_type",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'transfer'"
},
"contract": {
"name": "contract",
"type": "bigint",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"createddocuments_tenant_tenants_id_fk": {
"name": "createddocuments_tenant_tenants_id_fk",
"tableFrom": "createddocuments",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"createddocuments_customer_customers_id_fk": {
"name": "createddocuments_customer_customers_id_fk",
"tableFrom": "createddocuments",
"tableTo": "customers",
"columnsFrom": [
"customer"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"createddocuments_contact_contacts_id_fk": {
"name": "createddocuments_contact_contacts_id_fk",
"tableFrom": "createddocuments",
"tableTo": "contacts",
"columnsFrom": [
"contact"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"createddocuments_project_projects_id_fk": {
"name": "createddocuments_project_projects_id_fk",
"tableFrom": "createddocuments",
"tableTo": "projects",
"columnsFrom": [
"project"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"createddocuments_createdBy_auth_users_id_fk": {
"name": "createddocuments_createdBy_auth_users_id_fk",
"tableFrom": "createddocuments",
"tableTo": "auth_users",
"columnsFrom": [
"createdBy"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"createddocuments_linkedDocument_createddocuments_id_fk": {
"name": "createddocuments_linkedDocument_createddocuments_id_fk",
"tableFrom": "createddocuments",
"tableTo": "createddocuments",
"columnsFrom": [
"linkedDocument"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"createddocuments_letterhead_letterheads_id_fk": {
"name": "createddocuments_letterhead_letterheads_id_fk",
"tableFrom": "createddocuments",
"tableTo": "letterheads",
"columnsFrom": [
"letterhead"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"createddocuments_plant_plants_id_fk": {
"name": "createddocuments_plant_plants_id_fk",
"tableFrom": "createddocuments",
"tableTo": "plants",
"columnsFrom": [
"plant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"createddocuments_updated_by_auth_users_id_fk": {
"name": "createddocuments_updated_by_auth_users_id_fk",
"tableFrom": "createddocuments",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"createddocuments_created_by_auth_users_id_fk": {
"name": "createddocuments_created_by_auth_users_id_fk",
"tableFrom": "createddocuments",
"tableTo": "auth_users",
"columnsFrom": [
"created_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"createddocuments_contract_contracts_id_fk": {
"name": "createddocuments_contract_contracts_id_fk",
"tableFrom": "createddocuments",
"tableTo": "contracts",
"columnsFrom": [
"contract"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.createdletters": {
"name": "createdletters",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"customer": {
"name": "customer",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"vendor": {
"name": "vendor",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"content_json": {
"name": "content_json",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'[]'::jsonb"
},
"content_text": {
"name": "content_text",
"type": "text",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
}
},
"indexes": {},
"foreignKeys": {
"createdletters_tenant_tenants_id_fk": {
"name": "createdletters_tenant_tenants_id_fk",
"tableFrom": "createdletters",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"createdletters_customer_customers_id_fk": {
"name": "createdletters_customer_customers_id_fk",
"tableFrom": "createdletters",
"tableTo": "customers",
"columnsFrom": [
"customer"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"createdletters_vendor_vendors_id_fk": {
"name": "createdletters_vendor_vendors_id_fk",
"tableFrom": "createdletters",
"tableTo": "vendors",
"columnsFrom": [
"vendor"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"createdletters_updated_by_auth_users_id_fk": {
"name": "createdletters_updated_by_auth_users_id_fk",
"tableFrom": "createdletters",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.customers": {
"name": "customers",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "customers_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"customerNumber": {
"name": "customerNumber",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"infoData": {
"name": "infoData",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'{}'::jsonb"
},
"active": {
"name": "active",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'Privat'"
},
"heroId": {
"name": "heroId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"isCompany": {
"name": "isCompany",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"profiles": {
"name": "profiles",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"customPaymentDays": {
"name": "customPaymentDays",
"type": "smallint",
"primaryKey": false,
"notNull": false
},
"firstname": {
"name": "firstname",
"type": "text",
"primaryKey": false,
"notNull": false
},
"lastname": {
"name": "lastname",
"type": "text",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"customSurchargePercentage": {
"name": "customSurchargePercentage",
"type": "smallint",
"primaryKey": false,
"notNull": true,
"default": 0
},
"salutation": {
"name": "salutation",
"type": "text",
"primaryKey": false,
"notNull": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": false
},
"nameAddition": {
"name": "nameAddition",
"type": "text",
"primaryKey": false,
"notNull": false
},
"availableInPortal": {
"name": "availableInPortal",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"custom_payment_type": {
"name": "custom_payment_type",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"customers_updated_by_auth_users_id_fk": {
"name": "customers_updated_by_auth_users_id_fk",
"tableFrom": "customers",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.devices": {
"name": "devices",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"password": {
"name": "password",
"type": "text",
"primaryKey": false,
"notNull": false
},
"externalId": {
"name": "externalId",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"devices_tenant_tenants_id_fk": {
"name": "devices_tenant_tenants_id_fk",
"tableFrom": "devices",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.documentboxes": {
"name": "documentboxes",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"space": {
"name": "space",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"key": {
"name": "key",
"type": "text",
"primaryKey": false,
"notNull": true
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"documentboxes_space_spaces_id_fk": {
"name": "documentboxes_space_spaces_id_fk",
"tableFrom": "documentboxes",
"tableTo": "spaces",
"columnsFrom": [
"space"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"documentboxes_tenant_tenants_id_fk": {
"name": "documentboxes_tenant_tenants_id_fk",
"tableFrom": "documentboxes",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"documentboxes_updated_by_auth_users_id_fk": {
"name": "documentboxes_updated_by_auth_users_id_fk",
"tableFrom": "documentboxes",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.events": {
"name": "events",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "events_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"startDate": {
"name": "startDate",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"endDate": {
"name": "endDate",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"eventtype": {
"name": "eventtype",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'Umsetzung'"
},
"project": {
"name": "project",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"resources": {
"name": "resources",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'[]'::jsonb"
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"link": {
"name": "link",
"type": "text",
"primaryKey": false,
"notNull": false
},
"profiles": {
"name": "profiles",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"vehicles": {
"name": "vehicles",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"inventoryitems": {
"name": "inventoryitems",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"inventoryitemgroups": {
"name": "inventoryitemgroups",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"customer": {
"name": "customer",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"vendor": {
"name": "vendor",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"events_customer_customers_id_fk": {
"name": "events_customer_customers_id_fk",
"tableFrom": "events",
"tableTo": "customers",
"columnsFrom": [
"customer"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"events_updated_by_auth_users_id_fk": {
"name": "events_updated_by_auth_users_id_fk",
"tableFrom": "events",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.files": {
"name": "files",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"path": {
"name": "path",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"project": {
"name": "project",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"customer": {
"name": "customer",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"contract": {
"name": "contract",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"vendor": {
"name": "vendor",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"incominginvoice": {
"name": "incominginvoice",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"plant": {
"name": "plant",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"createddocument": {
"name": "createddocument",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"vehicle": {
"name": "vehicle",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"product": {
"name": "product",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"check": {
"name": "check",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"inventoryitem": {
"name": "inventoryitem",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"folder": {
"name": "folder",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"mimeType": {
"name": "mimeType",
"type": "text",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"space": {
"name": "space",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"type": {
"name": "type",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"documentbox": {
"name": "documentbox",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"created_by": {
"name": "created_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"auth_profile": {
"name": "auth_profile",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"files_tenant_tenants_id_fk": {
"name": "files_tenant_tenants_id_fk",
"tableFrom": "files",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_project_projects_id_fk": {
"name": "files_project_projects_id_fk",
"tableFrom": "files",
"tableTo": "projects",
"columnsFrom": [
"project"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_customer_customers_id_fk": {
"name": "files_customer_customers_id_fk",
"tableFrom": "files",
"tableTo": "customers",
"columnsFrom": [
"customer"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_contract_contracts_id_fk": {
"name": "files_contract_contracts_id_fk",
"tableFrom": "files",
"tableTo": "contracts",
"columnsFrom": [
"contract"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_vendor_vendors_id_fk": {
"name": "files_vendor_vendors_id_fk",
"tableFrom": "files",
"tableTo": "vendors",
"columnsFrom": [
"vendor"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_incominginvoice_incominginvoices_id_fk": {
"name": "files_incominginvoice_incominginvoices_id_fk",
"tableFrom": "files",
"tableTo": "incominginvoices",
"columnsFrom": [
"incominginvoice"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_plant_plants_id_fk": {
"name": "files_plant_plants_id_fk",
"tableFrom": "files",
"tableTo": "plants",
"columnsFrom": [
"plant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_createddocument_createddocuments_id_fk": {
"name": "files_createddocument_createddocuments_id_fk",
"tableFrom": "files",
"tableTo": "createddocuments",
"columnsFrom": [
"createddocument"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_vehicle_vehicles_id_fk": {
"name": "files_vehicle_vehicles_id_fk",
"tableFrom": "files",
"tableTo": "vehicles",
"columnsFrom": [
"vehicle"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_product_products_id_fk": {
"name": "files_product_products_id_fk",
"tableFrom": "files",
"tableTo": "products",
"columnsFrom": [
"product"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_check_checks_id_fk": {
"name": "files_check_checks_id_fk",
"tableFrom": "files",
"tableTo": "checks",
"columnsFrom": [
"check"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_inventoryitem_inventoryitems_id_fk": {
"name": "files_inventoryitem_inventoryitems_id_fk",
"tableFrom": "files",
"tableTo": "inventoryitems",
"columnsFrom": [
"inventoryitem"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_folder_folders_id_fk": {
"name": "files_folder_folders_id_fk",
"tableFrom": "files",
"tableTo": "folders",
"columnsFrom": [
"folder"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_space_spaces_id_fk": {
"name": "files_space_spaces_id_fk",
"tableFrom": "files",
"tableTo": "spaces",
"columnsFrom": [
"space"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_type_filetags_id_fk": {
"name": "files_type_filetags_id_fk",
"tableFrom": "files",
"tableTo": "filetags",
"columnsFrom": [
"type"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_documentbox_documentboxes_id_fk": {
"name": "files_documentbox_documentboxes_id_fk",
"tableFrom": "files",
"tableTo": "documentboxes",
"columnsFrom": [
"documentbox"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_updated_by_auth_users_id_fk": {
"name": "files_updated_by_auth_users_id_fk",
"tableFrom": "files",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_created_by_auth_users_id_fk": {
"name": "files_created_by_auth_users_id_fk",
"tableFrom": "files",
"tableTo": "auth_users",
"columnsFrom": [
"created_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"files_auth_profile_auth_profiles_id_fk": {
"name": "files_auth_profile_auth_profiles_id_fk",
"tableFrom": "files",
"tableTo": "auth_profiles",
"columnsFrom": [
"auth_profile"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.filetags": {
"name": "filetags",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"color": {
"name": "color",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"createddocumenttype": {
"name": "createddocumenttype",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "''"
},
"incomingDocumentType": {
"name": "incomingDocumentType",
"type": "text",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
}
},
"indexes": {},
"foreignKeys": {
"filetags_tenant_tenants_id_fk": {
"name": "filetags_tenant_tenants_id_fk",
"tableFrom": "filetags",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.folders": {
"name": "folders",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"icon": {
"name": "icon",
"type": "text",
"primaryKey": false,
"notNull": false
},
"parent": {
"name": "parent",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"isSystemUsed": {
"name": "isSystemUsed",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"function": {
"name": "function",
"type": "folderfunctions",
"typeSchema": "public",
"primaryKey": false,
"notNull": false
},
"year": {
"name": "year",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"standardFiletype": {
"name": "standardFiletype",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"standardFiletypeIsOptional": {
"name": "standardFiletypeIsOptional",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
}
},
"indexes": {},
"foreignKeys": {
"folders_tenant_tenants_id_fk": {
"name": "folders_tenant_tenants_id_fk",
"tableFrom": "folders",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"folders_parent_folders_id_fk": {
"name": "folders_parent_folders_id_fk",
"tableFrom": "folders",
"tableTo": "folders",
"columnsFrom": [
"parent"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"folders_standardFiletype_filetags_id_fk": {
"name": "folders_standardFiletype_filetags_id_fk",
"tableFrom": "folders",
"tableTo": "filetags",
"columnsFrom": [
"standardFiletype"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"folders_updated_by_auth_users_id_fk": {
"name": "folders_updated_by_auth_users_id_fk",
"tableFrom": "folders",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.exports": {
"name": "exports",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "exports_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"start_date": {
"name": "start_date",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"end_date": {
"name": "end_date",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"valid_until": {
"name": "valid_until",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'datev'"
},
"url": {
"name": "url",
"type": "text",
"primaryKey": false,
"notNull": true
},
"file_path": {
"name": "file_path",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"exports_tenant_id_tenants_id_fk": {
"name": "exports_tenant_id_tenants_id_fk",
"tableFrom": "exports",
"tableTo": "tenants",
"columnsFrom": [
"tenant_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.globalmessages": {
"name": "globalmessages",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "globalmessages_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.globalmessagesseen": {
"name": "globalmessagesseen",
"schema": "",
"columns": {
"message": {
"name": "message",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"seen_at": {
"name": "seen_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"globalmessagesseen_message_globalmessages_id_fk": {
"name": "globalmessagesseen_message_globalmessages_id_fk",
"tableFrom": "globalmessagesseen",
"tableTo": "globalmessages",
"columnsFrom": [
"message"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.helpdesk_channel_instances": {
"name": "helpdesk_channel_instances",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"type_id": {
"name": "type_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"is_active": {
"name": "is_active",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"config": {
"name": "config",
"type": "jsonb",
"primaryKey": false,
"notNull": true
},
"public_config": {
"name": "public_config",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"public_token": {
"name": "public_token",
"type": "text",
"primaryKey": false,
"notNull": false
},
"secret_token": {
"name": "secret_token",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_by": {
"name": "created_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"helpdesk_channel_instances_tenant_id_tenants_id_fk": {
"name": "helpdesk_channel_instances_tenant_id_tenants_id_fk",
"tableFrom": "helpdesk_channel_instances",
"tableTo": "tenants",
"columnsFrom": [
"tenant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"helpdesk_channel_instances_type_id_helpdesk_channel_types_id_fk": {
"name": "helpdesk_channel_instances_type_id_helpdesk_channel_types_id_fk",
"tableFrom": "helpdesk_channel_instances",
"tableTo": "helpdesk_channel_types",
"columnsFrom": [
"type_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"helpdesk_channel_instances_created_by_auth_users_id_fk": {
"name": "helpdesk_channel_instances_created_by_auth_users_id_fk",
"tableFrom": "helpdesk_channel_instances",
"tableTo": "auth_users",
"columnsFrom": [
"created_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"helpdesk_channel_instances_public_token_unique": {
"name": "helpdesk_channel_instances_public_token_unique",
"nullsNotDistinct": false,
"columns": [
"public_token"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.helpdesk_channel_types": {
"name": "helpdesk_channel_types",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.helpdesk_contacts": {
"name": "helpdesk_contacts",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"customer_id": {
"name": "customer_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": false
},
"phone": {
"name": "phone",
"type": "text",
"primaryKey": false,
"notNull": false
},
"external_ref": {
"name": "external_ref",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"display_name": {
"name": "display_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"source_channel_id": {
"name": "source_channel_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"contact_id": {
"name": "contact_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"helpdesk_contacts_tenant_id_tenants_id_fk": {
"name": "helpdesk_contacts_tenant_id_tenants_id_fk",
"tableFrom": "helpdesk_contacts",
"tableTo": "tenants",
"columnsFrom": [
"tenant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"helpdesk_contacts_customer_id_customers_id_fk": {
"name": "helpdesk_contacts_customer_id_customers_id_fk",
"tableFrom": "helpdesk_contacts",
"tableTo": "customers",
"columnsFrom": [
"customer_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"helpdesk_contacts_source_channel_id_helpdesk_channel_instances_id_fk": {
"name": "helpdesk_contacts_source_channel_id_helpdesk_channel_instances_id_fk",
"tableFrom": "helpdesk_contacts",
"tableTo": "helpdesk_channel_instances",
"columnsFrom": [
"source_channel_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"helpdesk_contacts_contact_id_contacts_id_fk": {
"name": "helpdesk_contacts_contact_id_contacts_id_fk",
"tableFrom": "helpdesk_contacts",
"tableTo": "contacts",
"columnsFrom": [
"contact_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.helpdesk_conversation_participants": {
"name": "helpdesk_conversation_participants",
"schema": "",
"columns": {
"conversation_id": {
"name": "conversation_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"helpdesk_conversation_participants_conversation_id_helpdesk_conversations_id_fk": {
"name": "helpdesk_conversation_participants_conversation_id_helpdesk_conversations_id_fk",
"tableFrom": "helpdesk_conversation_participants",
"tableTo": "helpdesk_conversations",
"columnsFrom": [
"conversation_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"helpdesk_conversation_participants_user_id_auth_users_id_fk": {
"name": "helpdesk_conversation_participants_user_id_auth_users_id_fk",
"tableFrom": "helpdesk_conversation_participants",
"tableTo": "auth_users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.helpdesk_conversations": {
"name": "helpdesk_conversations",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"channel_instance_id": {
"name": "channel_instance_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"contact_id": {
"name": "contact_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"subject": {
"name": "subject",
"type": "text",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'open'"
},
"priority": {
"name": "priority",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'normal'"
},
"assignee_user_id": {
"name": "assignee_user_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"last_message_at": {
"name": "last_message_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"customer_id": {
"name": "customer_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"contact_person_id": {
"name": "contact_person_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"ticket_number": {
"name": "ticket_number",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"helpdesk_conversations_tenant_id_tenants_id_fk": {
"name": "helpdesk_conversations_tenant_id_tenants_id_fk",
"tableFrom": "helpdesk_conversations",
"tableTo": "tenants",
"columnsFrom": [
"tenant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"helpdesk_conversations_channel_instance_id_helpdesk_channel_instances_id_fk": {
"name": "helpdesk_conversations_channel_instance_id_helpdesk_channel_instances_id_fk",
"tableFrom": "helpdesk_conversations",
"tableTo": "helpdesk_channel_instances",
"columnsFrom": [
"channel_instance_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"helpdesk_conversations_contact_id_helpdesk_contacts_id_fk": {
"name": "helpdesk_conversations_contact_id_helpdesk_contacts_id_fk",
"tableFrom": "helpdesk_conversations",
"tableTo": "helpdesk_contacts",
"columnsFrom": [
"contact_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"helpdesk_conversations_assignee_user_id_auth_users_id_fk": {
"name": "helpdesk_conversations_assignee_user_id_auth_users_id_fk",
"tableFrom": "helpdesk_conversations",
"tableTo": "auth_users",
"columnsFrom": [
"assignee_user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"helpdesk_conversations_customer_id_customers_id_fk": {
"name": "helpdesk_conversations_customer_id_customers_id_fk",
"tableFrom": "helpdesk_conversations",
"tableTo": "customers",
"columnsFrom": [
"customer_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"helpdesk_conversations_contact_person_id_contacts_id_fk": {
"name": "helpdesk_conversations_contact_person_id_contacts_id_fk",
"tableFrom": "helpdesk_conversations",
"tableTo": "contacts",
"columnsFrom": [
"contact_person_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.helpdesk_messages": {
"name": "helpdesk_messages",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"conversation_id": {
"name": "conversation_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"direction": {
"name": "direction",
"type": "text",
"primaryKey": false,
"notNull": true
},
"author_user_id": {
"name": "author_user_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"payload": {
"name": "payload",
"type": "jsonb",
"primaryKey": false,
"notNull": true
},
"raw_meta": {
"name": "raw_meta",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"contact_id": {
"name": "contact_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"external_message_id": {
"name": "external_message_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"received_at": {
"name": "received_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"helpdesk_messages_tenant_id_tenants_id_fk": {
"name": "helpdesk_messages_tenant_id_tenants_id_fk",
"tableFrom": "helpdesk_messages",
"tableTo": "tenants",
"columnsFrom": [
"tenant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"helpdesk_messages_conversation_id_helpdesk_conversations_id_fk": {
"name": "helpdesk_messages_conversation_id_helpdesk_conversations_id_fk",
"tableFrom": "helpdesk_messages",
"tableTo": "helpdesk_conversations",
"columnsFrom": [
"conversation_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"helpdesk_messages_author_user_id_auth_users_id_fk": {
"name": "helpdesk_messages_author_user_id_auth_users_id_fk",
"tableFrom": "helpdesk_messages",
"tableTo": "auth_users",
"columnsFrom": [
"author_user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"helpdesk_messages_contact_id_helpdesk_contacts_id_fk": {
"name": "helpdesk_messages_contact_id_helpdesk_contacts_id_fk",
"tableFrom": "helpdesk_messages",
"tableTo": "helpdesk_contacts",
"columnsFrom": [
"contact_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"helpdesk_messages_external_message_id_unique": {
"name": "helpdesk_messages_external_message_id_unique",
"nullsNotDistinct": false,
"columns": [
"external_message_id"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.helpdesk_routing_rules": {
"name": "helpdesk_routing_rules",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"condition": {
"name": "condition",
"type": "jsonb",
"primaryKey": false,
"notNull": true
},
"action": {
"name": "action",
"type": "jsonb",
"primaryKey": false,
"notNull": true
},
"created_by": {
"name": "created_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"helpdesk_routing_rules_tenant_id_tenants_id_fk": {
"name": "helpdesk_routing_rules_tenant_id_tenants_id_fk",
"tableFrom": "helpdesk_routing_rules",
"tableTo": "tenants",
"columnsFrom": [
"tenant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"helpdesk_routing_rules_created_by_auth_users_id_fk": {
"name": "helpdesk_routing_rules_created_by_auth_users_id_fk",
"tableFrom": "helpdesk_routing_rules",
"tableTo": "auth_users",
"columnsFrom": [
"created_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.historyitems": {
"name": "historyitems",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "historyitems_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"text": {
"name": "text",
"type": "text",
"primaryKey": false,
"notNull": true
},
"customer": {
"name": "customer",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"vendor": {
"name": "vendor",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"project": {
"name": "project",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"plant": {
"name": "plant",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"incomingInvoice": {
"name": "incomingInvoice",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"contact": {
"name": "contact",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"inventoryitem": {
"name": "inventoryitem",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"product": {
"name": "product",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"event": {
"name": "event",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"newVal": {
"name": "newVal",
"type": "text",
"primaryKey": false,
"notNull": false
},
"oldVal": {
"name": "oldVal",
"type": "text",
"primaryKey": false,
"notNull": false
},
"task": {
"name": "task",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"vehicle": {
"name": "vehicle",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"bankstatement": {
"name": "bankstatement",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"space": {
"name": "space",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"config": {
"name": "config",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"projecttype": {
"name": "projecttype",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"check": {
"name": "check",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"service": {
"name": "service",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"createddocument": {
"name": "createddocument",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"file": {
"name": "file",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"inventoryitemgroup": {
"name": "inventoryitemgroup",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"source": {
"name": "source",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'Software'"
},
"costcentre": {
"name": "costcentre",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"ownaccount": {
"name": "ownaccount",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"documentbox": {
"name": "documentbox",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"hourrate": {
"name": "hourrate",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"created_by": {
"name": "created_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"action": {
"name": "action",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"historyitems_customer_customers_id_fk": {
"name": "historyitems_customer_customers_id_fk",
"tableFrom": "historyitems",
"tableTo": "customers",
"columnsFrom": [
"customer"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"historyitems_tenant_tenants_id_fk": {
"name": "historyitems_tenant_tenants_id_fk",
"tableFrom": "historyitems",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_vendor_vendors_id_fk": {
"name": "historyitems_vendor_vendors_id_fk",
"tableFrom": "historyitems",
"tableTo": "vendors",
"columnsFrom": [
"vendor"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_project_projects_id_fk": {
"name": "historyitems_project_projects_id_fk",
"tableFrom": "historyitems",
"tableTo": "projects",
"columnsFrom": [
"project"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"historyitems_plant_plants_id_fk": {
"name": "historyitems_plant_plants_id_fk",
"tableFrom": "historyitems",
"tableTo": "plants",
"columnsFrom": [
"plant"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"historyitems_incomingInvoice_incominginvoices_id_fk": {
"name": "historyitems_incomingInvoice_incominginvoices_id_fk",
"tableFrom": "historyitems",
"tableTo": "incominginvoices",
"columnsFrom": [
"incomingInvoice"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"historyitems_contact_contacts_id_fk": {
"name": "historyitems_contact_contacts_id_fk",
"tableFrom": "historyitems",
"tableTo": "contacts",
"columnsFrom": [
"contact"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"historyitems_inventoryitem_inventoryitems_id_fk": {
"name": "historyitems_inventoryitem_inventoryitems_id_fk",
"tableFrom": "historyitems",
"tableTo": "inventoryitems",
"columnsFrom": [
"inventoryitem"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"historyitems_product_products_id_fk": {
"name": "historyitems_product_products_id_fk",
"tableFrom": "historyitems",
"tableTo": "products",
"columnsFrom": [
"product"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"historyitems_event_events_id_fk": {
"name": "historyitems_event_events_id_fk",
"tableFrom": "historyitems",
"tableTo": "events",
"columnsFrom": [
"event"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_task_tasks_id_fk": {
"name": "historyitems_task_tasks_id_fk",
"tableFrom": "historyitems",
"tableTo": "tasks",
"columnsFrom": [
"task"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_vehicle_vehicles_id_fk": {
"name": "historyitems_vehicle_vehicles_id_fk",
"tableFrom": "historyitems",
"tableTo": "vehicles",
"columnsFrom": [
"vehicle"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_bankstatement_bankstatements_id_fk": {
"name": "historyitems_bankstatement_bankstatements_id_fk",
"tableFrom": "historyitems",
"tableTo": "bankstatements",
"columnsFrom": [
"bankstatement"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_space_spaces_id_fk": {
"name": "historyitems_space_spaces_id_fk",
"tableFrom": "historyitems",
"tableTo": "spaces",
"columnsFrom": [
"space"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_projecttype_projecttypes_id_fk": {
"name": "historyitems_projecttype_projecttypes_id_fk",
"tableFrom": "historyitems",
"tableTo": "projecttypes",
"columnsFrom": [
"projecttype"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_check_checks_id_fk": {
"name": "historyitems_check_checks_id_fk",
"tableFrom": "historyitems",
"tableTo": "checks",
"columnsFrom": [
"check"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_service_services_id_fk": {
"name": "historyitems_service_services_id_fk",
"tableFrom": "historyitems",
"tableTo": "services",
"columnsFrom": [
"service"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_createddocument_createddocuments_id_fk": {
"name": "historyitems_createddocument_createddocuments_id_fk",
"tableFrom": "historyitems",
"tableTo": "createddocuments",
"columnsFrom": [
"createddocument"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_file_files_id_fk": {
"name": "historyitems_file_files_id_fk",
"tableFrom": "historyitems",
"tableTo": "files",
"columnsFrom": [
"file"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_inventoryitemgroup_inventoryitemgroups_id_fk": {
"name": "historyitems_inventoryitemgroup_inventoryitemgroups_id_fk",
"tableFrom": "historyitems",
"tableTo": "inventoryitemgroups",
"columnsFrom": [
"inventoryitemgroup"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_costcentre_costcentres_id_fk": {
"name": "historyitems_costcentre_costcentres_id_fk",
"tableFrom": "historyitems",
"tableTo": "costcentres",
"columnsFrom": [
"costcentre"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_ownaccount_ownaccounts_id_fk": {
"name": "historyitems_ownaccount_ownaccounts_id_fk",
"tableFrom": "historyitems",
"tableTo": "ownaccounts",
"columnsFrom": [
"ownaccount"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_documentbox_documentboxes_id_fk": {
"name": "historyitems_documentbox_documentboxes_id_fk",
"tableFrom": "historyitems",
"tableTo": "documentboxes",
"columnsFrom": [
"documentbox"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_hourrate_hourrates_id_fk": {
"name": "historyitems_hourrate_hourrates_id_fk",
"tableFrom": "historyitems",
"tableTo": "hourrates",
"columnsFrom": [
"hourrate"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"historyitems_created_by_auth_users_id_fk": {
"name": "historyitems_created_by_auth_users_id_fk",
"tableFrom": "historyitems",
"tableTo": "auth_users",
"columnsFrom": [
"created_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.holidays": {
"name": "holidays",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "always",
"name": "holidays_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"date": {
"name": "date",
"type": "date",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"state_code": {
"name": "state_code",
"type": "text",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.hourrates": {
"name": "hourrates",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"purchasePrice": {
"name": "purchasePrice",
"type": "double precision",
"primaryKey": false,
"notNull": true
},
"sellingPrice": {
"name": "sellingPrice",
"type": "double precision",
"primaryKey": false,
"notNull": true
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"hourrates_tenant_tenants_id_fk": {
"name": "hourrates_tenant_tenants_id_fk",
"tableFrom": "hourrates",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"hourrates_updated_by_auth_users_id_fk": {
"name": "hourrates_updated_by_auth_users_id_fk",
"tableFrom": "hourrates",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.incominginvoices": {
"name": "incominginvoices",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "incominginvoices_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"state": {
"name": "state",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'Entwurf'"
},
"vendor": {
"name": "vendor",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"reference": {
"name": "reference",
"type": "text",
"primaryKey": false,
"notNull": false
},
"date": {
"name": "date",
"type": "text",
"primaryKey": false,
"notNull": false
},
"document": {
"name": "document",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"dueDate": {
"name": "dueDate",
"type": "text",
"primaryKey": false,
"notNull": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"paymentType": {
"name": "paymentType",
"type": "text",
"primaryKey": false,
"notNull": false
},
"accounts": {
"name": "accounts",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[{\"account\":null,\"taxType\":null,\"amountNet\":null,\"amountTax\":19,\"costCentre\":null}]'::jsonb"
},
"paid": {
"name": "paid",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"expense": {
"name": "expense",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
}
},
"indexes": {},
"foreignKeys": {
"incominginvoices_tenant_tenants_id_fk": {
"name": "incominginvoices_tenant_tenants_id_fk",
"tableFrom": "incominginvoices",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"incominginvoices_vendor_vendors_id_fk": {
"name": "incominginvoices_vendor_vendors_id_fk",
"tableFrom": "incominginvoices",
"tableTo": "vendors",
"columnsFrom": [
"vendor"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"incominginvoices_updated_by_auth_users_id_fk": {
"name": "incominginvoices_updated_by_auth_users_id_fk",
"tableFrom": "incominginvoices",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.inventoryitemgroups": {
"name": "inventoryitemgroups",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"inventoryitems": {
"name": "inventoryitems",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"profiles": {
"name": "profiles",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"usePlanning": {
"name": "usePlanning",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"inventoryitemgroups_tenant_tenants_id_fk": {
"name": "inventoryitemgroups_tenant_tenants_id_fk",
"tableFrom": "inventoryitemgroups",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"inventoryitemgroups_updated_by_auth_users_id_fk": {
"name": "inventoryitemgroups_updated_by_auth_users_id_fk",
"tableFrom": "inventoryitemgroups",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.inventoryitems": {
"name": "inventoryitems",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "inventoryitems_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"usePlanning": {
"name": "usePlanning",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"currentSpace": {
"name": "currentSpace",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"articleNumber": {
"name": "articleNumber",
"type": "text",
"primaryKey": false,
"notNull": false
},
"serialNumber": {
"name": "serialNumber",
"type": "text",
"primaryKey": false,
"notNull": false
},
"purchaseDate": {
"name": "purchaseDate",
"type": "date",
"primaryKey": false,
"notNull": false
},
"vendor": {
"name": "vendor",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"quantity": {
"name": "quantity",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": 0
},
"purchasePrice": {
"name": "purchasePrice",
"type": "double precision",
"primaryKey": false,
"notNull": false,
"default": 0
},
"manufacturer": {
"name": "manufacturer",
"type": "text",
"primaryKey": false,
"notNull": false
},
"manufacturerNumber": {
"name": "manufacturerNumber",
"type": "text",
"primaryKey": false,
"notNull": false
},
"currentValue": {
"name": "currentValue",
"type": "double precision",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"profiles": {
"name": "profiles",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"inventoryitems_tenant_tenants_id_fk": {
"name": "inventoryitems_tenant_tenants_id_fk",
"tableFrom": "inventoryitems",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"inventoryitems_currentSpace_spaces_id_fk": {
"name": "inventoryitems_currentSpace_spaces_id_fk",
"tableFrom": "inventoryitems",
"tableTo": "spaces",
"columnsFrom": [
"currentSpace"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"inventoryitems_vendor_vendors_id_fk": {
"name": "inventoryitems_vendor_vendors_id_fk",
"tableFrom": "inventoryitems",
"tableTo": "vendors",
"columnsFrom": [
"vendor"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"inventoryitems_updated_by_auth_users_id_fk": {
"name": "inventoryitems_updated_by_auth_users_id_fk",
"tableFrom": "inventoryitems",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.letterheads": {
"name": "letterheads",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "letterheads_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'Standard'"
},
"path": {
"name": "path",
"type": "text",
"primaryKey": false,
"notNull": true
},
"documentTypes": {
"name": "documentTypes",
"type": "text[]",
"primaryKey": false,
"notNull": true,
"default": "'{}'"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
}
},
"indexes": {},
"foreignKeys": {
"letterheads_tenant_tenants_id_fk": {
"name": "letterheads_tenant_tenants_id_fk",
"tableFrom": "letterheads",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"letterheads_updated_by_auth_users_id_fk": {
"name": "letterheads_updated_by_auth_users_id_fk",
"tableFrom": "letterheads",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.movements": {
"name": "movements",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "movements_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"quantity": {
"name": "quantity",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"productId": {
"name": "productId",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"spaceId": {
"name": "spaceId",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"projectId": {
"name": "projectId",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"serials": {
"name": "serials",
"type": "text[]",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"movements_productId_products_id_fk": {
"name": "movements_productId_products_id_fk",
"tableFrom": "movements",
"tableTo": "products",
"columnsFrom": [
"productId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"movements_spaceId_spaces_id_fk": {
"name": "movements_spaceId_spaces_id_fk",
"tableFrom": "movements",
"tableTo": "spaces",
"columnsFrom": [
"spaceId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"movements_tenant_tenants_id_fk": {
"name": "movements_tenant_tenants_id_fk",
"tableFrom": "movements",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"movements_projectId_projects_id_fk": {
"name": "movements_projectId_projects_id_fk",
"tableFrom": "movements",
"tableTo": "projects",
"columnsFrom": [
"projectId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"movements_updated_by_auth_users_id_fk": {
"name": "movements_updated_by_auth_users_id_fk",
"tableFrom": "movements",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.notifications_event_types": {
"name": "notifications_event_types",
"schema": "",
"columns": {
"event_key": {
"name": "event_key",
"type": "text",
"primaryKey": true,
"notNull": true
},
"display_name": {
"name": "display_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": false
},
"severity": {
"name": "severity",
"type": "notification_severity",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'info'"
},
"allowed_channels": {
"name": "allowed_channels",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[\"inapp\",\"email\"]'::jsonb"
},
"payload_schema": {
"name": "payload_schema",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"is_active": {
"name": "is_active",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.notifications_items": {
"name": "notifications_items",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"event_type": {
"name": "event_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"message": {
"name": "message",
"type": "text",
"primaryKey": false,
"notNull": true
},
"payload": {
"name": "payload",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"channel": {
"name": "channel",
"type": "notification_channel",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "notification_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'queued'"
},
"error": {
"name": "error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"sent_at": {
"name": "sent_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"read_at": {
"name": "read_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"notifications_items_tenant_id_tenants_id_fk": {
"name": "notifications_items_tenant_id_tenants_id_fk",
"tableFrom": "notifications_items",
"tableTo": "tenants",
"columnsFrom": [
"tenant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "cascade"
},
"notifications_items_user_id_auth_users_id_fk": {
"name": "notifications_items_user_id_auth_users_id_fk",
"tableFrom": "notifications_items",
"tableTo": "auth_users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "cascade"
},
"notifications_items_event_type_notifications_event_types_event_key_fk": {
"name": "notifications_items_event_type_notifications_event_types_event_key_fk",
"tableFrom": "notifications_items",
"tableTo": "notifications_event_types",
"columnsFrom": [
"event_type"
],
"columnsTo": [
"event_key"
],
"onDelete": "restrict",
"onUpdate": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.notifications_preferences": {
"name": "notifications_preferences",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"event_type": {
"name": "event_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"channel": {
"name": "channel",
"type": "notification_channel",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"notifications_preferences_tenant_id_user_id_event_type_chan_key": {
"name": "notifications_preferences_tenant_id_user_id_event_type_chan_key",
"columns": [
{
"expression": "tenant_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "event_type",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "channel",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"notifications_preferences_tenant_id_tenants_id_fk": {
"name": "notifications_preferences_tenant_id_tenants_id_fk",
"tableFrom": "notifications_preferences",
"tableTo": "tenants",
"columnsFrom": [
"tenant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "cascade"
},
"notifications_preferences_user_id_auth_users_id_fk": {
"name": "notifications_preferences_user_id_auth_users_id_fk",
"tableFrom": "notifications_preferences",
"tableTo": "auth_users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "cascade"
},
"notifications_preferences_event_type_notifications_event_types_event_key_fk": {
"name": "notifications_preferences_event_type_notifications_event_types_event_key_fk",
"tableFrom": "notifications_preferences",
"tableTo": "notifications_event_types",
"columnsFrom": [
"event_type"
],
"columnsTo": [
"event_key"
],
"onDelete": "restrict",
"onUpdate": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.notifications_preferences_defaults": {
"name": "notifications_preferences_defaults",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"event_key": {
"name": "event_key",
"type": "text",
"primaryKey": false,
"notNull": true
},
"channel": {
"name": "channel",
"type": "notification_channel",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"notifications_preferences_defau_tenant_id_event_key_channel_key": {
"name": "notifications_preferences_defau_tenant_id_event_key_channel_key",
"columns": [
{
"expression": "tenant_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "event_key",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "channel",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"notifications_preferences_defaults_tenant_id_tenants_id_fk": {
"name": "notifications_preferences_defaults_tenant_id_tenants_id_fk",
"tableFrom": "notifications_preferences_defaults",
"tableTo": "tenants",
"columnsFrom": [
"tenant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "cascade"
},
"notifications_preferences_defaults_event_key_notifications_event_types_event_key_fk": {
"name": "notifications_preferences_defaults_event_key_notifications_event_types_event_key_fk",
"tableFrom": "notifications_preferences_defaults",
"tableTo": "notifications_event_types",
"columnsFrom": [
"event_key"
],
"columnsTo": [
"event_key"
],
"onDelete": "restrict",
"onUpdate": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.ownaccounts": {
"name": "ownaccounts",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"number": {
"name": "number",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"profiles": {
"name": "profiles",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"ownaccounts_tenant_tenants_id_fk": {
"name": "ownaccounts_tenant_tenants_id_fk",
"tableFrom": "ownaccounts",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"ownaccounts_updated_by_auth_users_id_fk": {
"name": "ownaccounts_updated_by_auth_users_id_fk",
"tableFrom": "ownaccounts",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.plants": {
"name": "plants",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "plants_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"customer": {
"name": "customer",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"infoData": {
"name": "infoData",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"contract": {
"name": "contract",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"description": {
"name": "description",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'{\"html\":\"\",\"json\":[],\"text\":\"\"}'::jsonb"
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"profiles": {
"name": "profiles",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"plants_tenant_tenants_id_fk": {
"name": "plants_tenant_tenants_id_fk",
"tableFrom": "plants",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"plants_customer_customers_id_fk": {
"name": "plants_customer_customers_id_fk",
"tableFrom": "plants",
"tableTo": "customers",
"columnsFrom": [
"customer"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"plants_contract_contracts_id_fk": {
"name": "plants_contract_contracts_id_fk",
"tableFrom": "plants",
"tableTo": "contracts",
"columnsFrom": [
"contract"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"plants_updated_by_auth_users_id_fk": {
"name": "plants_updated_by_auth_users_id_fk",
"tableFrom": "plants",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.productcategories": {
"name": "productcategories",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "productcategories_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"productcategories_tenant_tenants_id_fk": {
"name": "productcategories_tenant_tenants_id_fk",
"tableFrom": "productcategories",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"productcategories_updated_by_auth_users_id_fk": {
"name": "productcategories_updated_by_auth_users_id_fk",
"tableFrom": "productcategories",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.products": {
"name": "products",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "products_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"manufacturer": {
"name": "manufacturer",
"type": "text",
"primaryKey": false,
"notNull": false
},
"unit": {
"name": "unit",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"tags": {
"name": "tags",
"type": "json",
"primaryKey": false,
"notNull": true,
"default": "'[]'::json"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"ean": {
"name": "ean",
"type": "text",
"primaryKey": false,
"notNull": false
},
"barcode": {
"name": "barcode",
"type": "text",
"primaryKey": false,
"notNull": false
},
"purchasePrice": {
"name": "purchasePrice",
"type": "double precision",
"primaryKey": false,
"notNull": false
},
"sellingPrice": {
"name": "sellingPrice",
"type": "double precision",
"primaryKey": false,
"notNull": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"manufacturerNumber": {
"name": "manufacturerNumber",
"type": "text",
"primaryKey": false,
"notNull": false
},
"vendorAllocation": {
"name": "vendorAllocation",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'[]'::jsonb"
},
"articleNumber": {
"name": "articleNumber",
"type": "text",
"primaryKey": false,
"notNull": false
},
"barcodes": {
"name": "barcodes",
"type": "text[]",
"primaryKey": false,
"notNull": true,
"default": "'{}'"
},
"productcategories": {
"name": "productcategories",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'[]'::jsonb"
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"taxPercentage": {
"name": "taxPercentage",
"type": "smallint",
"primaryKey": false,
"notNull": true,
"default": 19
},
"markupPercentage": {
"name": "markupPercentage",
"type": "double precision",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"products_unit_units_id_fk": {
"name": "products_unit_units_id_fk",
"tableFrom": "products",
"tableTo": "units",
"columnsFrom": [
"unit"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"products_tenant_tenants_id_fk": {
"name": "products_tenant_tenants_id_fk",
"tableFrom": "products",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"products_updated_by_auth_users_id_fk": {
"name": "products_updated_by_auth_users_id_fk",
"tableFrom": "products",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.projects": {
"name": "projects",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "projects_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customer": {
"name": "customer",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"phases": {
"name": "phases",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'[]'::jsonb"
},
"description": {
"name": "description",
"type": "json",
"primaryKey": false,
"notNull": false
},
"forms": {
"name": "forms",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'[]'::jsonb"
},
"heroId": {
"name": "heroId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"measure": {
"name": "measure",
"type": "text",
"primaryKey": false,
"notNull": false
},
"material": {
"name": "material",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"plant": {
"name": "plant",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"profiles": {
"name": "profiles",
"type": "uuid[]",
"primaryKey": false,
"notNull": true,
"default": "'{}'"
},
"projectNumber": {
"name": "projectNumber",
"type": "text",
"primaryKey": false,
"notNull": false
},
"contract": {
"name": "contract",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"projectType": {
"name": "projectType",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'Projekt'"
},
"projecttype": {
"name": "projecttype",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"customerRef": {
"name": "customerRef",
"type": "text",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"active_phase": {
"name": "active_phase",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"projects_tenant_tenants_id_fk": {
"name": "projects_tenant_tenants_id_fk",
"tableFrom": "projects",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"projects_customer_customers_id_fk": {
"name": "projects_customer_customers_id_fk",
"tableFrom": "projects",
"tableTo": "customers",
"columnsFrom": [
"customer"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"projects_contract_contracts_id_fk": {
"name": "projects_contract_contracts_id_fk",
"tableFrom": "projects",
"tableTo": "contracts",
"columnsFrom": [
"contract"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"projects_projecttype_projecttypes_id_fk": {
"name": "projects_projecttype_projecttypes_id_fk",
"tableFrom": "projects",
"tableTo": "projecttypes",
"columnsFrom": [
"projecttype"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"projects_updated_by_auth_users_id_fk": {
"name": "projects_updated_by_auth_users_id_fk",
"tableFrom": "projects",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.projecttypes": {
"name": "projecttypes",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "projecttypes_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"initialPhases": {
"name": "initialPhases",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"addablePhases": {
"name": "addablePhases",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"icon": {
"name": "icon",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"projecttypes_tenant_tenants_id_fk": {
"name": "projecttypes_tenant_tenants_id_fk",
"tableFrom": "projecttypes",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"projecttypes_updated_by_auth_users_id_fk": {
"name": "projecttypes_updated_by_auth_users_id_fk",
"tableFrom": "projecttypes",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.servicecategories": {
"name": "servicecategories",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "servicecategories_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"discount": {
"name": "discount",
"type": "double precision",
"primaryKey": false,
"notNull": false,
"default": 0
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"servicecategories_tenant_tenants_id_fk": {
"name": "servicecategories_tenant_tenants_id_fk",
"tableFrom": "servicecategories",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"servicecategories_updated_by_auth_users_id_fk": {
"name": "servicecategories_updated_by_auth_users_id_fk",
"tableFrom": "servicecategories",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.services": {
"name": "services",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "services_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"sellingPrice": {
"name": "sellingPrice",
"type": "double precision",
"primaryKey": false,
"notNull": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"unit": {
"name": "unit",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"serviceNumber": {
"name": "serviceNumber",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"tags": {
"name": "tags",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'[]'::jsonb"
},
"servicecategories": {
"name": "servicecategories",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"purchasePriceComposed": {
"name": "purchasePriceComposed",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{\"total\":0}'::jsonb"
},
"sellingPriceComposed": {
"name": "sellingPriceComposed",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{\"total\":0}'::jsonb"
},
"taxPercentage": {
"name": "taxPercentage",
"type": "smallint",
"primaryKey": false,
"notNull": true,
"default": 19
},
"materialComposition": {
"name": "materialComposition",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"personalComposition": {
"name": "personalComposition",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"services_tenant_tenants_id_fk": {
"name": "services_tenant_tenants_id_fk",
"tableFrom": "services",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"services_unit_units_id_fk": {
"name": "services_unit_units_id_fk",
"tableFrom": "services",
"tableTo": "units",
"columnsFrom": [
"unit"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"services_updated_by_auth_users_id_fk": {
"name": "services_updated_by_auth_users_id_fk",
"tableFrom": "services",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.spaces": {
"name": "spaces",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "spaces_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"spaceNumber": {
"name": "spaceNumber",
"type": "text",
"primaryKey": false,
"notNull": true
},
"parentSpace": {
"name": "parentSpace",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"infoData": {
"name": "infoData",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{\"zip\":\"\",\"city\":\"\",\"streetNumber\":\"\"}'::jsonb"
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"spaces_tenant_tenants_id_fk": {
"name": "spaces_tenant_tenants_id_fk",
"tableFrom": "spaces",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"spaces_parentSpace_spaces_id_fk": {
"name": "spaces_parentSpace_spaces_id_fk",
"tableFrom": "spaces",
"tableTo": "spaces",
"columnsFrom": [
"parentSpace"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"spaces_updated_by_auth_users_id_fk": {
"name": "spaces_updated_by_auth_users_id_fk",
"tableFrom": "spaces",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.staff_time_entries": {
"name": "staff_time_entries",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"started_at": {
"name": "started_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"stopped_at": {
"name": "stopped_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"duration_minutes": {
"name": "duration_minutes",
"type": "integer",
"primaryKey": false,
"notNull": false,
"generated": {
"as": "CASE \n WHEN stopped_at IS NOT NULL \n THEN (EXTRACT(epoch FROM (stopped_at - started_at)) / 60)\n ELSE NULL\n END",
"type": "stored"
}
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'work'"
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"source": {
"name": "source",
"type": "text",
"primaryKey": false,
"notNull": false
},
"state": {
"name": "state",
"type": "times_state",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'draft'"
},
"device": {
"name": "device",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"internal_note": {
"name": "internal_note",
"type": "text",
"primaryKey": false,
"notNull": false
},
"vacation_reason": {
"name": "vacation_reason",
"type": "text",
"primaryKey": false,
"notNull": false
},
"vacation_days": {
"name": "vacation_days",
"type": "numeric(5, 2)",
"primaryKey": false,
"notNull": false
},
"approved_by": {
"name": "approved_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"approved_at": {
"name": "approved_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"sick_reason": {
"name": "sick_reason",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"staff_time_entries_tenant_id_tenants_id_fk": {
"name": "staff_time_entries_tenant_id_tenants_id_fk",
"tableFrom": "staff_time_entries",
"tableTo": "tenants",
"columnsFrom": [
"tenant_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"staff_time_entries_user_id_auth_users_id_fk": {
"name": "staff_time_entries_user_id_auth_users_id_fk",
"tableFrom": "staff_time_entries",
"tableTo": "auth_users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"staff_time_entries_updated_by_auth_users_id_fk": {
"name": "staff_time_entries_updated_by_auth_users_id_fk",
"tableFrom": "staff_time_entries",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"staff_time_entries_approved_by_auth_users_id_fk": {
"name": "staff_time_entries_approved_by_auth_users_id_fk",
"tableFrom": "staff_time_entries",
"tableTo": "auth_users",
"columnsFrom": [
"approved_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.staff_time_entry_connects": {
"name": "staff_time_entry_connects",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"time_entry_id": {
"name": "time_entry_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"started_at": {
"name": "started_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"stopped_at": {
"name": "stopped_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"duration_minutes": {
"name": "duration_minutes",
"type": "integer",
"primaryKey": false,
"notNull": false,
"generated": {
"as": "(EXTRACT(epoch FROM (stopped_at - started_at)) / 60)",
"type": "stored"
}
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"staff_time_entry_connects_time_entry_id_staff_time_entries_id_fk": {
"name": "staff_time_entry_connects_time_entry_id_staff_time_entries_id_fk",
"tableFrom": "staff_time_entry_connects",
"tableTo": "staff_time_entries",
"columnsFrom": [
"time_entry_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.staff_zeitstromtimestamps": {
"name": "staff_zeitstromtimestamps",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"profile": {
"name": "profile",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"key": {
"name": "key",
"type": "text",
"primaryKey": false,
"notNull": true
},
"intent": {
"name": "intent",
"type": "text",
"primaryKey": false,
"notNull": true
},
"time": {
"name": "time",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"staff_time_entry": {
"name": "staff_time_entry",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"internal_note": {
"name": "internal_note",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"staff_zeitstromtimestamps_tenant_tenants_id_fk": {
"name": "staff_zeitstromtimestamps_tenant_tenants_id_fk",
"tableFrom": "staff_zeitstromtimestamps",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"staff_zeitstromtimestamps_profile_auth_profiles_id_fk": {
"name": "staff_zeitstromtimestamps_profile_auth_profiles_id_fk",
"tableFrom": "staff_zeitstromtimestamps",
"tableTo": "auth_profiles",
"columnsFrom": [
"profile"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"staff_zeitstromtimestamps_staff_time_entry_staff_time_entries_id_fk": {
"name": "staff_zeitstromtimestamps_staff_time_entry_staff_time_entries_id_fk",
"tableFrom": "staff_zeitstromtimestamps",
"tableTo": "staff_time_entries",
"columnsFrom": [
"staff_time_entry"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.statementallocations": {
"name": "statementallocations",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"bs_id": {
"name": "bs_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"cd_id": {
"name": "cd_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"amount": {
"name": "amount",
"type": "double precision",
"primaryKey": false,
"notNull": true,
"default": 0
},
"ii_id": {
"name": "ii_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"account": {
"name": "account",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"ownaccount": {
"name": "ownaccount",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"customer": {
"name": "customer",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"vendor": {
"name": "vendor",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
}
},
"indexes": {},
"foreignKeys": {
"statementallocations_bs_id_bankstatements_id_fk": {
"name": "statementallocations_bs_id_bankstatements_id_fk",
"tableFrom": "statementallocations",
"tableTo": "bankstatements",
"columnsFrom": [
"bs_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"statementallocations_cd_id_createddocuments_id_fk": {
"name": "statementallocations_cd_id_createddocuments_id_fk",
"tableFrom": "statementallocations",
"tableTo": "createddocuments",
"columnsFrom": [
"cd_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"statementallocations_ii_id_incominginvoices_id_fk": {
"name": "statementallocations_ii_id_incominginvoices_id_fk",
"tableFrom": "statementallocations",
"tableTo": "incominginvoices",
"columnsFrom": [
"ii_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"statementallocations_tenant_tenants_id_fk": {
"name": "statementallocations_tenant_tenants_id_fk",
"tableFrom": "statementallocations",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"statementallocations_account_accounts_id_fk": {
"name": "statementallocations_account_accounts_id_fk",
"tableFrom": "statementallocations",
"tableTo": "accounts",
"columnsFrom": [
"account"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"statementallocations_ownaccount_ownaccounts_id_fk": {
"name": "statementallocations_ownaccount_ownaccounts_id_fk",
"tableFrom": "statementallocations",
"tableTo": "ownaccounts",
"columnsFrom": [
"ownaccount"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"statementallocations_customer_customers_id_fk": {
"name": "statementallocations_customer_customers_id_fk",
"tableFrom": "statementallocations",
"tableTo": "customers",
"columnsFrom": [
"customer"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"statementallocations_vendor_vendors_id_fk": {
"name": "statementallocations_vendor_vendors_id_fk",
"tableFrom": "statementallocations",
"tableTo": "vendors",
"columnsFrom": [
"vendor"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"statementallocations_updated_by_auth_users_id_fk": {
"name": "statementallocations_updated_by_auth_users_id_fk",
"tableFrom": "statementallocations",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.tasks": {
"name": "tasks",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "tasks_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"categorie": {
"name": "categorie",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"project": {
"name": "project",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"plant": {
"name": "plant",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"customer": {
"name": "customer",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"profiles": {
"name": "profiles",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"tasks_tenant_tenants_id_fk": {
"name": "tasks_tenant_tenants_id_fk",
"tableFrom": "tasks",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"tasks_user_id_auth_users_id_fk": {
"name": "tasks_user_id_auth_users_id_fk",
"tableFrom": "tasks",
"tableTo": "auth_users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"tasks_customer_customers_id_fk": {
"name": "tasks_customer_customers_id_fk",
"tableFrom": "tasks",
"tableTo": "customers",
"columnsFrom": [
"customer"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"tasks_updated_by_auth_users_id_fk": {
"name": "tasks_updated_by_auth_users_id_fk",
"tableFrom": "tasks",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.taxtypes": {
"name": "taxtypes",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "taxtypes_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"label": {
"name": "label",
"type": "text",
"primaryKey": false,
"notNull": true
},
"percentage": {
"name": "percentage",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"taxtypes_updated_by_auth_users_id_fk": {
"name": "taxtypes_updated_by_auth_users_id_fk",
"tableFrom": "taxtypes",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.tenants": {
"name": "tenants",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "tenants_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"short": {
"name": "short",
"type": "text",
"primaryKey": false,
"notNull": true
},
"calendarConfig": {
"name": "calendarConfig",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'{\"eventTypes\":[{\"color\":\"blue\",\"label\":\"Büro\"},{\"color\":\"yellow\",\"label\":\"Besprechung\"},{\"color\":\"green\",\"label\":\"Umsetzung\"},{\"color\":\"red\",\"label\":\"Vor Ort Termin\"}]}'::jsonb"
},
"timeConfig": {
"name": "timeConfig",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"tags": {
"name": "tags",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{\"products\":[],\"documents\":[]}'::jsonb"
},
"measures": {
"name": "measures",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[{\"name\":\"Netzwerktechnik\",\"short\":\"NWT\"},{\"name\":\"Elektrotechnik\",\"short\":\"ELT\"},{\"name\":\"Photovoltaik\",\"short\":\"PV\"},{\"name\":\"Videüberwachung\",\"short\":\"VÜA\"},{\"name\":\"Projekt\",\"short\":\"PRJ\"},{\"name\":\"Smart Home\",\"short\":\"SHO\"}]'::jsonb"
},
"businessInfo": {
"name": "businessInfo",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'{\"zip\":\"\",\"city\":\"\",\"name\":\"\",\"street\":\"\"}'::jsonb"
},
"features": {
"name": "features",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'{\"objects\":true,\"calendar\":true,\"contacts\":true,\"projects\":true,\"vehicles\":true,\"contracts\":true,\"inventory\":true,\"accounting\":true,\"timeTracking\":true,\"planningBoard\":true,\"workingTimeTracking\":true}'::jsonb"
},
"ownFields": {
"name": "ownFields",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"numberRanges": {
"name": "numberRanges",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{\"vendors\":{\"prefix\":\"\",\"suffix\":\"\",\"nextNumber\":10000},\"customers\":{\"prefix\":\"\",\"suffix\":\"\",\"nextNumber\":10000},\"products\":{\"prefix\":\"AT-\",\"suffix\":\"\",\"nextNumber\":1000},\"quotes\":{\"prefix\":\"AN-\",\"suffix\":\"\",\"nextNumber\":1000},\"confirmationOrders\":{\"prefix\":\"AB-\",\"suffix\":\"\",\"nextNumber\":1000},\"invoices\":{\"prefix\":\"RE-\",\"suffix\":\"\",\"nextNumber\":1000},\"spaces\":{\"prefix\":\"LP-\",\"suffix\":\"\",\"nextNumber\":1000},\"inventoryitems\":{\"prefix\":\"IA-\",\"suffix\":\"\",\"nextNumber\":1000},\"projects\":{\"prefix\":\"PRJ-\",\"suffix\":\"\",\"nextNumber\":1000},\"costcentres\":{\"prefix\":\"KST-\",\"suffix\":\"\",\"nextNumber\":1000}}'::jsonb"
},
"standardEmailForInvoices": {
"name": "standardEmailForInvoices",
"type": "text",
"primaryKey": false,
"notNull": false
},
"extraModules": {
"name": "extraModules",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"isInTrial": {
"name": "isInTrial",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"trialEndDate": {
"name": "trialEndDate",
"type": "date",
"primaryKey": false,
"notNull": false
},
"stripeCustomerId": {
"name": "stripeCustomerId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"hasActiveLicense": {
"name": "hasActiveLicense",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"userLicenseCount": {
"name": "userLicenseCount",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"workstationLicenseCount": {
"name": "workstationLicenseCount",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"standardPaymentDays": {
"name": "standardPaymentDays",
"type": "smallint",
"primaryKey": false,
"notNull": true,
"default": 14
},
"dokuboxEmailAddresses": {
"name": "dokuboxEmailAddresses",
"type": "jsonb",
"primaryKey": false,
"notNull": false,
"default": "'[]'::jsonb"
},
"dokuboxkey": {
"name": "dokuboxkey",
"type": "uuid",
"primaryKey": false,
"notNull": true,
"default": "gen_random_uuid()"
},
"autoPrepareIncomingInvoices": {
"name": "autoPrepareIncomingInvoices",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
},
"portalDomain": {
"name": "portalDomain",
"type": "text",
"primaryKey": false,
"notNull": false
},
"portalConfig": {
"name": "portalConfig",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{\"primayColor\":\"#69c350\"}'::jsonb"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"locked": {
"name": "locked",
"type": "locked_tenant",
"typeSchema": "public",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"tenants_updated_by_auth_users_id_fk": {
"name": "tenants_updated_by_auth_users_id_fk",
"tableFrom": "tenants",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.texttemplates": {
"name": "texttemplates",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "texttemplates_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"text": {
"name": "text",
"type": "text",
"primaryKey": false,
"notNull": true
},
"documentType": {
"name": "documentType",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "''"
},
"default": {
"name": "default",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"pos": {
"name": "pos",
"type": "texttemplatepositions",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"texttemplates_tenant_tenants_id_fk": {
"name": "texttemplates_tenant_tenants_id_fk",
"tableFrom": "texttemplates",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"texttemplates_updated_by_auth_users_id_fk": {
"name": "texttemplates_updated_by_auth_users_id_fk",
"tableFrom": "texttemplates",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.units": {
"name": "units",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "units_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"single": {
"name": "single",
"type": "text",
"primaryKey": false,
"notNull": true
},
"multiple": {
"name": "multiple",
"type": "text",
"primaryKey": false,
"notNull": false
},
"short": {
"name": "short",
"type": "text",
"primaryKey": false,
"notNull": false
},
"step": {
"name": "step",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'1'"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.user_credentials": {
"name": "user_credentials",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"smtp_port": {
"name": "smtp_port",
"type": "numeric",
"primaryKey": false,
"notNull": false
},
"smtp_ssl": {
"name": "smtp_ssl",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"type": {
"name": "type",
"type": "credential_types",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"imap_port": {
"name": "imap_port",
"type": "numeric",
"primaryKey": false,
"notNull": false
},
"imap_ssl": {
"name": "imap_ssl",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"email_encrypted": {
"name": "email_encrypted",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"password_encrypted": {
"name": "password_encrypted",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"smtp_host_encrypted": {
"name": "smtp_host_encrypted",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"imap_host_encrypted": {
"name": "imap_host_encrypted",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"access_token_encrypted": {
"name": "access_token_encrypted",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"refresh_token_encrypted": {
"name": "refresh_token_encrypted",
"type": "jsonb",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"user_credentials_user_id_auth_users_id_fk": {
"name": "user_credentials_user_id_auth_users_id_fk",
"tableFrom": "user_credentials",
"tableTo": "auth_users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"user_credentials_tenant_id_tenants_id_fk": {
"name": "user_credentials_tenant_id_tenants_id_fk",
"tableFrom": "user_credentials",
"tableTo": "tenants",
"columnsFrom": [
"tenant_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.vehicles": {
"name": "vehicles",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "vehicles_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"licensePlate": {
"name": "licensePlate",
"type": "text",
"primaryKey": false,
"notNull": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": false
},
"active": {
"name": "active",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
},
"driver": {
"name": "driver",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"vin": {
"name": "vin",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tankSize": {
"name": "tankSize",
"type": "double precision",
"primaryKey": false,
"notNull": true,
"default": 0
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"buildYear": {
"name": "buildYear",
"type": "text",
"primaryKey": false,
"notNull": false
},
"towingCapacity": {
"name": "towingCapacity",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"powerInKW": {
"name": "powerInKW",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"color": {
"name": "color",
"type": "text",
"primaryKey": false,
"notNull": false
},
"profiles": {
"name": "profiles",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"vehicles_tenant_tenants_id_fk": {
"name": "vehicles_tenant_tenants_id_fk",
"tableFrom": "vehicles",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"vehicles_driver_auth_users_id_fk": {
"name": "vehicles_driver_auth_users_id_fk",
"tableFrom": "vehicles",
"tableTo": "auth_users",
"columnsFrom": [
"driver"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"vehicles_updated_by_auth_users_id_fk": {
"name": "vehicles_updated_by_auth_users_id_fk",
"tableFrom": "vehicles",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.vendors": {
"name": "vendors",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "byDefault",
"name": "vendors_id_seq",
"schema": "public",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"vendorNumber": {
"name": "vendorNumber",
"type": "text",
"primaryKey": false,
"notNull": true
},
"tenant": {
"name": "tenant",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"infoData": {
"name": "infoData",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"hasSEPA": {
"name": "hasSEPA",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"profiles": {
"name": "profiles",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"defaultPaymentMethod": {
"name": "defaultPaymentMethod",
"type": "text",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"updated_by": {
"name": "updated_by",
"type": "uuid",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"vendors_tenant_tenants_id_fk": {
"name": "vendors_tenant_tenants_id_fk",
"tableFrom": "vendors",
"tableTo": "tenants",
"columnsFrom": [
"tenant"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"vendors_updated_by_auth_users_id_fk": {
"name": "vendors_updated_by_auth_users_id_fk",
"tableFrom": "vendors",
"tableTo": "auth_users",
"columnsFrom": [
"updated_by"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.time_events": {
"name": "time_events",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"tenant_id": {
"name": "tenant_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"actor_type": {
"name": "actor_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"actor_user_id": {
"name": "actor_user_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"event_time": {
"name": "event_time",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"event_type": {
"name": "event_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"source": {
"name": "source",
"type": "text",
"primaryKey": false,
"notNull": true
},
"invalidates_event_id": {
"name": "invalidates_event_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"metadata": {
"name": "metadata",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"idx_time_events_tenant_user_time": {
"name": "idx_time_events_tenant_user_time",
"columns": [
{
"expression": "tenant_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "event_time",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"idx_time_events_created_at": {
"name": "idx_time_events_created_at",
"columns": [
{
"expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"idx_time_events_invalidates": {
"name": "idx_time_events_invalidates",
"columns": [
{
"expression": "invalidates_event_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"time_events_tenant_id_tenants_id_fk": {
"name": "time_events_tenant_id_tenants_id_fk",
"tableFrom": "time_events",
"tableTo": "tenants",
"columnsFrom": [
"tenant_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"time_events_user_id_auth_users_id_fk": {
"name": "time_events_user_id_auth_users_id_fk",
"tableFrom": "time_events",
"tableTo": "auth_users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"time_events_actor_user_id_auth_users_id_fk": {
"name": "time_events_actor_user_id_auth_users_id_fk",
"tableFrom": "time_events",
"tableTo": "auth_users",
"columnsFrom": [
"actor_user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"time_events_invalidates_event_id_time_events_id_fk": {
"name": "time_events_invalidates_event_id_time_events_id_fk",
"tableFrom": "time_events",
"tableTo": "time_events",
"columnsFrom": [
"invalidates_event_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"time_events_actor_user_check": {
"name": "time_events_actor_user_check",
"value": "\n (actor_type = 'system' AND actor_user_id IS NULL)\n OR\n (actor_type = 'user' AND actor_user_id IS NOT NULL)\n "
}
},
"isRLSEnabled": false
}
},
"enums": {
"public.credential_types": {
"name": "credential_types",
"schema": "public",
"values": [
"mail",
"m365"
]
},
"public.folderfunctions": {
"name": "folderfunctions",
"schema": "public",
"values": [
"none",
"yearSubCategory",
"incomingInvoices",
"invoices",
"quotes",
"confirmationOrders",
"deliveryNotes",
"vehicleData",
"reminders",
"taxData",
"deposit",
"timeEvaluations"
]
},
"public.locked_tenant": {
"name": "locked_tenant",
"schema": "public",
"values": [
"maintenance_tenant",
"maintenance",
"general",
"no_subscription"
]
},
"public.notification_channel": {
"name": "notification_channel",
"schema": "public",
"values": [
"email",
"inapp",
"sms",
"push",
"webhook"
]
},
"public.notification_severity": {
"name": "notification_severity",
"schema": "public",
"values": [
"info",
"success",
"warning",
"error"
]
},
"public.notification_status": {
"name": "notification_status",
"schema": "public",
"values": [
"queued",
"sent",
"failed",
"read"
]
},
"public.payment_types": {
"name": "payment_types",
"schema": "public",
"values": [
"transfer",
"direct_debit"
]
},
"public.texttemplatepositions": {
"name": "texttemplatepositions",
"schema": "public",
"values": [
"startText",
"endText"
]
},
"public.times_state": {
"name": "times_state",
"schema": "public",
"values": [
"submitted",
"approved",
"draft"
]
}
},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}