X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=docs%2Fde%2Fuser%2Fquery-upgrade-21-22.rst;h=fa9835a813b46576b8fa3181a1d7ebf31bfccc92;hb=f17b89fadce0a8c2280fbe1518d66f20dddce59d;hp=cd201dc2c43fed0eb49cf7b71875f826ed08a480;hpb=78295b99dd1721c613f1ce52e2debbe6f6db7753;p=github%2Fwallabag%2Fwallabag.git diff --git a/docs/de/user/query-upgrade-21-22.rst b/docs/de/user/query-upgrade-21-22.rst index cd201dc2..fa9835a8 100644 --- a/docs/de/user/query-upgrade-21-22.rst +++ b/docs/de/user/query-upgrade-21-22.rst @@ -724,6 +724,111 @@ Migration down CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON wallabag_user (email_canonical) CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON wallabag_user (confirmation_token) +Migration 20161214094402 +------------------------ + +MySQL +^^^^^ + +Migration up +"""""""""""" + +.. code-block:: sql + + ALTER TABLE wallabag_entry CHANGE uuid uid VARCHAR(23) + +Migration down +"""""""""""""" + +.. code-block:: sql + + ALTER TABLE wallabag_entry CHANGE uid uuid VARCHAR(23) + +PostgreSQL +^^^^^^^^^^ + +Migration up +"""""""""""" + +.. code-block:: sql + + ALTER TABLE wallabag_entry RENAME uuid TO uid + +Migration down +"""""""""""""" + +.. code-block:: sql + + ALTER TABLE wallabag_entry RENAME uid TO uuid + +SQLite +^^^^^^ + +Migration up +"""""""""""" + +.. code-block:: sql + + CREATE TABLE __temp__wallabag_entry ( + id INTEGER NOT NULL, + user_id INTEGER DEFAULT NULL, + uid VARCHAR(23) DEFAULT NULL, + title CLOB DEFAULT NULL, + url CLOB DEFAULT NULL, + is_archived BOOLEAN NOT NULL, + is_starred BOOLEAN NOT NULL, + content CLOB DEFAULT NULL, + created_at DATETIME NOT NULL, + updated_at DATETIME NOT NULL, + mimetype CLOB DEFAULT NULL, + language CLOB DEFAULT NULL, + reading_time INTEGER DEFAULT NULL, + domain_name CLOB DEFAULT NULL, + preview_picture CLOB DEFAULT NULL, + is_public BOOLEAN DEFAULT '0', + http_status VARCHAR(3) DEFAULT NULL, + PRIMARY KEY(id) + ); + INSERT INTO __temp__wallabag_entry SELECT id,user_id,uuid,title,url,is_archived,is_starred,content,created_at,updated_at,mimetype,language,reading_time,domain_name,preview_picture,is_public,http_status FROM wallabag_entry; + DROP TABLE wallabag_entry; + ALTER TABLE __temp__wallabag_entry RENAME TO wallabag_entry + CREATE INDEX uid ON wallabag_entry (uid) + CREATE INDEX created_at ON wallabag_entry (created_at) + CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id) + + +Migration down +"""""""""""""" + +.. code-block:: sql + + CREATE TABLE __temp__wallabag_entry ( + id INTEGER NOT NULL, + user_id INTEGER DEFAULT NULL, + uuid VARCHAR(23) DEFAULT NULL, + title CLOB DEFAULT NULL, + url CLOB DEFAULT NULL, + is_archived BOOLEAN NOT NULL, + is_starred BOOLEAN NOT NULL, + content CLOB DEFAULT NULL, + created_at DATETIME NOT NULL, + updated_at DATETIME NOT NULL, + mimetype CLOB DEFAULT NULL, + language CLOB DEFAULT NULL, + reading_time INTEGER DEFAULT NULL, + domain_name CLOB DEFAULT NULL, + preview_picture CLOB DEFAULT NULL, + is_public BOOLEAN DEFAULT '0', + http_status VARCHAR(3) DEFAULT NULL, + PRIMARY KEY(id) + ); + INSERT INTO __temp__wallabag_entry SELECT id,user_id,uid,title,url,is_archived,is_starred,content,created_at,updated_at,mimetype,language,reading_time,domain_name,preview_picture,is_public,http_status FROM wallabag_entry; + DROP TABLE wallabag_entry; + ALTER TABLE __temp__wallabag_entry RENAME TO wallabag_entry + CREATE INDEX uid ON wallabag_entry (uid) + CREATE INDEX created_at ON wallabag_entry (created_at) + CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id) + Migration 20161214094403 ------------------------ @@ -795,3 +900,85 @@ Migration down DROP TABLE __temp__wallabag_entry CREATE INDEX created_at_idx ON wallabag_entry (created_at) CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id) + +Migration 20170127093841 +------------------------ + +MySQL +^^^^^ + +Migration up +"""""""""""" + +.. code-block:: sql + + CREATE INDEX IDX_entry_starred ON wallabag_entry (is_starred) + CREATE INDEX IDX_entry_archived ON wallabag_entry (is_archived) + +Migration down +"""""""""""""" + +.. code-block:: sql + + DROP INDEX IDX_entry_starred ON wallabag_entry + DROP INDEX IDX_entry_archived ON wallabag_entry + +PostgreSQL +^^^^^^^^^^ + +Migration up +"""""""""""" + +.. code-block:: sql + + CREATE INDEX IDX_entry_starred ON wallabag_entry (is_starred) + CREATE INDEX IDX_entry_archived ON wallabag_entry (is_archived) + +Migration down +"""""""""""""" + +.. code-block:: sql + + DROP INDEX IDX_entry_starred + DROP INDEX IDX_entry_archived + +SQLite +^^^^^^ + +Migration up +"""""""""""" + +.. code-block:: sql + + DROP INDEX uid + DROP INDEX created_at + DROP INDEX IDX_F4D18282A76ED395 + CREATE TEMPORARY TABLE __temp__wallabag_entry AS SELECT id, user_id, uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public, http_status FROM wallabag_entry + DROP TABLE wallabag_entry + CREATE TABLE wallabag_entry (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uid VARCHAR(23) DEFAULT NULL COLLATE BINARY, title CLOB DEFAULT NULL COLLATE BINARY, url CLOB DEFAULT NULL COLLATE BINARY, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL COLLATE BINARY, language CLOB DEFAULT NULL COLLATE BINARY, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL COLLATE BINARY, preview_picture CLOB DEFAULT NULL COLLATE BINARY, is_public BOOLEAN DEFAULT '0', http_status VARCHAR(3) DEFAULT NULL COLLATE BINARY, PRIMARY KEY(id)) + INSERT INTO wallabag_entry (id, user_id, uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public, http_status) SELECT id, user_id, uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public, http_status FROM __temp__wallabag_entry + DROP TABLE __temp__wallabag_entry + CREATE INDEX uid ON wallabag_entry (uid) + CREATE INDEX created_at ON wallabag_entry (created_at) + CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id) + CREATE INDEX IDX_entry_starred ON wallabag_entry (is_starred) + CREATE INDEX IDX_entry_archived ON wallabag_entry (is_archived) + +Migration down +"""""""""""""" + +.. code-block:: sql + + DROP INDEX IDX_entry_archived + DROP INDEX IDX_entry_starred + DROP INDEX IDX_F4D18282A76ED395 + DROP INDEX created_at + DROP INDEX uid + CREATE TEMPORARY TABLE __temp__wallabag_entry AS SELECT id, user_id, uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public, http_status FROM wallabag_entry + DROP TABLE wallabag_entry + CREATE TABLE wallabag_entry (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uid VARCHAR(23) DEFAULT NULL COLLATE BINARY, title CLOB DEFAULT NULL COLLATE BINARY, url CLOB DEFAULT NULL COLLATE BINARY, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL COLLATE BINARY, language CLOB DEFAULT NULL COLLATE BINARY, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL COLLATE BINARY, preview_picture CLOB DEFAULT NULL COLLATE BINARY, is_public BOOLEAN DEFAULT '0', http_status VARCHAR(3) DEFAULT NULL COLLATE BINARY, PRIMARY KEY(id)) + INSERT INTO wallabag_entry (id, user_id, uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public, http_status) SELECT id, user_id, uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public, http_status FROM __temp__wallabag_entry + DROP TABLE __temp__wallabag_entry + CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id) + CREATE INDEX created_at ON wallabag_entry (created_at) + CREATE INDEX uid ON wallabag_entry (uid)