1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-11-10 04:02:17 +00:00
supysonic/schema/migration/20180317.mysql.sql

14 lines
386 B
MySQL
Raw Normal View History

START TRANSACTION;
ALTER TABLE folder ADD COLUMN path_hash BINARY(20) NOT NULL AFTER path;
ALTER TABLE track ADD COLUMN path_hash BINARY(20) NOT NULL AFTER path;
UPDATE folder SET path_hash=UNHEX(SHA1(path));
UPDATE track SET path_hash=UNHEX(SHA1(path));
CREATE UNIQUE INDEX index_folder_path ON folder(path_hash);
CREATE UNIQUE INDEX index_track_path ON track(path_hash);
COMMIT;