feat(db): add object table

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-02 09:18:03 +02:00
parent bf332ac0ae
commit c1dda280e2
2 changed files with 30 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
-- Catalogue objects (the inventory-minimum core). One row = one object or a group.
CREATE TABLE object (
id UUID PRIMARY KEY,
object_number TEXT NOT NULL UNIQUE,
object_name TEXT NOT NULL,
number_of_objects INTEGER NOT NULL DEFAULT 1 CHECK (number_of_objects >= 1),
brief_description TEXT,
current_location TEXT,
current_owner TEXT,
recorder TEXT,
recording_date DATE,
visibility TEXT NOT NULL DEFAULT 'draft'
CHECK (visibility IN ('draft', 'internal', 'public')),
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX object_visibility_idx ON object (visibility);