Commit 9e638d04 authored by Julien Muchembled's avatar Julien Muchembled

Fix upgrade of pt.state column

This is a follow up of commit 1f6bbcc1
("Rewrite (inside protocol, to make it standalone) a simpler Enum type"),
which renumbered values of CellStates enums.
parent fa8d75cb
......@@ -21,7 +21,7 @@ SQL commands to migrate each storage from NEO 0.10.x::
ALTER TABLE config MODIFY name VARBINARY(255) NOT NULL;
CREATE TEMPORARY TABLE uuid (new INT NOT NULL AUTO_INCREMENT PRIMARY KEY, old CHAR(32) NOT NULL, KEY (old)) ENGINE = InnoDB SELECT DISTINCT uuid as old FROM pt ORDER BY uuid;
ALTER TABLE pt DROP PRIMARY KEY, CHANGE uuid old CHAR(32) NOT NULL, ADD uuid INT NOT NULL after rid;
UPDATE pt, uuid SET pt.uuid=uuid.new WHERE pt.old=uuid.old;
UPDATE pt, uuid SET pt.uuid=uuid.new, state=state-1 WHERE pt.old=uuid.old;
ALTER TABLE pt DROP old, ADD PRIMARY KEY (rid, uuid);
UPDATE config, uuid SET config.value=uuid.new WHERE config.name='uuid' AND uuid.old=config.value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment