mirror of
https://github.com/spl0k/supysonic.git
synced 2024-11-10 04:02:17 +00:00
14 lines
386 B
MySQL
14 lines
386 B
MySQL
|
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;
|
||
|
|