Files
libertas/libertas_api/migrations/20251115093642_create_people_shares_table.sql
Gabriel Kaszewski 4675285603 feat: Implement person and tag management services
- Added `Person` and `Tag` models to the core library.
- Created `PersonService` and `TagService` traits with implementations for managing persons and tags.
- Introduced repositories for `Person`, `Tag`, `FaceRegion`, and `PersonShare` with PostgreSQL support.
- Updated authorization logic to include permissions for accessing and editing persons.
- Enhanced the schema to support new models and relationships.
- Implemented database migrations for new tables related to persons and tags.
- Added request and response structures for API interactions with persons and tags.
2025-11-15 11:18:11 +01:00

13 lines
386 B
SQL

CREATE TYPE person_permission AS ENUM (
'view',
'can_use'
);
CREATE TABLE person_shares (
person_id UUID NOT NULL REFERENCES people (id) ON DELETE CASCADE,
user_id UUID NOT NULL REFERENCES users (id) ON DELETE CASCADE,
permission person_permission NOT NULL,
PRIMARY KEY (person_id, user_id)
);
CREATE INDEX idx_person_shares_user_id ON person_shares (user_id);