- 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.
19 lines
619 B
SQL
19 lines
619 B
SQL
CREATE TABLE albums (
|
|
id UUID PRIMARY KEY,
|
|
owner_id UUID NOT NULL REFERENCES users (id),
|
|
name TEXT NOT NULL,
|
|
description TEXT,
|
|
is_public BOOLEAN NOT NULL DEFAULT FALSE,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
);
|
|
|
|
CREATE TABLE album_media (
|
|
album_id UUID NOT NULL REFERENCES albums (id) ON DELETE CASCADE,
|
|
media_id UUID NOT NULL REFERENCES media (id) ON DELETE CASCADE,
|
|
PRIMARY KEY (album_id, media_id)
|
|
);
|
|
|
|
CREATE INDEX idx_albums_owner_id ON albums (owner_id);
|
|
|
|
CREATE INDEX idx_album_media_media_id ON album_media (media_id); |