Make sure path hash is added consistently
The path_hash attribute is added after the path attribute, to make it consistent with `002_photo.up.sql`
This commit is contained in:
parent
f2bcdf883f
commit
b4bdd522dc
|
@ -14,7 +14,7 @@ IF NOT EXISTS( SELECT *
|
|||
ALTER TABLE photo DROP INDEX path;
|
||||
|
||||
-- Add path_hash and set it to the md5 hash based of the path attribute
|
||||
ALTER TABLE photo ADD path_hash varchar(32);
|
||||
ALTER TABLE photo ADD path_hash varchar(32) AFTER path;
|
||||
UPDATE photo p SET path_hash = md5(p.path);
|
||||
ALTER TABLE photo MODIFY path_hash varchar(32) NOT NULL UNIQUE;
|
||||
|
||||
|
@ -31,7 +31,7 @@ IF NOT EXISTS( SELECT *
|
|||
ALTER TABLE album DROP INDEX path;
|
||||
|
||||
-- Add path_hash and set it to the md5 hash based of the path attribute
|
||||
ALTER TABLE album ADD path_hash varchar(32);
|
||||
ALTER TABLE album ADD path_hash varchar(32) AFTER path;
|
||||
UPDATE album a SET path_hash = md5(a.path);
|
||||
ALTER TABLE album MODIFY path_hash varchar(32) NOT NULL UNIQUE;
|
||||
|
||||
|
|
Loading…
Reference in New Issue