- 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.
13 lines
386 B
SQL
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); |