From aecd4ca291a85fa46fd616aa216e124901c86d3a Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Fri, 9 Mar 2018 08:08:14 -0500 Subject: [PATCH] fix --- contrib/backends/srndv2/src/srnd/postgres.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/backends/srndv2/src/srnd/postgres.go b/contrib/backends/srndv2/src/srnd/postgres.go index d0ef1d6..3704e54 100644 --- a/contrib/backends/srndv2/src/srnd/postgres.go +++ b/contrib/backends/srndv2/src/srnd/postgres.go @@ -600,10 +600,10 @@ func (self *PostgresDatabase) upgrade6to7() { func (self *PostgresDatabase) upgrade7to8() { log.Println("migrating 7 -> 8") cmds := []string{ - "ALTER TABLE ArticleNumbers DROP CONSTRAINT articlenumbers_message_id_fkey", - "ALTER TABLE ArticleNumbers ADD CONSTRAINT FOREIGN KEY (message_id) REFERENCES ArticlePosts(message_id) ON DELETE CASCADE", - "ALTER TABLE NNTPHeaders DROP CONSTRAINT nntpheaders_header_article_message_id_fkey", - "ALTER TABLE NNTPHeaders ADD CONSTRAINT FOREIGN KEY (header_article_message_id) REFERENCES ArticlePosts(message_id) ON DELETE CASCADE", + "ALTER TABLE ArticleNumbers DROP CONSTRAINT IF EXISTS articlenumbers_message_id_fkey", + "ALTER TABLE ArticleNumbers ADD CONSTRAINT msgid_depends FOREIGN KEY (message_id) REFERENCES ArticlePosts(message_id) ON DELETE CASCADE", + "ALTER TABLE NNTPHeaders DROP CONSTRAINT IF EXISTS nntpheaders_header_article_message_id_fkey", + "ALTER TABLE NNTPHeaders ADD CONSTRAINT msgid_depends FOREIGN KEY (header_article_message_id) REFERENCES ArticlePosts(message_id) ON DELETE CASCADE", } for _, cmd := range cmds { log.Println("exec", cmd)