Updated migration

Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
James Ketr 2020-01-05 21:18:27 -08:00
parent 2e2eb0a6c9
commit 0afbd32cbb

View File

@ -1 +1,10 @@
echo "alter table faces add column lastComparedId INTEGER;" | ./query.sh
cat << EOF | ./query.sh
pragma foreign_keys=off;
begin transaction;
alter table photos rename to photos_;
CREATE TABLE `photos` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` VARCHAR(255), `filename` VARCHAR(255), `added` DATETIME, `modified` DATETIME, `updated` DATETIME, `scanned` DATETIME, `taken` DATETIME, `width` INTEGER, `height` INTEGER, `size` INTEGER, `duplicate` TINYINT(1) DEFAULT 0, `deleted` TINYINT(1) DEFAULT 0, `albumId` INTEGER REFERENCES `albums` (`id`), `faces` INTEGER DEFAULT -1);
insert into photos (id,name,filename,added,modified,updated,scanned,taken,width,height,size,duplicate,deleted,albumId,faces) select id,name,filename,added,modified,updated,scanned,taken,width,height,size,duplicate,deleted,albumId,faces from photos_;
commit;
drop photos_;
pragma foreign_keys=on;
EOF