stash-box/pkg/database/migrations/postgres/4_image_tables.up.sql
InfiniteStash 0d9f46c6f1 Omnibus stashdb changes (#19)
* Add fuzzy performer/scene search
* Add frontend support for users
* Add support for tags and fingerprints
* Fingerprint duration and UI updates
* Add image entity for performers/scenes/studios
* Switch frontend to create-react-app and typescript 3.9
* Remove image fields from URL type
* Remove image fields from studio
* Fix bugs, and update frontend config/readme
* Add pg_trgm info
* Fix integration tests
* Create image url resolver and remove unused image fields
* Don't open browser by default
* Fix development auth cookie issues

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2020-06-25 13:40:09 +10:00

22 lines
514 B
SQL

CREATE TABLE images (
id uuid PRIMARY KEY,
url VARCHAR NOT NULL,
width INT,
height INT
);
CREATE TABLE scene_images (
scene_id uuid REFERENCES scenes(id) NOT NULL,
image_id uuid REFERENCES images(id) NOT NULL
);
CREATE TABLE performer_images (
performer_id uuid REFERENCES performers(id) NOT NULL,
image_id uuid REFERENCES images(id) NOT NULL
);
CREATE TABLE studio_images (
studio_id uuid REFERENCES studios(id) NOT NULL,
image_id uuid REFERENCES images(id) NOT NULL
);