Commit 02a5b4e3 authored by Julien Muchembled's avatar Julien Muchembled

Add upgrade notes about MySQL/SQLite schema changes since NEO 1.3

parent 58774fb6
NEO 1.4
=======
The schema of `data` table in MySQL/SQLite backends has changed and there is
no transparent migration because the changes are optional and this table may
be huge. You can either use the following SQL commands to upgrade each storage,
or migrate data to new nodes with replication.
MySQL
-----
::
ALTER TABLE data
-- minor optimization
MODIFY value MEDIUMBLOB NOT NULL,
-- fix store of multiple values that only differ by the compression flag
DROP KEY hash, ADD UNIQUE (hash, compression);
SQLite
------
::
-- In SQLite, ALTER TABLE is limited so it's all or nothing
-- (here the added 'NOT NULL' on value column is cosmetic)
CREATE TABLE new_data (
id INTEGER PRIMARY KEY AUTOINCREMENT,
hash BLOB NOT NULL,
compression INTEGER NOT NULL,
value BLOB NOT NULL);
INSERT INTO new_data SELECT * FROM data;
CREATE UNIQUE INDEX IF NOT EXISTS _data_i1 ON new_data(hash, compression);
DROP TABLE data;
ALTER TABLE new_data RENAME TO data;
NEO 1.0 NEO 1.0
======= =======
......
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