From 6377f3a8b3e9f20e47cd9332e819292fa539895c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Sun, 24 Jan 2021 10:54:21 -0800 Subject: [PATCH] Fix regression introduced by PR #973 The relation "entries_user_feed_idx" already exists --- Makefile | 14 ++++++++++---- database/migrations.go | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index c459ed9e..32eeb12e 100644 --- a/Makefile +++ b/Makefile @@ -109,11 +109,17 @@ lint: integration-test: psql -U postgres -c 'drop database if exists miniflux_test;' psql -U postgres -c 'create database miniflux_test;' - DATABASE_URL=$(DB_URL) go run main.go -migrate - DATABASE_URL=$(DB_URL) ADMIN_USERNAME=admin ADMIN_PASSWORD=test123 go run main.go -create-admin go build -o miniflux-test main.go - DATABASE_URL=$(DB_URL) ./miniflux-test -debug >/tmp/miniflux.log 2>&1 & echo "$$!" > "/tmp/miniflux.pid" - while ! echo exit | nc localhost 8080; do sleep 1; done >/dev/null + + DATABASE_URL=$(DB_URL) \ + ADMIN_USERNAME=admin \ + ADMIN_PASSWORD=test123 \ + CREATE_ADMIN=1 \ + RUN_MIGRATIONS=1 \ + DEBUG=1 \ + ./miniflux-test >/tmp/miniflux.log 2>&1 & echo "$$!" > "/tmp/miniflux.pid" + + while ! nc -z localhost 8080; do sleep 1; done go test -v -tags=integration -count=1 miniflux.app/tests clean-integration-test: diff --git a/database/migrations.go b/database/migrations.go index 5e511ea4..bb0543e8 100644 --- a/database/migrations.go +++ b/database/migrations.go @@ -499,7 +499,7 @@ var migrations = []func(tx *sql.Tx) error{ func(tx *sql.Tx) (err error) { _, err = tx.Exec(` CREATE INDEX entries_feed_url_idx ON entries(feed_id, url); - CREATE INDEX entries_user_feed_idx ON entries(user_id, status, feed_id); + CREATE INDEX entries_user_status_feed_idx ON entries(user_id, status, feed_id); CREATE INDEX entries_user_status_changed_idx ON entries(user_id, status, changed_at); `) return err