feat(db): add object table
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user