From 195d29494c7e807e0fdfe0901d85befd357bcd3e Mon Sep 17 00:00:00 2001 From: Martin Carlsson Date: Wed, 3 Jun 2020 16:28:32 +0200 Subject: [PATCH] P5-5329: clean up articles table after styla migration --- migrations/000.200.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 migrations/000.200.sql diff --git a/migrations/000.200.sql b/migrations/000.200.sql new file mode 100644 index 0000000..07a94b5 --- /dev/null +++ b/migrations/000.200.sql @@ -0,0 +1,7 @@ +-- P5-5329: clean up articles table after styla migration + +-- fix broken name +update articles set name = '"Brokiga" at Photowall' where name = '"""Brokiga"" at Photowall"'; + +-- remove duplicate rows +DELETE FROM articles a USING articles b WHERE a.id < b.id AND (a.name = b.name and a.published = b.published);