Vollständiges Drizzle-Schema (alle Tabellen/Enums/Indizes aus Spec §6): brigades, users, merkmale(+optionen), vehicle_templates(+merkmale,+aliasse), equipment_categories(+merkmale), vehicles, equipment, merkmal_values (EAV mit typisierten Spalten + 4 Indizes), login_attempts, audit_log. Einzige initiale Migration 0000 (idempotent: enum-DO-Blöcke, IF NOT EXISTS), scripts/migrate.ts, db:* npm-Scripts. Verifiziert (offline): tsc --noEmit OK; drizzle-kit check 'Everything's fine'; Migration 7 CREATE TYPE / 14 CREATE TABLE / 17 CREATE INDEX / 32 IF NOT EXISTS. DEFERRED (kein Postgres im Sandbox — Ursache des vorherigen Stalls): live db:migrate und DB-abhängige Schema-Tests; laufen in CI/Deploy mit Postgres. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1474 lines
37 KiB
JSON
1474 lines
37 KiB
JSON
{
|
|
"id": "39709e14-70f1-49c8-8586-af0d48d734dd",
|
|
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
"version": "7",
|
|
"dialect": "postgresql",
|
|
"tables": {
|
|
"public.brigades": {
|
|
"name": "brigades",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"art": {
|
|
"name": "art",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'FF'"
|
|
},
|
|
"strasse": {
|
|
"name": "strasse",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"plz": {
|
|
"name": "plz",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"ort": {
|
|
"name": "ort",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"bundesland": {
|
|
"name": "bundesland",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'Niederösterreich'"
|
|
},
|
|
"lat": {
|
|
"name": "lat",
|
|
"type": "double precision",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"lng": {
|
|
"name": "lng",
|
|
"type": "double precision",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"geocode_query": {
|
|
"name": "geocode_query",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"geocoded_at": {
|
|
"name": "geocoded_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"geocode_status": {
|
|
"name": "geocode_status",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"funkrufname_schema": {
|
|
"name": "funkrufname_schema",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"wehrfuehrer": {
|
|
"name": "wehrfuehrer",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"telefon": {
|
|
"name": "telefon",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"aktiv": {
|
|
"name": "aktiv",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"erstellt_am": {
|
|
"name": "erstellt_am",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"brigades_latlng_idx": {
|
|
"name": "brigades_latlng_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "lat",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "lng",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.users": {
|
|
"name": "users",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"brigade_id": {
|
|
"name": "brigade_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"rolle": {
|
|
"name": "rolle",
|
|
"type": "role",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"auth_typ": {
|
|
"name": "auth_typ",
|
|
"type": "auth_typ",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"passwort_hash": {
|
|
"name": "passwort_hash",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"aktiv": {
|
|
"name": "aktiv",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"erstellt_von": {
|
|
"name": "erstellt_von",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"erstellt_am": {
|
|
"name": "erstellt_am",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"users_brigade_id_brigades_id_fk": {
|
|
"name": "users_brigade_id_brigades_id_fk",
|
|
"tableFrom": "users",
|
|
"tableTo": "brigades",
|
|
"columnsFrom": [
|
|
"brigade_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"users_email_uq": {
|
|
"name": "users_email_uq",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"email"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.merkmal_optionen": {
|
|
"name": "merkmal_optionen",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"merkmal_id": {
|
|
"name": "merkmal_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"wert": {
|
|
"name": "wert",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"label": {
|
|
"name": "label",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"reihenfolge": {
|
|
"name": "reihenfolge",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
}
|
|
},
|
|
"indexes": {
|
|
"merkmal_optionen_merkmal_idx": {
|
|
"name": "merkmal_optionen_merkmal_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "merkmal_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"merkmal_optionen_merkmal_id_merkmale_id_fk": {
|
|
"name": "merkmal_optionen_merkmal_id_merkmale_id_fk",
|
|
"tableFrom": "merkmal_optionen",
|
|
"tableTo": "merkmale",
|
|
"columnsFrom": [
|
|
"merkmal_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"merkmal_optionen_uq": {
|
|
"name": "merkmal_optionen_uq",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"merkmal_id",
|
|
"wert"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.merkmale": {
|
|
"name": "merkmale",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"slug": {
|
|
"name": "slug",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"typ": {
|
|
"name": "typ",
|
|
"type": "merkmal_typ",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"einheit": {
|
|
"name": "einheit",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"geltungsbereich": {
|
|
"name": "geltungsbereich",
|
|
"type": "geltungsbereich",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "merkmal_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'proposed'"
|
|
},
|
|
"vorgeschlagen_von_brigade_id": {
|
|
"name": "vorgeschlagen_von_brigade_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"erstellt_am": {
|
|
"name": "erstellt_am",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"merkmale_status_idx": {
|
|
"name": "merkmale_status_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"merkmale_active_name_uq": {
|
|
"name": "merkmale_active_name_uq",
|
|
"columns": [
|
|
{
|
|
"expression": "name",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"where": "\"merkmale\".\"status\" = 'active'",
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"merkmale_vorgeschlagen_von_brigade_id_brigades_id_fk": {
|
|
"name": "merkmale_vorgeschlagen_von_brigade_id_brigades_id_fk",
|
|
"tableFrom": "merkmale",
|
|
"tableTo": "brigades",
|
|
"columnsFrom": [
|
|
"vorgeschlagen_von_brigade_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"merkmale_slug_uq": {
|
|
"name": "merkmale_slug_uq",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"slug"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.vehicle_template_aliasse": {
|
|
"name": "vehicle_template_aliasse",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"template_id": {
|
|
"name": "template_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"alias": {
|
|
"name": "alias",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"bestaetigt": {
|
|
"name": "bestaetigt",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"vehicle_template_aliasse_template_id_vehicle_templates_id_fk": {
|
|
"name": "vehicle_template_aliasse_template_id_vehicle_templates_id_fk",
|
|
"tableFrom": "vehicle_template_aliasse",
|
|
"tableTo": "vehicle_templates",
|
|
"columnsFrom": [
|
|
"template_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"vehicle_template_aliasse_uq": {
|
|
"name": "vehicle_template_aliasse_uq",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"template_id",
|
|
"alias"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.vehicle_template_merkmale": {
|
|
"name": "vehicle_template_merkmale",
|
|
"schema": "",
|
|
"columns": {
|
|
"template_id": {
|
|
"name": "template_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"merkmal_id": {
|
|
"name": "merkmal_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"vorgabewert_num": {
|
|
"name": "vorgabewert_num",
|
|
"type": "double precision",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"vorgabewert_text": {
|
|
"name": "vorgabewert_text",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"vorgabewert_bool": {
|
|
"name": "vorgabewert_bool",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"pflicht": {
|
|
"name": "pflicht",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"reihenfolge": {
|
|
"name": "reihenfolge",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
}
|
|
},
|
|
"indexes": {
|
|
"vtm_merkmal_idx": {
|
|
"name": "vtm_merkmal_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "merkmal_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"vehicle_template_merkmale_template_id_vehicle_templates_id_fk": {
|
|
"name": "vehicle_template_merkmale_template_id_vehicle_templates_id_fk",
|
|
"tableFrom": "vehicle_template_merkmale",
|
|
"tableTo": "vehicle_templates",
|
|
"columnsFrom": [
|
|
"template_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"vehicle_template_merkmale_merkmal_id_merkmale_id_fk": {
|
|
"name": "vehicle_template_merkmale_merkmal_id_merkmale_id_fk",
|
|
"tableFrom": "vehicle_template_merkmale",
|
|
"tableTo": "merkmale",
|
|
"columnsFrom": [
|
|
"merkmal_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"vehicle_template_merkmale_template_id_merkmal_id_pk": {
|
|
"name": "vehicle_template_merkmale_template_id_merkmal_id_pk",
|
|
"columns": [
|
|
"template_id",
|
|
"merkmal_id"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.vehicle_templates": {
|
|
"name": "vehicle_templates",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"code": {
|
|
"name": "code",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"beschreibung": {
|
|
"name": "beschreibung",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"reihenfolge": {
|
|
"name": "reihenfolge",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"vehicle_templates_code_uq": {
|
|
"name": "vehicle_templates_code_uq",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"code"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.equipment_categories": {
|
|
"name": "equipment_categories",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"reihenfolge": {
|
|
"name": "reihenfolge",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"equipment_categories_name_uq": {
|
|
"name": "equipment_categories_name_uq",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"name"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.equipment_category_merkmale": {
|
|
"name": "equipment_category_merkmale",
|
|
"schema": "",
|
|
"columns": {
|
|
"category_id": {
|
|
"name": "category_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"merkmal_id": {
|
|
"name": "merkmal_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"reihenfolge": {
|
|
"name": "reihenfolge",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
}
|
|
},
|
|
"indexes": {
|
|
"ecm_merkmal_idx": {
|
|
"name": "ecm_merkmal_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "merkmal_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"equipment_category_merkmale_category_id_equipment_categories_id_fk": {
|
|
"name": "equipment_category_merkmale_category_id_equipment_categories_id_fk",
|
|
"tableFrom": "equipment_category_merkmale",
|
|
"tableTo": "equipment_categories",
|
|
"columnsFrom": [
|
|
"category_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"equipment_category_merkmale_merkmal_id_merkmale_id_fk": {
|
|
"name": "equipment_category_merkmale_merkmal_id_merkmale_id_fk",
|
|
"tableFrom": "equipment_category_merkmale",
|
|
"tableTo": "merkmale",
|
|
"columnsFrom": [
|
|
"merkmal_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"equipment_category_merkmale_category_id_merkmal_id_pk": {
|
|
"name": "equipment_category_merkmale_category_id_merkmal_id_pk",
|
|
"columns": [
|
|
"category_id",
|
|
"merkmal_id"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.equipment": {
|
|
"name": "equipment",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"brigade_id": {
|
|
"name": "brigade_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"category_id": {
|
|
"name": "category_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"vehicle_id": {
|
|
"name": "vehicle_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "asset_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'einsatzbereit'"
|
|
},
|
|
"erstellt_am": {
|
|
"name": "erstellt_am",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"equipment_brigade_idx": {
|
|
"name": "equipment_brigade_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "brigade_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"equipment_category_idx": {
|
|
"name": "equipment_category_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "category_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"equipment_vehicle_idx": {
|
|
"name": "equipment_vehicle_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "vehicle_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"equipment_brigade_id_brigades_id_fk": {
|
|
"name": "equipment_brigade_id_brigades_id_fk",
|
|
"tableFrom": "equipment",
|
|
"tableTo": "brigades",
|
|
"columnsFrom": [
|
|
"brigade_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"equipment_category_id_equipment_categories_id_fk": {
|
|
"name": "equipment_category_id_equipment_categories_id_fk",
|
|
"tableFrom": "equipment",
|
|
"tableTo": "equipment_categories",
|
|
"columnsFrom": [
|
|
"category_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
},
|
|
"equipment_vehicle_id_vehicles_id_fk": {
|
|
"name": "equipment_vehicle_id_vehicles_id_fk",
|
|
"tableFrom": "equipment",
|
|
"tableTo": "vehicles",
|
|
"columnsFrom": [
|
|
"vehicle_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.vehicles": {
|
|
"name": "vehicles",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"brigade_id": {
|
|
"name": "brigade_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"template_id": {
|
|
"name": "template_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"funkrufname": {
|
|
"name": "funkrufname",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "asset_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'einsatzbereit'"
|
|
},
|
|
"notiz": {
|
|
"name": "notiz",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"erstellt_am": {
|
|
"name": "erstellt_am",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"vehicles_brigade_idx": {
|
|
"name": "vehicles_brigade_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "brigade_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"vehicles_template_idx": {
|
|
"name": "vehicles_template_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "template_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"vehicles_brigade_id_brigades_id_fk": {
|
|
"name": "vehicles_brigade_id_brigades_id_fk",
|
|
"tableFrom": "vehicles",
|
|
"tableTo": "brigades",
|
|
"columnsFrom": [
|
|
"brigade_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"vehicles_template_id_vehicle_templates_id_fk": {
|
|
"name": "vehicles_template_id_vehicle_templates_id_fk",
|
|
"tableFrom": "vehicles",
|
|
"tableTo": "vehicle_templates",
|
|
"columnsFrom": [
|
|
"template_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.merkmal_values": {
|
|
"name": "merkmal_values",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"merkmal_id": {
|
|
"name": "merkmal_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"entity_typ": {
|
|
"name": "entity_typ",
|
|
"type": "entity_typ",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"entity_id": {
|
|
"name": "entity_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"value_num": {
|
|
"name": "value_num",
|
|
"type": "double precision",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"value_text": {
|
|
"name": "value_text",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"value_bool": {
|
|
"name": "value_bool",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"mv_merkmal_num_idx": {
|
|
"name": "mv_merkmal_num_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "merkmal_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "value_num",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"mv_merkmal_bool_idx": {
|
|
"name": "mv_merkmal_bool_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "merkmal_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "value_bool",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"mv_merkmal_text_idx": {
|
|
"name": "mv_merkmal_text_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "merkmal_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "value_text",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"mv_entity_idx": {
|
|
"name": "mv_entity_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "entity_typ",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "entity_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"merkmal_values_merkmal_id_merkmale_id_fk": {
|
|
"name": "merkmal_values_merkmal_id_merkmale_id_fk",
|
|
"tableFrom": "merkmal_values",
|
|
"tableTo": "merkmale",
|
|
"columnsFrom": [
|
|
"merkmal_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.login_attempts": {
|
|
"name": "login_attempts",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"key": {
|
|
"name": "key",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"erfolg": {
|
|
"name": "erfolg",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"zeitpunkt": {
|
|
"name": "zeitpunkt",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"login_attempts_key_zeit_idx": {
|
|
"name": "login_attempts_key_zeit_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "key",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "zeitpunkt",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.audit_log": {
|
|
"name": "audit_log",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"actor_user_id": {
|
|
"name": "actor_user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"aktion": {
|
|
"name": "aktion",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"ziel_typ": {
|
|
"name": "ziel_typ",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"ziel_id": {
|
|
"name": "ziel_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"details": {
|
|
"name": "details",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"zeitpunkt": {
|
|
"name": "zeitpunkt",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"audit_log_zeitpunkt_idx": {
|
|
"name": "audit_log_zeitpunkt_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "zeitpunkt",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"audit_log_aktion_idx": {
|
|
"name": "audit_log_aktion_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "aktion",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"audit_log_actor_user_id_users_id_fk": {
|
|
"name": "audit_log_actor_user_id_users_id_fk",
|
|
"tableFrom": "audit_log",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"actor_user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
}
|
|
},
|
|
"enums": {
|
|
"public.asset_status": {
|
|
"name": "asset_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"einsatzbereit",
|
|
"wartung",
|
|
"ausser_dienst"
|
|
]
|
|
},
|
|
"public.auth_typ": {
|
|
"name": "auth_typ",
|
|
"schema": "public",
|
|
"values": [
|
|
"authentik",
|
|
"local"
|
|
]
|
|
},
|
|
"public.entity_typ": {
|
|
"name": "entity_typ",
|
|
"schema": "public",
|
|
"values": [
|
|
"vehicle",
|
|
"equipment"
|
|
]
|
|
},
|
|
"public.geltungsbereich": {
|
|
"name": "geltungsbereich",
|
|
"schema": "public",
|
|
"values": [
|
|
"vehicle",
|
|
"equipment",
|
|
"both"
|
|
]
|
|
},
|
|
"public.merkmal_status": {
|
|
"name": "merkmal_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"active",
|
|
"proposed"
|
|
]
|
|
},
|
|
"public.merkmal_typ": {
|
|
"name": "merkmal_typ",
|
|
"schema": "public",
|
|
"values": [
|
|
"number",
|
|
"enum",
|
|
"boolean",
|
|
"text"
|
|
]
|
|
},
|
|
"public.role": {
|
|
"name": "role",
|
|
"schema": "public",
|
|
"values": [
|
|
"platform_admin",
|
|
"wehr_admin",
|
|
"wehr_read"
|
|
]
|
|
}
|
|
},
|
|
"schemas": {},
|
|
"sequences": {},
|
|
"roles": {},
|
|
"policies": {},
|
|
"views": {},
|
|
"_meta": {
|
|
"columns": {},
|
|
"schemas": {},
|
|
"tables": {}
|
|
}
|
|
} |