mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-04 01:19:11 +00:00
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
10 lines
683 B
SQL
10 lines
683 B
SQL
-- Migrate all tables in database to use utf8 for better language support
|
|
ALTER TABLE access_token CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|
|
ALTER TABLE album CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|
|
ALTER TABLE photo CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|
|
ALTER TABLE photo_exif CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|
|
ALTER TABLE photo_url CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|
|
ALTER TABLE share_token CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|
|
ALTER TABLE site_info CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|
|
ALTER TABLE user CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|