ALTER TABLE wallabag_entry_tag DROP FOREIGN KEY FK_C9F0DD7CBA364942
ALTER TABLE wallabag_entry_tag DROP FOREIGN KEY FK_C9F0DD7CBAD26311
ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_entry_tag_entry FOREIGN KEY (entry_id) REFERENCES wallabag_entry (id) ON DELETE CASCADE
ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_entry_tag_tag FOREIGN KEY (tag_id) REFERENCES wallabag_tag (id) ON DELETE CASCADE
ALTER TABLE wallabag_annotation DROP FOREIGN KEY FK_A7AED006BA364942
ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_annotation_entry FOREIGN KEY (entry_id) REFERENCES wallabag_entry (id) ON DELETE CASCADE
Migration down
""""""""""""""
We didn't write down migration for ``20161001072726``.
PostgreSQL
^^^^^^^^^^
Migration up
""""""""""""
..code-block:: sql
ALTER TABLE wallabag_entry_tag DROP CONSTRAINT fk_c9f0dd7cba364942
ALTER TABLE wallabag_entry_tag DROP CONSTRAINT fk_c9f0dd7cbad26311
ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_entry_tag_entry FOREIGN KEY (entry_id) REFERENCES wallabag_entry (id) ON DELETE CASCADE
ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_entry_tag_tag FOREIGN KEY (tag_id) REFERENCES wallabag_tag (id) ON DELETE CASCADE
ALTER TABLE wallabag_annotation DROP CONSTRAINT fk_a7aed006ba364942
ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_annotation_entry FOREIGN KEY (entry_id) REFERENCES wallabag_entry (id) ON DELETE CASCADE
Migration down
""""""""""""""
We didn't write down migration for ``20161001072726``.
SQLite
^^^^^^
This migration can only be executed safely on MySQL or PostgreSQL.
Migration 20161022134138
------------------------
MySQL
^^^^^
Migration up
""""""""""""
..code-block:: sql
ALTER DATABASE wallabag CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
ALTER TABLE wallabag_user CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL;
ALTER TABLE wallabag_user CHANGE salt salt VARCHAR(180) NOT NULL;
ALTER TABLE wallabag_user CHANGE password password VARCHAR(180) NOT NULL;
ALTER TABLE wallabag_annotation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wallabag_entry CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wallabag_tag CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wallabag_user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wallabag_annotation CHANGE `text``text` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wallabag_annotation CHANGE `quote``quote` VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wallabag_entry CHANGE `title``title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wallabag_entry CHANGE `content``content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wallabag_tag CHANGE `label``label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wallabag_user CHANGE `name``name` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Migration down
""""""""""""""
..code-block:: sql
ALTER DATABASE wallabag CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;
ALTER TABLE wallabag_annotation CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wallabag_entry CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wallabag_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wallabag_user CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wallabag_annotation CHANGE `text``text` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wallabag_annotation CHANGE `quote``quote` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wallabag_entry CHANGE `title``title` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wallabag_entry CHANGE `content``content` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wallabag_tag CHANGE `label``label` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE wallabag_user CHANGE `name``name` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
PostgreSQL and SQLite
^^^^^^^^^^^^^^^^^^^^^
This migration only apply to MySQL.
Migration 20161024212538
------------------------
MySQL
^^^^^
Migration up
""""""""""""
..code-block:: sql
ALTER TABLE wallabag_oauth2_clients ADD user_id INT NOT NULL
ALTER TABLE wallabag_oauth2_clients ADD CONSTRAINT IDX_user_oauth_client FOREIGN KEY (user_id) REFERENCES wallabag_user (id) ON DELETE CASCADE
CREATE INDEX IDX_635D765EA76ED395 ON wallabag_oauth2_clients (user_id)
Migration down
""""""""""""""
..code-block:: sql
ALTER TABLE wallabag_oauth2_clients DROP FOREIGN KEY IDX_user_oauth_client
ALTER TABLE wallabag_oauth2_clients DROP user_id
PostgreSQL
^^^^^^^^^^
Migration up
""""""""""""
..code-block:: sql
ALTER TABLE wallabag_oauth2_clients ADD user_id INT DEFAULT NULL
ALTER TABLE wallabag_oauth2_clients ADD CONSTRAINT IDX_user_oauth_client FOREIGN KEY (user_id) REFERENCES wallabag_user (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE
CREATE INDEX IDX_635D765EA76ED395 ON wallabag_oauth2_clients (user_id)
Migration down
""""""""""""""
..code-block:: sql
ALTER TABLE wallabag_oauth2_clients DROP CONSTRAINT idx_user_oauth_client
ALTER TABLE wallabag_oauth2_clients DROP user_id
SQLite
^^^^^^
Migration up
""""""""""""
..code-block:: sql
CREATE TEMPORARY TABLE __temp__wallabag_oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types, name FROM wallabag_oauth2_clients
DROP TABLE wallabag_oauth2_clients
CREATE TABLE wallabag_oauth2_clients (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, random_id VARCHAR(255) NOT NULL COLLATE BINARY, redirect_uris CLOB NOT NULL COLLATE BINARY, secret VARCHAR(255) NOT NULL COLLATE BINARY, allowed_grant_types CLOB NOT NULL COLLATE BINARY, name CLOB DEFAULT NULL COLLATE BINARY, PRIMARY KEY(id), CONSTRAINT IDX_user_oauth_client FOREIGN KEY (user_id) REFERENCES wallabag_user (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)
INSERT INTO wallabag_oauth2_clients (id, random_id, redirect_uris, secret, allowed_grant_types, name) SELECT id, random_id, redirect_uris, secret, allowed_grant_types, name FROM __temp__wallabag_oauth2_clients
DROP TABLE __temp__wallabag_oauth2_clients
CREATE INDEX IDX_635D765EA76ED395 ON wallabag_oauth2_clients (user_id)
Migration down
""""""""""""""
..code-block:: sql
DROP INDEX IDX_635D765EA76ED395
CREATE TEMPORARY TABLE __temp__wallabag_oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types, name FROM wallabag_oauth2_clients
DROP TABLE wallabag_oauth2_clients
CREATE TABLE wallabag_oauth2_clients (id INTEGER NOT NULL, random_id VARCHAR(255) NOT NULL COLLATE BINARY, redirect_uris CLOB NOT NULL COLLATE BINARY, secret VARCHAR(255) NOT NULL COLLATE BINARY, allowed_grant_types CLOB NOT NULL COLLATE BINARY, name CLOB DEFAULT NULL COLLATE BINARY, PRIMARY KEY(id))
INSERT INTO wallabag_oauth2_clients (id, random_id, redirect_uris, secret, allowed_grant_types, name) SELECT id, random_id, redirect_uris, secret, allowed_grant_types, name FROM __temp__wallabag_oauth2_clients
DROP TABLE __temp__wallabag_oauth2_clients
Migration 20161031132655
------------------------
MySQL
^^^^^
Migration up
""""""""""""
..code-block:: sql
INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('download_images_enabled', 0, 'misc')
Migration down
""""""""""""""
..code-block:: sql
DELETE FROM wallabag_craue_config_setting WHERE name = 'download_images_enabled';
PostgreSQL
^^^^^^^^^^
Migration up
""""""""""""
..code-block:: sql
INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('download_images_enabled', 0, 'misc')
Migration down
""""""""""""""
..code-block:: sql
DELETE FROM wallabag_craue_config_setting WHERE name = 'download_images_enabled';
SQLite
^^^^^^
Migration up
""""""""""""
..code-block:: sql
INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('download_images_enabled', 0, 'misc')
Migration down
""""""""""""""
..code-block:: sql
DELETE FROM wallabag_craue_config_setting WHERE name = 'download_images_enabled';
Migration 20161104073720
------------------------
MySQL
^^^^^
Migration up
""""""""""""
..code-block:: sql
CREATE INDEX IDX_entry_created_at ON wallabag_entry (created_at)
Migration down
""""""""""""""
..code-block:: sql
DROP INDEX IDX_entry_created_at ON wallabag_entry
PostgreSQL
^^^^^^^^^^
Migration up
""""""""""""
..code-block:: sql
CREATE INDEX IDX_entry_created_at ON wallabag_entry (created_at)
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)