1
Fork 0
Commit Graph

3 Commits

Author SHA1 Message Date
viktorstrate f2bcdf883f Update path hash database migrations 2020-06-30 15:35:45 +02:00
stz184 f88fa33e5f InnoDB has a maximum index length of 767 bytes for tables that use COMPACT or REDUNDANT row format, so for utf8mb3 or utf8mb4 columns, you can index a maximum of 255 or 191 characters, respectively.
That's why I created a new column storing a MD5 hash of the path and made it unique. The MD5 hash has only 32 characters and can be generated natively in MySQL and MariaDB. It helps us to avoid maximum key length and in the same time enforce unique photo and album paths.

- Added path_hash column to photo and album tables
- Added down migration file for 005_utf8_migration (just for consistency)
- Added PathHash field to Album and Photo struct
- album_scanner.go and photo_scanner.goo perform checks by MD5 hash now
2020-06-24 11:43:20 +03:00
viktorstrate 2f97dcff0c Improve scanner reliability 2020-02-27 16:26:53 +01:00
Renamed from api/database/migrations/0002_photo.up.sql (Browse further)