aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/en/user
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2017-01-25 12:34:20 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2017-01-25 12:34:20 +0100
commit5d916d03afaec6fbe32d2a95624628096325744e (patch)
tree0795193b5b48780e0afe6749b3d319949a788f3b /docs/en/user
parentc8cd1660af52f9883143356020f9d0d57caee7a1 (diff)
downloadwallabag-5d916d03afaec6fbe32d2a95624628096325744e.tar.gz
wallabag-5d916d03afaec6fbe32d2a95624628096325744e.tar.zst
wallabag-5d916d03afaec6fbe32d2a95624628096325744e.zip
Moved queries in a separate file
Diffstat (limited to 'docs/en/user')
-rw-r--r--docs/en/user/query-upgrade-21-22.rst797
-rw-r--r--docs/en/user/upgrade.rst798
2 files changed, 798 insertions, 797 deletions
diff --git a/docs/en/user/query-upgrade-21-22.rst b/docs/en/user/query-upgrade-21-22.rst
new file mode 100644
index 00000000..cd201dc2
--- /dev/null
+++ b/docs/en/user/query-upgrade-21-22.rst
@@ -0,0 +1,797 @@
1Migration 20161001072726
2------------------------
3
4MySQL
5^^^^^
6
7Migration up
8""""""""""""
9
10.. code-block:: sql
11
12 ALTER TABLE wallabag_entry_tag DROP FOREIGN KEY FK_C9F0DD7CBA364942
13 ALTER TABLE wallabag_entry_tag DROP FOREIGN KEY FK_C9F0DD7CBAD26311
14 ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_entry_tag_entry FOREIGN KEY (entry_id) REFERENCES wallabag_entry (id) ON DELETE CASCADE
15 ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_entry_tag_tag FOREIGN KEY (tag_id) REFERENCES wallabag_tag (id) ON DELETE CASCADE
16 ALTER TABLE wallabag_annotation DROP FOREIGN KEY FK_A7AED006BA364942
17 ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_annotation_entry FOREIGN KEY (entry_id) REFERENCES wallabag_entry (id) ON DELETE CASCADE
18
19Migration down
20""""""""""""""
21
22We didn't write down migration for ``20161001072726``.
23
24PostgreSQL
25^^^^^^^^^^
26
27Migration up
28""""""""""""
29
30.. code-block:: sql
31
32 ALTER TABLE wallabag_entry_tag DROP CONSTRAINT fk_c9f0dd7cba364942
33 ALTER TABLE wallabag_entry_tag DROP CONSTRAINT fk_c9f0dd7cbad26311
34 ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_entry_tag_entry FOREIGN KEY (entry_id) REFERENCES wallabag_entry (id) ON DELETE CASCADE
35 ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_entry_tag_tag FOREIGN KEY (tag_id) REFERENCES wallabag_tag (id) ON DELETE CASCADE
36 ALTER TABLE wallabag_annotation DROP CONSTRAINT fk_a7aed006ba364942
37 ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_annotation_entry FOREIGN KEY (entry_id) REFERENCES wallabag_entry (id) ON DELETE CASCADE
38
39Migration down
40""""""""""""""
41
42We didn't write down migration for ``20161001072726``.
43
44SQLite
45^^^^^^
46
47This migration can only be executed safely on MySQL or PostgreSQL.
48
49Migration 20161022134138
50------------------------
51
52MySQL
53^^^^^
54
55Migration up
56""""""""""""
57
58.. code-block:: sql
59
60 ALTER DATABASE wallabag CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
61 ALTER TABLE wallabag_user CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL;
62 ALTER TABLE wallabag_user CHANGE salt salt VARCHAR(180) NOT NULL;
63 ALTER TABLE wallabag_user CHANGE password password VARCHAR(180) NOT NULL;
64 ALTER TABLE wallabag_annotation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
65 ALTER TABLE wallabag_entry CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
66 ALTER TABLE wallabag_tag CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
67 ALTER TABLE wallabag_user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
68 ALTER TABLE wallabag_annotation CHANGE `text` `text` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
69 ALTER TABLE wallabag_annotation CHANGE `quote` `quote` VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
70 ALTER TABLE wallabag_entry CHANGE `title` `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
71 ALTER TABLE wallabag_entry CHANGE `content` `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
72 ALTER TABLE wallabag_tag CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
73 ALTER TABLE wallabag_user CHANGE `name` `name` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
74
75Migration down
76""""""""""""""
77
78.. code-block:: sql
79
80 ALTER DATABASE wallabag CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;
81 ALTER TABLE wallabag_annotation CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
82 ALTER TABLE wallabag_entry CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
83 ALTER TABLE wallabag_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
84 ALTER TABLE wallabag_user CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
85 ALTER TABLE wallabag_annotation CHANGE `text` `text` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
86 ALTER TABLE wallabag_annotation CHANGE `quote` `quote` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
87 ALTER TABLE wallabag_entry CHANGE `title` `title` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
88 ALTER TABLE wallabag_entry CHANGE `content` `content` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
89 ALTER TABLE wallabag_tag CHANGE `label` `label` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
90 ALTER TABLE wallabag_user CHANGE `name` `name` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
91
92PostgreSQL and SQLite
93^^^^^^^^^^^^^^^^^^^^^
94
95This migration only apply to MySQL.
96
97Migration 20161024212538
98------------------------
99
100MySQL
101^^^^^
102
103Migration up
104""""""""""""
105
106.. code-block:: sql
107
108 ALTER TABLE wallabag_oauth2_clients ADD user_id INT NOT NULL
109 ALTER TABLE wallabag_oauth2_clients ADD CONSTRAINT IDX_user_oauth_client FOREIGN KEY (user_id) REFERENCES wallabag_user (id) ON DELETE CASCADE
110 CREATE INDEX IDX_635D765EA76ED395 ON wallabag_oauth2_clients (user_id)
111
112Migration down
113""""""""""""""
114
115.. code-block:: sql
116
117 ALTER TABLE wallabag_oauth2_clients DROP FOREIGN KEY IDX_user_oauth_client
118 ALTER TABLE wallabag_oauth2_clients DROP user_id
119
120PostgreSQL
121^^^^^^^^^^
122
123Migration up
124""""""""""""
125
126.. code-block:: sql
127
128 ALTER TABLE wallabag_oauth2_clients ADD user_id INT DEFAULT NULL
129 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
130 CREATE INDEX IDX_635D765EA76ED395 ON wallabag_oauth2_clients (user_id)
131
132
133Migration down
134""""""""""""""
135
136.. code-block:: sql
137
138 ALTER TABLE wallabag_oauth2_clients DROP CONSTRAINT idx_user_oauth_client
139 ALTER TABLE wallabag_oauth2_clients DROP user_id
140
141SQLite
142^^^^^^
143
144Migration up
145""""""""""""
146
147.. code-block:: sql
148
149 CREATE TEMPORARY TABLE __temp__wallabag_oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types, name FROM wallabag_oauth2_clients
150 DROP TABLE wallabag_oauth2_clients
151 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)
152 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
153 DROP TABLE __temp__wallabag_oauth2_clients
154 CREATE INDEX IDX_635D765EA76ED395 ON wallabag_oauth2_clients (user_id)
155
156Migration down
157""""""""""""""
158
159.. code-block:: sql
160
161 DROP INDEX IDX_635D765EA76ED395
162 CREATE TEMPORARY TABLE __temp__wallabag_oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types, name FROM wallabag_oauth2_clients
163 DROP TABLE wallabag_oauth2_clients
164 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))
165 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
166 DROP TABLE __temp__wallabag_oauth2_clients
167
168Migration 20161031132655
169------------------------
170
171MySQL
172^^^^^
173
174Migration up
175""""""""""""
176
177.. code-block:: sql
178
179 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('download_images_enabled', 0, 'misc')
180
181Migration down
182""""""""""""""
183
184.. code-block:: sql
185
186 DELETE FROM wallabag_craue_config_setting WHERE name = 'download_images_enabled';
187
188PostgreSQL
189^^^^^^^^^^
190
191Migration up
192""""""""""""
193
194.. code-block:: sql
195
196 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('download_images_enabled', 0, 'misc')
197
198Migration down
199""""""""""""""
200
201.. code-block:: sql
202
203 DELETE FROM wallabag_craue_config_setting WHERE name = 'download_images_enabled';
204
205SQLite
206^^^^^^
207
208Migration up
209""""""""""""
210
211.. code-block:: sql
212
213 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('download_images_enabled', 0, 'misc')
214
215Migration down
216""""""""""""""
217
218.. code-block:: sql
219
220 DELETE FROM wallabag_craue_config_setting WHERE name = 'download_images_enabled';
221
222Migration 20161104073720
223------------------------
224
225MySQL
226^^^^^
227
228Migration up
229""""""""""""
230
231.. code-block:: sql
232
233 CREATE INDEX IDX_entry_created_at ON wallabag_entry (created_at)
234
235Migration down
236""""""""""""""
237
238.. code-block:: sql
239
240 DROP INDEX IDX_entry_created_at ON wallabag_entry
241
242PostgreSQL
243^^^^^^^^^^
244
245Migration up
246""""""""""""
247
248.. code-block:: sql
249
250 CREATE INDEX IDX_entry_created_at ON wallabag_entry (created_at)
251
252Migration down
253""""""""""""""
254
255.. code-block:: sql
256
257 DROP INDEX idx_entry_created_at
258
259SQLite
260^^^^^^
261
262Migration up
263""""""""""""
264
265.. code-block:: sql
266
267 DROP INDEX created_at_idx
268 DROP INDEX IDX_F4D18282A76ED395
269 CREATE TEMPORARY TABLE __temp__wallabag_entry AS 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 FROM wallabag_entry
270 DROP TABLE wallabag_entry
271 CREATE TABLE wallabag_entry (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uuid CLOB 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', PRIMARY KEY(id))
272 INSERT INTO wallabag_entry (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) 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 FROM __temp__wallabag_entry
273 DROP TABLE __temp__wallabag_entry
274 CREATE INDEX created_at_idx ON wallabag_entry (created_at)
275 CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id)
276 CREATE INDEX IDX_entry_created_at ON wallabag_entry (created_at)
277
278Migration down
279""""""""""""""
280
281.. code-block:: sql
282
283 DROP INDEX IDX_entry_created_at
284 DROP INDEX IDX_F4D18282A76ED395
285 DROP INDEX created_at_idx
286 CREATE TEMPORARY TABLE __temp__wallabag_entry AS 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 FROM wallabag_entry
287 DROP TABLE wallabag_entry
288 CREATE TABLE wallabag_entry (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uuid CLOB 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', PRIMARY KEY(id))
289 INSERT INTO wallabag_entry (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) 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 FROM __temp__wallabag_entry
290 DROP TABLE __temp__wallabag_entry
291 CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id)
292 CREATE INDEX created_at_idx ON wallabag_entry (created_at)
293
294Migration 20161106113822
295------------------------
296
297MySQL
298^^^^^
299
300Migration up
301""""""""""""
302
303.. code-block:: sql
304
305 ALTER TABLE wallabag_config ADD action_mark_as_read INT DEFAULT 0
306
307Migration down
308""""""""""""""
309
310.. code-block:: sql
311
312 ALTER TABLE wallabag_config DROP action_mark_as_read
313
314PostgreSQL
315^^^^^^^^^^
316
317Migration up
318""""""""""""
319
320.. code-block:: sql
321
322 ALTER TABLE wallabag_config ADD action_mark_as_read INT DEFAULT 0
323
324Migration down
325""""""""""""""
326
327.. code-block:: sql
328
329 ALTER TABLE wallabag_config DROP action_mark_as_read
330
331SQLite
332^^^^^^
333
334Migration up
335""""""""""""
336
337.. code-block:: sql
338
339 ALTER TABLE wallabag_config ADD COLUMN action_mark_as_read INTEGER DEFAULT 0
340
341Migration down
342""""""""""""""
343
344.. code-block:: sql
345
346 DROP INDEX UNIQ_87E64C53A76ED395
347 CREATE TEMPORARY TABLE __temp__wallabag_config AS SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key FROM wallabag_config
348 DROP TABLE wallabag_config
349 CREATE TABLE wallabag_config (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, theme VARCHAR(255) NOT NULL COLLATE BINARY, items_per_page INTEGER NOT NULL, language VARCHAR(255) NOT NULL COLLATE BINARY, rss_token VARCHAR(255) DEFAULT NULL COLLATE BINARY, rss_limit INTEGER DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, pocket_consumer_key VARCHAR(255) DEFAULT NULL COLLATE BINARY, PRIMARY KEY(id))
350 INSERT INTO wallabag_config (id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key) SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key FROM __temp__wallabag_config
351 DROP TABLE __temp__wallabag_config
352 CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON wallabag_config (user_id)
353
354Migration 20161117071626
355------------------------
356
357MySQL
358^^^^^
359
360Migration up
361""""""""""""
362
363.. code-block:: sql
364
365 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('share_unmark', 0, 'entry')
366 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')
367
368Migration down
369""""""""""""""
370
371.. code-block:: sql
372
373 DELETE FROM wallabag_craue_config_setting WHERE name = 'share_unmark';
374 DELETE FROM wallabag_craue_config_setting WHERE name = 'unmark_url';
375
376PostgreSQL
377^^^^^^^^^^
378
379Migration up
380""""""""""""
381
382.. code-block:: sql
383
384 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('share_unmark', 0, 'entry')
385 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')
386
387Migration down
388""""""""""""""
389
390.. code-block:: sql
391
392 DELETE FROM wallabag_craue_config_setting WHERE name = 'share_unmark';
393 DELETE FROM wallabag_craue_config_setting WHERE name = 'unmark_url';
394
395SQLite
396^^^^^^
397
398Migration up
399""""""""""""
400
401.. code-block:: sql
402
403 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('share_unmark', 0, 'entry')
404 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')
405
406Migration down
407""""""""""""""
408
409.. code-block:: sql
410
411 DELETE FROM wallabag_craue_config_setting WHERE name = 'share_unmark';
412 DELETE FROM wallabag_craue_config_setting WHERE name = 'unmark_url';
413
414Migration 20161118134328
415------------------------
416
417MySQL
418^^^^^
419
420Migration up
421""""""""""""
422
423.. code-block:: sql
424
425 ALTER TABLE wallabag_entry ADD http_status VARCHAR(3) DEFAULT NULL
426
427Migration down
428""""""""""""""
429
430.. code-block:: sql
431
432 ALTER TABLE wallabag_entry DROP http_status
433
434PostgreSQL
435^^^^^^^^^^
436
437Migration up
438""""""""""""
439
440.. code-block:: sql
441
442 ALTER TABLE wallabag_entry ADD http_status VARCHAR(3) DEFAULT NULL
443
444Migration down
445""""""""""""""
446
447.. code-block:: sql
448
449 ALTER TABLE wallabag_entry DROP http_status
450
451SQLite
452^^^^^^
453
454Migration up
455""""""""""""
456
457.. code-block:: sql
458
459 ALTER TABLE wallabag_entry ADD COLUMN http_status VARCHAR(3) DEFAULT NULL
460
461Migration down
462""""""""""""""
463
464.. code-block:: sql
465
466 DROP INDEX created_at_idx
467 DROP INDEX IDX_F4D18282A76ED395
468 CREATE TEMPORARY TABLE __temp__wallabag_entry AS 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 FROM wallabag_entry
469 DROP TABLE wallabag_entry
470 CREATE TABLE wallabag_entry (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uuid CLOB 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', PRIMARY KEY(id))
471 INSERT INTO wallabag_entry (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) 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 FROM __temp__wallabag_entry
472 DROP TABLE __temp__wallabag_entry
473 CREATE INDEX created_at_idx ON wallabag_entry (created_at)
474 CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id)
475
476Migration 20161122144743
477------------------------
478
479MySQL
480^^^^^
481
482Migration up
483""""""""""""
484
485.. code-block:: sql
486
487 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('restricted_access', 0, 'entry')
488
489Migration down
490""""""""""""""
491
492.. code-block:: sql
493
494 DELETE FROM wallabag_craue_config_setting WHERE name = 'restricted_access';
495
496PostgreSQL
497^^^^^^^^^^
498
499Migration up
500""""""""""""
501
502.. code-block:: sql
503
504 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('restricted_access', 0, 'entry')
505
506Migration down
507""""""""""""""
508
509.. code-block:: sql
510
511 DELETE FROM wallabag_craue_config_setting WHERE name = 'restricted_access';
512
513SQLite
514^^^^^^
515
516Migration up
517""""""""""""
518
519.. code-block:: sql
520
521 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('restricted_access', 0, 'entry')
522
523Migration down
524""""""""""""""
525
526.. code-block:: sql
527
528 DELETE FROM wallabag_craue_config_setting WHERE name = 'restricted_access';
529
530Migration 20161122203647
531------------------------
532
533MySQL
534^^^^^
535
536Migration up
537""""""""""""
538
539.. code-block:: sql
540
541 ALTER TABLE wallabag_user DROP expired, DROP credentials_expired
542
543Migration down
544""""""""""""""
545
546.. code-block:: sql
547
548 ALTER TABLE wallabag_user ADD expired SMALLINT DEFAULT NULL, ADD credentials_expired SMALLINT DEFAULT NULL
549
550PostgreSQL
551^^^^^^^^^^
552
553Migration up
554""""""""""""
555
556.. code-block:: sql
557
558 ALTER TABLE wallabag_user DROP expired
559 ALTER TABLE wallabag_user DROP credentials_expired
560
561Migration down
562""""""""""""""
563
564.. code-block:: sql
565
566 ALTER TABLE wallabag_user ADD expired SMALLINT DEFAULT NULL
567 ALTER TABLE wallabag_user ADD credentials_expired SMALLINT DEFAULT NULL
568
569SQLite
570^^^^^^
571
572Migration up
573""""""""""""
574
575.. code-block:: sql
576
577 DROP INDEX UNIQ_1D63E7E5C05FB297
578 DROP INDEX UNIQ_1D63E7E5A0D96FBF
579 DROP INDEX UNIQ_1D63E7E592FC23A8
580 CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, locked, expires_at, confirmation_token, password_requested_at, roles, credentials_expire_at, name, created_at, updated_at, authCode, twoFactorAuthentication, trusted FROM wallabag_user
581 DROP TABLE wallabag_user
582 CREATE TABLE wallabag_user (id INTEGER NOT NULL, username VARCHAR(180) NOT NULL COLLATE BINARY, username_canonical VARCHAR(180) NOT NULL COLLATE BINARY, email VARCHAR(180) NOT NULL COLLATE BINARY, email_canonical VARCHAR(180) NOT NULL COLLATE BINARY, enabled BOOLEAN NOT NULL, salt VARCHAR(255) NOT NULL COLLATE BINARY, password VARCHAR(255) NOT NULL COLLATE BINARY, last_login DATETIME DEFAULT NULL, locked BOOLEAN NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL COLLATE BINARY, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL COLLATE BINARY, credentials_expire_at DATETIME DEFAULT NULL, name CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted CLOB DEFAULT NULL COLLATE BINARY, PRIMARY KEY(id))
583 INSERT INTO wallabag_user (id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, locked, expires_at, confirmation_token, password_requested_at, roles, credentials_expire_at, name, created_at, updated_at, authCode, twoFactorAuthentication, trusted) SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, locked, expires_at, confirmation_token, password_requested_at, roles, credentials_expire_at, name, created_at, updated_at, authCode, twoFactorAuthentication, trusted FROM __temp__wallabag_user
584 DROP TABLE __temp__wallabag_user
585 CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON wallabag_user (confirmation_token)
586 CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON wallabag_user (email_canonical)
587 CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON wallabag_user (username_canonical)
588
589Migration down
590""""""""""""""
591
592.. code-block:: sql
593
594 ALTER TABLE wallabag_user ADD COLUMN expired SMALLINT DEFAULT NULL
595 ALTER TABLE wallabag_user ADD COLUMN credentials_expired SMALLINT DEFAULT NULL
596
597Migration 20161128084725
598------------------------
599
600MySQL
601^^^^^
602
603Migration up
604""""""""""""
605
606.. code-block:: sql
607
608 ALTER TABLE wallabag_config ADD list_mode INT DEFAULT NULL
609
610Migration down
611""""""""""""""
612
613.. code-block:: sql
614
615 ALTER TABLE wallabag_config DROP list_mode
616
617PostgreSQL
618^^^^^^^^^^
619
620Migration up
621""""""""""""
622
623.. code-block:: sql
624
625 ALTER TABLE wallabag_config ADD list_mode INT DEFAULT NULL
626
627Migration down
628""""""""""""""
629
630.. code-block:: sql
631
632 ALTER TABLE wallabag_config DROP list_mode
633
634SQLite
635^^^^^^
636
637Migration up
638""""""""""""
639
640.. code-block:: sql
641
642 ALTER TABLE wallabag_config ADD COLUMN list_mode INTEGER DEFAULT NULL
643
644Migration down
645""""""""""""""
646
647.. code-block:: sql
648
649 DROP INDEX UNIQ_87E64C53A76ED395
650 CREATE TEMPORARY TABLE __temp__wallabag_config AS SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key FROM wallabag_config
651 DROP TABLE wallabag_config
652 CREATE TABLE wallabag_config (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, theme VARCHAR(255) NOT NULL COLLATE BINARY, items_per_page INTEGER NOT NULL, language VARCHAR(255) NOT NULL COLLATE BINARY, rss_token VARCHAR(255) DEFAULT NULL COLLATE BINARY, rss_limit INTEGER DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, pocket_consumer_key VARCHAR(255) DEFAULT NULL COLLATE BINARY, PRIMARY KEY(id))
653 INSERT INTO wallabag_config (id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key) SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key FROM __temp__wallabag_config
654 DROP TABLE __temp__wallabag_config
655 CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON wallabag_config (user_id)
656
657Migration 20161128131503
658------------------------
659
660MySQL
661^^^^^
662
663Migration up
664""""""""""""
665
666.. code-block:: sql
667
668 ALTER TABLE wallabag_user DROP locked, DROP credentials_expire_at, DROP expires_at
669
670Migration down
671""""""""""""""
672
673.. code-block:: sql
674
675 ALTER TABLE wallabag_user ADD locked SMALLINT DEFAULT NULL, ADD credentials_expire_at DATETIME DEFAULT NULL, ADD expires_at DATETIME DEFAULT NULL
676
677PostgreSQL
678^^^^^^^^^^
679
680Migration up
681""""""""""""
682
683.. code-block:: sql
684
685 ALTER TABLE wallabag_user DROP locked
686 ALTER TABLE wallabag_user DROP credentials_expire_at
687 ALTER TABLE wallabag_user DROP expires_at
688
689Migration down
690""""""""""""""
691
692.. code-block:: sql
693
694 ALTER TABLE wallabag_user ADD locked SMALLINT DEFAULT NULL
695 ALTER TABLE wallabag_user ADD credentials_expire_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL
696 ALTER TABLE wallabag_user ADD expires_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL
697
698SQLite
699^^^^^^
700
701Migration up
702""""""""""""
703
704.. code-block:: sql
705
706 ALTER TABLE wallabag_user ADD COLUMN locked SMALLINT DEFAULT NULL
707 ALTER TABLE wallabag_user ADD COLUMN credentials_expire_at DATETIME DEFAULT NULL
708 ALTER TABLE wallabag_user ADD COLUMN expires_at DATETIME DEFAULT NULL
709
710Migration down
711""""""""""""""
712
713.. code-block:: sql
714
715 DROP INDEX UNIQ_1D63E7E592FC23A8
716 DROP INDEX UNIQ_1D63E7E5A0D96FBF
717 DROP INDEX UNIQ_1D63E7E5C05FB297
718 CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, twoFactorAuthentication, trusted, expired, credentials_expired FROM wallabag_user
719 DROP TABLE wallabag_user
720 CREATE TABLE wallabag_user (id INTEGER NOT NULL, username VARCHAR(180) NOT NULL COLLATE BINARY, username_canonical VARCHAR(180) NOT NULL COLLATE BINARY, email VARCHAR(180) NOT NULL COLLATE BINARY, email_canonical VARCHAR(180) NOT NULL COLLATE BINARY, enabled BOOLEAN NOT NULL, salt VARCHAR(255) NOT NULL COLLATE BINARY, password VARCHAR(255) NOT NULL COLLATE BINARY, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL COLLATE BINARY, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL COLLATE BINARY, name CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted CLOB DEFAULT NULL COLLATE BINARY, expired SMALLINT DEFAULT NULL, credentials_expired SMALLINT DEFAULT NULL, PRIMARY KEY(id))
721 INSERT INTO wallabag_user (id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, twoFactorAuthentication, trusted, expired, credentials_expired) SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, twoFactorAuthentication, trusted, expired, credentials_expired FROM __temp__wallabag_user
722 DROP TABLE __temp__wallabag_user
723 CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON wallabag_user (username_canonical)
724 CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON wallabag_user (email_canonical)
725 CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON wallabag_user (confirmation_token)
726
727Migration 20161214094403
728------------------------
729
730MySQL
731^^^^^
732
733Migration up
734""""""""""""
735
736.. code-block:: sql
737
738 CREATE INDEX IDX_entry_uid ON wallabag_entry (uid)
739
740Migration down
741""""""""""""""
742
743.. code-block:: sql
744
745 DROP INDEX IDX_entry_uid ON wallabag_entry
746
747PostgreSQL
748^^^^^^^^^^
749
750Migration up
751""""""""""""
752
753.. code-block:: sql
754
755 CREATE INDEX IDX_entry_uid ON wallabag_entry (uid)
756
757Migration down
758""""""""""""""
759
760.. code-block:: sql
761
762 DROP INDEX idx_entry_uid
763
764SQLite
765^^^^^^
766
767Migration up
768""""""""""""
769
770.. code-block:: sql
771
772 DROP INDEX IDX_F4D18282A76ED395
773 DROP INDEX created_at_idx
774 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 FROM wallabag_entry
775 DROP TABLE wallabag_entry
776 CREATE TABLE wallabag_entry (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uid CLOB 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', PRIMARY KEY(id))
777 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) 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 FROM __temp__wallabag_entry
778 DROP TABLE __temp__wallabag_entry
779 CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id)
780 CREATE INDEX created_at_idx ON wallabag_entry (created_at)
781 CREATE INDEX IDX_entry_uid ON wallabag_entry (uid)
782
783Migration down
784""""""""""""""
785
786.. code-block:: sql
787
788 DROP INDEX IDX_entry_uid
789 DROP INDEX created_at_idx
790 DROP INDEX IDX_F4D18282A76ED395
791 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 FROM wallabag_entry
792 DROP TABLE wallabag_entry
793 CREATE TABLE wallabag_entry (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uid CLOB 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', PRIMARY KEY(id))
794 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) 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 FROM __temp__wallabag_entry
795 DROP TABLE __temp__wallabag_entry
796 CREATE INDEX created_at_idx ON wallabag_entry (created_at)
797 CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id)
diff --git a/docs/en/user/upgrade.rst b/docs/en/user/upgrade.rst
index b3972bce..99260e13 100644
--- a/docs/en/user/upgrade.rst
+++ b/docs/en/user/upgrade.rst
@@ -70,803 +70,7 @@ You must run some SQL queries to upgrade your database. We assume that the table
70 70
71You may encounter issues with indexes names: if so, please change queries with the correct index name. 71You may encounter issues with indexes names: if so, please change queries with the correct index name.
72 72
73Migration 20161001072726 73`You can find all the queries here <http://doc.wallabag.org/en/master/user/query-upgrade-21-22.html>`_.
74------------------------
75
76MySQL
77^^^^^
78
79Migration up
80""""""""""""
81
82.. code-block:: sql
83
84 ALTER TABLE wallabag_entry_tag DROP FOREIGN KEY FK_C9F0DD7CBA364942
85 ALTER TABLE wallabag_entry_tag DROP FOREIGN KEY FK_C9F0DD7CBAD26311
86 ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_entry_tag_entry FOREIGN KEY (entry_id) REFERENCES wallabag_entry (id) ON DELETE CASCADE
87 ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_entry_tag_tag FOREIGN KEY (tag_id) REFERENCES wallabag_tag (id) ON DELETE CASCADE
88 ALTER TABLE wallabag_annotation DROP FOREIGN KEY FK_A7AED006BA364942
89 ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_annotation_entry FOREIGN KEY (entry_id) REFERENCES wallabag_entry (id) ON DELETE CASCADE
90
91Migration down
92""""""""""""""
93
94We didn't write down migration for ``20161001072726``.
95
96PostgreSQL
97^^^^^^^^^^
98
99Migration up
100""""""""""""
101
102.. code-block:: sql
103
104 ALTER TABLE wallabag_entry_tag DROP CONSTRAINT fk_c9f0dd7cba364942
105 ALTER TABLE wallabag_entry_tag DROP CONSTRAINT fk_c9f0dd7cbad26311
106 ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_entry_tag_entry FOREIGN KEY (entry_id) REFERENCES wallabag_entry (id) ON DELETE CASCADE
107 ALTER TABLE wallabag_entry_tag ADD CONSTRAINT FK_entry_tag_tag FOREIGN KEY (tag_id) REFERENCES wallabag_tag (id) ON DELETE CASCADE
108 ALTER TABLE wallabag_annotation DROP CONSTRAINT fk_a7aed006ba364942
109 ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_annotation_entry FOREIGN KEY (entry_id) REFERENCES wallabag_entry (id) ON DELETE CASCADE
110
111Migration down
112""""""""""""""
113
114We didn't write down migration for ``20161001072726``.
115
116SQLite
117^^^^^^
118
119This migration can only be executed safely on MySQL or PostgreSQL.
120
121Migration 20161022134138
122------------------------
123
124MySQL
125^^^^^
126
127Migration up
128""""""""""""
129
130.. code-block:: sql
131
132 ALTER DATABASE wallabag CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
133 ALTER TABLE wallabag_user CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL;
134 ALTER TABLE wallabag_user CHANGE salt salt VARCHAR(180) NOT NULL;
135 ALTER TABLE wallabag_user CHANGE password password VARCHAR(180) NOT NULL;
136 ALTER TABLE wallabag_annotation CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
137 ALTER TABLE wallabag_entry CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
138 ALTER TABLE wallabag_tag CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
139 ALTER TABLE wallabag_user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
140 ALTER TABLE wallabag_annotation CHANGE `text` `text` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
141 ALTER TABLE wallabag_annotation CHANGE `quote` `quote` VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
142 ALTER TABLE wallabag_entry CHANGE `title` `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
143 ALTER TABLE wallabag_entry CHANGE `content` `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
144 ALTER TABLE wallabag_tag CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
145 ALTER TABLE wallabag_user CHANGE `name` `name` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
146
147Migration down
148""""""""""""""
149
150.. code-block:: sql
151
152 ALTER DATABASE wallabag CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;
153 ALTER TABLE wallabag_annotation CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
154 ALTER TABLE wallabag_entry CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
155 ALTER TABLE wallabag_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
156 ALTER TABLE wallabag_user CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
157 ALTER TABLE wallabag_annotation CHANGE `text` `text` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
158 ALTER TABLE wallabag_annotation CHANGE `quote` `quote` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
159 ALTER TABLE wallabag_entry CHANGE `title` `title` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
160 ALTER TABLE wallabag_entry CHANGE `content` `content` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
161 ALTER TABLE wallabag_tag CHANGE `label` `label` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
162 ALTER TABLE wallabag_user CHANGE `name` `name` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;
163
164PostgreSQL and SQLite
165^^^^^^^^^^^^^^^^^^^^^
166
167This migration only apply to MySQL.
168
169Migration 20161024212538
170------------------------
171
172MySQL
173^^^^^
174
175Migration up
176""""""""""""
177
178.. code-block:: sql
179
180 ALTER TABLE wallabag_oauth2_clients ADD user_id INT NOT NULL
181 ALTER TABLE wallabag_oauth2_clients ADD CONSTRAINT IDX_user_oauth_client FOREIGN KEY (user_id) REFERENCES wallabag_user (id) ON DELETE CASCADE
182 CREATE INDEX IDX_635D765EA76ED395 ON wallabag_oauth2_clients (user_id)
183
184Migration down
185""""""""""""""
186
187.. code-block:: sql
188
189 ALTER TABLE wallabag_oauth2_clients DROP FOREIGN KEY IDX_user_oauth_client
190 ALTER TABLE wallabag_oauth2_clients DROP user_id
191
192PostgreSQL
193^^^^^^^^^^
194
195Migration up
196""""""""""""
197
198.. code-block:: sql
199
200 ALTER TABLE wallabag_oauth2_clients ADD user_id INT DEFAULT NULL
201 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
202 CREATE INDEX IDX_635D765EA76ED395 ON wallabag_oauth2_clients (user_id)
203
204
205Migration down
206""""""""""""""
207
208.. code-block:: sql
209
210 ALTER TABLE wallabag_oauth2_clients DROP CONSTRAINT idx_user_oauth_client
211 ALTER TABLE wallabag_oauth2_clients DROP user_id
212
213SQLite
214^^^^^^
215
216Migration up
217""""""""""""
218
219.. code-block:: sql
220
221 CREATE TEMPORARY TABLE __temp__wallabag_oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types, name FROM wallabag_oauth2_clients
222 DROP TABLE wallabag_oauth2_clients
223 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)
224 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
225 DROP TABLE __temp__wallabag_oauth2_clients
226 CREATE INDEX IDX_635D765EA76ED395 ON wallabag_oauth2_clients (user_id)
227
228Migration down
229""""""""""""""
230
231.. code-block:: sql
232
233 DROP INDEX IDX_635D765EA76ED395
234 CREATE TEMPORARY TABLE __temp__wallabag_oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types, name FROM wallabag_oauth2_clients
235 DROP TABLE wallabag_oauth2_clients
236 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))
237 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
238 DROP TABLE __temp__wallabag_oauth2_clients
239
240Migration 20161031132655
241------------------------
242
243MySQL
244^^^^^
245
246Migration up
247""""""""""""
248
249.. code-block:: sql
250
251 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('download_images_enabled', 0, 'misc')
252
253Migration down
254""""""""""""""
255
256.. code-block:: sql
257
258 DELETE FROM wallabag_craue_config_setting WHERE name = 'download_images_enabled';
259
260PostgreSQL
261^^^^^^^^^^
262
263Migration up
264""""""""""""
265
266.. code-block:: sql
267
268 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('download_images_enabled', 0, 'misc')
269
270Migration down
271""""""""""""""
272
273.. code-block:: sql
274
275 DELETE FROM wallabag_craue_config_setting WHERE name = 'download_images_enabled';
276
277SQLite
278^^^^^^
279
280Migration up
281""""""""""""
282
283.. code-block:: sql
284
285 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('download_images_enabled', 0, 'misc')
286
287Migration down
288""""""""""""""
289
290.. code-block:: sql
291
292 DELETE FROM wallabag_craue_config_setting WHERE name = 'download_images_enabled';
293
294Migration 20161104073720
295------------------------
296
297MySQL
298^^^^^
299
300Migration up
301""""""""""""
302
303.. code-block:: sql
304
305 CREATE INDEX IDX_entry_created_at ON wallabag_entry (created_at)
306
307Migration down
308""""""""""""""
309
310.. code-block:: sql
311
312 DROP INDEX IDX_entry_created_at ON wallabag_entry
313
314PostgreSQL
315^^^^^^^^^^
316
317Migration up
318""""""""""""
319
320.. code-block:: sql
321
322 CREATE INDEX IDX_entry_created_at ON wallabag_entry (created_at)
323
324Migration down
325""""""""""""""
326
327.. code-block:: sql
328
329 DROP INDEX idx_entry_created_at
330
331SQLite
332^^^^^^
333
334Migration up
335""""""""""""
336
337.. code-block:: sql
338
339 DROP INDEX created_at_idx
340 DROP INDEX IDX_F4D18282A76ED395
341 CREATE TEMPORARY TABLE __temp__wallabag_entry AS 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 FROM wallabag_entry
342 DROP TABLE wallabag_entry
343 CREATE TABLE wallabag_entry (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uuid CLOB 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', PRIMARY KEY(id))
344 INSERT INTO wallabag_entry (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) 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 FROM __temp__wallabag_entry
345 DROP TABLE __temp__wallabag_entry
346 CREATE INDEX created_at_idx ON wallabag_entry (created_at)
347 CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id)
348 CREATE INDEX IDX_entry_created_at ON wallabag_entry (created_at)
349
350Migration down
351""""""""""""""
352
353.. code-block:: sql
354
355 DROP INDEX IDX_entry_created_at
356 DROP INDEX IDX_F4D18282A76ED395
357 DROP INDEX created_at_idx
358 CREATE TEMPORARY TABLE __temp__wallabag_entry AS 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 FROM wallabag_entry
359 DROP TABLE wallabag_entry
360 CREATE TABLE wallabag_entry (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uuid CLOB 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', PRIMARY KEY(id))
361 INSERT INTO wallabag_entry (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) 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 FROM __temp__wallabag_entry
362 DROP TABLE __temp__wallabag_entry
363 CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id)
364 CREATE INDEX created_at_idx ON wallabag_entry (created_at)
365
366Migration 20161106113822
367------------------------
368
369MySQL
370^^^^^
371
372Migration up
373""""""""""""
374
375.. code-block:: sql
376
377 ALTER TABLE wallabag_config ADD action_mark_as_read INT DEFAULT 0
378
379Migration down
380""""""""""""""
381
382.. code-block:: sql
383
384 ALTER TABLE wallabag_config DROP action_mark_as_read
385
386PostgreSQL
387^^^^^^^^^^
388
389Migration up
390""""""""""""
391
392.. code-block:: sql
393
394 ALTER TABLE wallabag_config ADD action_mark_as_read INT DEFAULT 0
395
396Migration down
397""""""""""""""
398
399.. code-block:: sql
400
401 ALTER TABLE wallabag_config DROP action_mark_as_read
402
403SQLite
404^^^^^^
405
406Migration up
407""""""""""""
408
409.. code-block:: sql
410
411 ALTER TABLE wallabag_config ADD COLUMN action_mark_as_read INTEGER DEFAULT 0
412
413Migration down
414""""""""""""""
415
416.. code-block:: sql
417
418 DROP INDEX UNIQ_87E64C53A76ED395
419 CREATE TEMPORARY TABLE __temp__wallabag_config AS SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key FROM wallabag_config
420 DROP TABLE wallabag_config
421 CREATE TABLE wallabag_config (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, theme VARCHAR(255) NOT NULL COLLATE BINARY, items_per_page INTEGER NOT NULL, language VARCHAR(255) NOT NULL COLLATE BINARY, rss_token VARCHAR(255) DEFAULT NULL COLLATE BINARY, rss_limit INTEGER DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, pocket_consumer_key VARCHAR(255) DEFAULT NULL COLLATE BINARY, PRIMARY KEY(id))
422 INSERT INTO wallabag_config (id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key) SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key FROM __temp__wallabag_config
423 DROP TABLE __temp__wallabag_config
424 CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON wallabag_config (user_id)
425
426Migration 20161117071626
427------------------------
428
429MySQL
430^^^^^
431
432Migration up
433""""""""""""
434
435.. code-block:: sql
436
437 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('share_unmark', 0, 'entry')
438 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')
439
440Migration down
441""""""""""""""
442
443.. code-block:: sql
444
445 DELETE FROM wallabag_craue_config_setting WHERE name = 'share_unmark';
446 DELETE FROM wallabag_craue_config_setting WHERE name = 'unmark_url';
447
448PostgreSQL
449^^^^^^^^^^
450
451Migration up
452""""""""""""
453
454.. code-block:: sql
455
456 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('share_unmark', 0, 'entry')
457 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')
458
459Migration down
460""""""""""""""
461
462.. code-block:: sql
463
464 DELETE FROM wallabag_craue_config_setting WHERE name = 'share_unmark';
465 DELETE FROM wallabag_craue_config_setting WHERE name = 'unmark_url';
466
467SQLite
468^^^^^^
469
470Migration up
471""""""""""""
472
473.. code-block:: sql
474
475 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('share_unmark', 0, 'entry')
476 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')
477
478Migration down
479""""""""""""""
480
481.. code-block:: sql
482
483 DELETE FROM wallabag_craue_config_setting WHERE name = 'share_unmark';
484 DELETE FROM wallabag_craue_config_setting WHERE name = 'unmark_url';
485
486Migration 20161118134328
487------------------------
488
489MySQL
490^^^^^
491
492Migration up
493""""""""""""
494
495.. code-block:: sql
496
497 ALTER TABLE wallabag_entry ADD http_status VARCHAR(3) DEFAULT NULL
498
499Migration down
500""""""""""""""
501
502.. code-block:: sql
503
504 ALTER TABLE wallabag_entry DROP http_status
505
506PostgreSQL
507^^^^^^^^^^
508
509Migration up
510""""""""""""
511
512.. code-block:: sql
513
514 ALTER TABLE wallabag_entry ADD http_status VARCHAR(3) DEFAULT NULL
515
516Migration down
517""""""""""""""
518
519.. code-block:: sql
520
521 ALTER TABLE wallabag_entry DROP http_status
522
523SQLite
524^^^^^^
525
526Migration up
527""""""""""""
528
529.. code-block:: sql
530
531 ALTER TABLE wallabag_entry ADD COLUMN http_status VARCHAR(3) DEFAULT NULL
532
533Migration down
534""""""""""""""
535
536.. code-block:: sql
537
538 DROP INDEX created_at_idx
539 DROP INDEX IDX_F4D18282A76ED395
540 CREATE TEMPORARY TABLE __temp__wallabag_entry AS 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 FROM wallabag_entry
541 DROP TABLE wallabag_entry
542 CREATE TABLE wallabag_entry (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uuid CLOB 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', PRIMARY KEY(id))
543 INSERT INTO wallabag_entry (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) 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 FROM __temp__wallabag_entry
544 DROP TABLE __temp__wallabag_entry
545 CREATE INDEX created_at_idx ON wallabag_entry (created_at)
546 CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id)
547
548Migration 20161122144743
549------------------------
550
551MySQL
552^^^^^
553
554Migration up
555""""""""""""
556
557.. code-block:: sql
558
559 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('restricted_access', 0, 'entry')
560
561Migration down
562""""""""""""""
563
564.. code-block:: sql
565
566 DELETE FROM wallabag_craue_config_setting WHERE name = 'restricted_access';
567
568PostgreSQL
569^^^^^^^^^^
570
571Migration up
572""""""""""""
573
574.. code-block:: sql
575
576 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('restricted_access', 0, 'entry')
577
578Migration down
579""""""""""""""
580
581.. code-block:: sql
582
583 DELETE FROM wallabag_craue_config_setting WHERE name = 'restricted_access';
584
585SQLite
586^^^^^^
587
588Migration up
589""""""""""""
590
591.. code-block:: sql
592
593 INSERT INTO wallabag_craue_config_setting (name, value, section) VALUES ('restricted_access', 0, 'entry')
594
595Migration down
596""""""""""""""
597
598.. code-block:: sql
599
600 DELETE FROM wallabag_craue_config_setting WHERE name = 'restricted_access';
601
602Migration 20161122203647
603------------------------
604
605MySQL
606^^^^^
607
608Migration up
609""""""""""""
610
611.. code-block:: sql
612
613 ALTER TABLE wallabag_user DROP expired, DROP credentials_expired
614
615Migration down
616""""""""""""""
617
618.. code-block:: sql
619
620 ALTER TABLE wallabag_user ADD expired SMALLINT DEFAULT NULL, ADD credentials_expired SMALLINT DEFAULT NULL
621
622PostgreSQL
623^^^^^^^^^^
624
625Migration up
626""""""""""""
627
628.. code-block:: sql
629
630 ALTER TABLE wallabag_user DROP expired
631 ALTER TABLE wallabag_user DROP credentials_expired
632
633Migration down
634""""""""""""""
635
636.. code-block:: sql
637
638 ALTER TABLE wallabag_user ADD expired SMALLINT DEFAULT NULL
639 ALTER TABLE wallabag_user ADD credentials_expired SMALLINT DEFAULT NULL
640
641SQLite
642^^^^^^
643
644Migration up
645""""""""""""
646
647.. code-block:: sql
648
649 DROP INDEX UNIQ_1D63E7E5C05FB297
650 DROP INDEX UNIQ_1D63E7E5A0D96FBF
651 DROP INDEX UNIQ_1D63E7E592FC23A8
652 CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, locked, expires_at, confirmation_token, password_requested_at, roles, credentials_expire_at, name, created_at, updated_at, authCode, twoFactorAuthentication, trusted FROM wallabag_user
653 DROP TABLE wallabag_user
654 CREATE TABLE wallabag_user (id INTEGER NOT NULL, username VARCHAR(180) NOT NULL COLLATE BINARY, username_canonical VARCHAR(180) NOT NULL COLLATE BINARY, email VARCHAR(180) NOT NULL COLLATE BINARY, email_canonical VARCHAR(180) NOT NULL COLLATE BINARY, enabled BOOLEAN NOT NULL, salt VARCHAR(255) NOT NULL COLLATE BINARY, password VARCHAR(255) NOT NULL COLLATE BINARY, last_login DATETIME DEFAULT NULL, locked BOOLEAN NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL COLLATE BINARY, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL COLLATE BINARY, credentials_expire_at DATETIME DEFAULT NULL, name CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted CLOB DEFAULT NULL COLLATE BINARY, PRIMARY KEY(id))
655 INSERT INTO wallabag_user (id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, locked, expires_at, confirmation_token, password_requested_at, roles, credentials_expire_at, name, created_at, updated_at, authCode, twoFactorAuthentication, trusted) SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, locked, expires_at, confirmation_token, password_requested_at, roles, credentials_expire_at, name, created_at, updated_at, authCode, twoFactorAuthentication, trusted FROM __temp__wallabag_user
656 DROP TABLE __temp__wallabag_user
657 CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON wallabag_user (confirmation_token)
658 CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON wallabag_user (email_canonical)
659 CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON wallabag_user (username_canonical)
660
661Migration down
662""""""""""""""
663
664.. code-block:: sql
665
666 ALTER TABLE wallabag_user ADD COLUMN expired SMALLINT DEFAULT NULL
667 ALTER TABLE wallabag_user ADD COLUMN credentials_expired SMALLINT DEFAULT NULL
668
669Migration 20161128084725
670------------------------
671
672MySQL
673^^^^^
674
675Migration up
676""""""""""""
677
678.. code-block:: sql
679
680 ALTER TABLE wallabag_config ADD list_mode INT DEFAULT NULL
681
682Migration down
683""""""""""""""
684
685.. code-block:: sql
686
687 ALTER TABLE wallabag_config DROP list_mode
688
689PostgreSQL
690^^^^^^^^^^
691
692Migration up
693""""""""""""
694
695.. code-block:: sql
696
697 ALTER TABLE wallabag_config ADD list_mode INT DEFAULT NULL
698
699Migration down
700""""""""""""""
701
702.. code-block:: sql
703
704 ALTER TABLE wallabag_config DROP list_mode
705
706SQLite
707^^^^^^
708
709Migration up
710""""""""""""
711
712.. code-block:: sql
713
714 ALTER TABLE wallabag_config ADD COLUMN list_mode INTEGER DEFAULT NULL
715
716Migration down
717""""""""""""""
718
719.. code-block:: sql
720
721 DROP INDEX UNIQ_87E64C53A76ED395
722 CREATE TEMPORARY TABLE __temp__wallabag_config AS SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key FROM wallabag_config
723 DROP TABLE wallabag_config
724 CREATE TABLE wallabag_config (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, theme VARCHAR(255) NOT NULL COLLATE BINARY, items_per_page INTEGER NOT NULL, language VARCHAR(255) NOT NULL COLLATE BINARY, rss_token VARCHAR(255) DEFAULT NULL COLLATE BINARY, rss_limit INTEGER DEFAULT NULL, reading_speed DOUBLE PRECISION DEFAULT NULL, pocket_consumer_key VARCHAR(255) DEFAULT NULL COLLATE BINARY, PRIMARY KEY(id))
725 INSERT INTO wallabag_config (id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key) SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key FROM __temp__wallabag_config
726 DROP TABLE __temp__wallabag_config
727 CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON wallabag_config (user_id)
728
729Migration 20161128131503
730------------------------
731
732MySQL
733^^^^^
734
735Migration up
736""""""""""""
737
738.. code-block:: sql
739
740 ALTER TABLE wallabag_user DROP locked, DROP credentials_expire_at, DROP expires_at
741
742Migration down
743""""""""""""""
744
745.. code-block:: sql
746
747 ALTER TABLE wallabag_user ADD locked SMALLINT DEFAULT NULL, ADD credentials_expire_at DATETIME DEFAULT NULL, ADD expires_at DATETIME DEFAULT NULL
748
749PostgreSQL
750^^^^^^^^^^
751
752Migration up
753""""""""""""
754
755.. code-block:: sql
756
757 ALTER TABLE wallabag_user DROP locked
758 ALTER TABLE wallabag_user DROP credentials_expire_at
759 ALTER TABLE wallabag_user DROP expires_at
760
761Migration down
762""""""""""""""
763
764.. code-block:: sql
765
766 ALTER TABLE wallabag_user ADD locked SMALLINT DEFAULT NULL
767 ALTER TABLE wallabag_user ADD credentials_expire_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL
768 ALTER TABLE wallabag_user ADD expires_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL
769
770SQLite
771^^^^^^
772
773Migration up
774""""""""""""
775
776.. code-block:: sql
777
778 ALTER TABLE wallabag_user ADD COLUMN locked SMALLINT DEFAULT NULL
779 ALTER TABLE wallabag_user ADD COLUMN credentials_expire_at DATETIME DEFAULT NULL
780 ALTER TABLE wallabag_user ADD COLUMN expires_at DATETIME DEFAULT NULL
781
782Migration down
783""""""""""""""
784
785.. code-block:: sql
786
787 DROP INDEX UNIQ_1D63E7E592FC23A8
788 DROP INDEX UNIQ_1D63E7E5A0D96FBF
789 DROP INDEX UNIQ_1D63E7E5C05FB297
790 CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, twoFactorAuthentication, trusted, expired, credentials_expired FROM wallabag_user
791 DROP TABLE wallabag_user
792 CREATE TABLE wallabag_user (id INTEGER NOT NULL, username VARCHAR(180) NOT NULL COLLATE BINARY, username_canonical VARCHAR(180) NOT NULL COLLATE BINARY, email VARCHAR(180) NOT NULL COLLATE BINARY, email_canonical VARCHAR(180) NOT NULL COLLATE BINARY, enabled BOOLEAN NOT NULL, salt VARCHAR(255) NOT NULL COLLATE BINARY, password VARCHAR(255) NOT NULL COLLATE BINARY, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL COLLATE BINARY, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL COLLATE BINARY, name CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, twoFactorAuthentication BOOLEAN NOT NULL, trusted CLOB DEFAULT NULL COLLATE BINARY, expired SMALLINT DEFAULT NULL, credentials_expired SMALLINT DEFAULT NULL, PRIMARY KEY(id))
793 INSERT INTO wallabag_user (id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, twoFactorAuthentication, trusted, expired, credentials_expired) SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, twoFactorAuthentication, trusted, expired, credentials_expired FROM __temp__wallabag_user
794 DROP TABLE __temp__wallabag_user
795 CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON wallabag_user (username_canonical)
796 CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON wallabag_user (email_canonical)
797 CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON wallabag_user (confirmation_token)
798
799Migration 20161214094403
800------------------------
801
802MySQL
803^^^^^
804
805Migration up
806""""""""""""
807
808.. code-block:: sql
809
810 CREATE INDEX IDX_entry_uid ON wallabag_entry (uid)
811
812Migration down
813""""""""""""""
814
815.. code-block:: sql
816
817 DROP INDEX IDX_entry_uid ON wallabag_entry
818
819PostgreSQL
820^^^^^^^^^^
821
822Migration up
823""""""""""""
824
825.. code-block:: sql
826
827 CREATE INDEX IDX_entry_uid ON wallabag_entry (uid)
828
829Migration down
830""""""""""""""
831
832.. code-block:: sql
833
834 DROP INDEX idx_entry_uid
835
836SQLite
837^^^^^^
838
839Migration up
840""""""""""""
841
842.. code-block:: sql
843
844 DROP INDEX IDX_F4D18282A76ED395
845 DROP INDEX created_at_idx
846 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 FROM wallabag_entry
847 DROP TABLE wallabag_entry
848 CREATE TABLE wallabag_entry (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uid CLOB 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', PRIMARY KEY(id))
849 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) 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 FROM __temp__wallabag_entry
850 DROP TABLE __temp__wallabag_entry
851 CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id)
852 CREATE INDEX created_at_idx ON wallabag_entry (created_at)
853 CREATE INDEX IDX_entry_uid ON wallabag_entry (uid)
854
855Migration down
856""""""""""""""
857
858.. code-block:: sql
859
860 DROP INDEX IDX_entry_uid
861 DROP INDEX created_at_idx
862 DROP INDEX IDX_F4D18282A76ED395
863 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 FROM wallabag_entry
864 DROP TABLE wallabag_entry
865 CREATE TABLE wallabag_entry (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uid CLOB 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', PRIMARY KEY(id))
866 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) 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 FROM __temp__wallabag_entry
867 DROP TABLE __temp__wallabag_entry
868 CREATE INDEX created_at_idx ON wallabag_entry (created_at)
869 CREATE INDEX IDX_F4D18282A76ED395 ON wallabag_entry (user_id)
870 74
871*************************** 75***************************
872Upgrade from 2.0.x to 2.1.1 76Upgrade from 2.0.x to 2.1.1