Skip to content

schema_version exists, but Miniflux tries to run migration #1428

@BerkhanBerkdemir

Description

@BerkhanBerkdemir

Hello,

I have migrated my Miniflux 2.0.36 instance of off managed PostgreSQL. I guess I successfully ran pg_restore without errors. Then I modified /etc/miniflux.conf and I set DATABASE_URL as a valid URI. However, Miniflux unit did not work properly but reporting this

You must run the SQL migrations, the database schema is not up to date: current=v0, expected=v54

The table returns,

miniflux_production=# SELECT version FROM schema_version;
 version
---------
 54
(1 row)

For future reference, I used following command to restore the PostgreSQL dump

createdb -O miniflux -T template0 miniflux_production
pg_restore --verbose --no-acl --no-owner -h /var/run/postgresql/ -U postgres -d miniflux_production miniflux-production.dump

If I set RUN_MIGRATION=1, then PostgreSQL returns as schema_version exists. I have feeling that this report is related to

v2/database/database.go

Lines 71 to 78 in ab3fdf5

func IsSchemaUpToDate(db *sql.DB) error {
var currentVersion int
db.QueryRow(`SELECT version FROM schema_version`).Scan(&currentVersion)
if currentVersion < schemaVersion {
return fmt.Errorf(`the database schema is not up to date: current=v%d expected=v%d`, currentVersion, schemaVersion)
}
return nil
}

I tried to give information what you might need. Please directly ping me when you write a comment.

Thanks for this great project.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions