Skip to content

[Bug] PostgreSQL migration fails on restart: idx_reviews_user_date already exists #136

Description

@mbeq

Version: v0.7.2

When using PostgreSQL and restarting the server, the migration fails with: failed to initialize database: failed to execute schema file system_postgres.sql: pq: relation "idx_reviews_user_date" already exists.

In system_postgres.sql, the index idx_reviews_user_date is created without IF NOT EXISTS. All other indexes in the same file use CREATE INDEX IF NOT EXISTS. This makes the server impossible to restart when using PostgreSQL.

FIX: CREATE INDEX IF NOT EXISTS idx_reviews_user_date ON reviews(user_id, review_date);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions