Index: trunk/phase3/maintenance/postgres/archives/patch-archive2-ar_deleted.sql |
— | — | @@ -12,7 +12,6 @@ |
13 | 13 | DO INSTEAD INSERT INTO archive2 VALUES ( |
14 | 14 | NEW.ar_namespace, NEW.ar_title, NEW.ar_text, NEW.ar_comment, NEW.ar_user, NEW.ar_user_text, |
15 | 15 | TO_TIMESTAMP(NEW.ar_timestamp, 'YYYYMMDDHH24MISS'), |
16 | | - NEW.ar_minor_edit, NEW.ar_flags, NEW.ar_rev_id, NEW.ar_text_id, NEW.ar_deleted |
| 16 | + NEW.ar_minor_edit, NEW.ar_flags, NEW.ar_rev_id, NEW.ar_text_id, |
| 17 | + COALESCE(NEW.ar_deleted, 0) -- ar_deleted is not always specified |
17 | 18 | ); |
18 | | - |
19 | | - |
Index: trunk/phase3/maintenance/postgres/tables.sql |
— | — | @@ -152,7 +152,8 @@ |
153 | 153 | DO INSTEAD INSERT INTO archive2 VALUES ( |
154 | 154 | NEW.ar_namespace, NEW.ar_title, NEW.ar_text, NEW.ar_comment, NEW.ar_user, NEW.ar_user_text, |
155 | 155 | TO_TIMESTAMP(NEW.ar_timestamp, 'YYYYMMDDHH24MISS'), |
156 | | - NEW.ar_minor_edit, NEW.ar_flags, NEW.ar_rev_id, NEW.ar_text_id |
| 156 | + NEW.ar_minor_edit, NEW.ar_flags, NEW.ar_rev_id, NEW.ar_text_id, |
| 157 | + COALESCE(NEW.ar_deleted, 0) -- NEW.ar_deleted might be unspecified (NULL) |
157 | 158 | ); |
158 | 159 | |
159 | 160 | CREATE RULE archive_delete AS ON DELETE TO archive |