Skip to content

make_reader(migrate=False) #403

@lemon24

Description

@lemon24

Currently, database migrations happen automatically during storage __init__; this is by design, and should remain the default.

However, sometimes more precise control of when migrations happen is needed (e.g. a deployed web application does not want migrations to happen in the web workers, but during deployment). Add a make_reader() flag to allow for this.

It should be possible to implement this by changing setup_db() to pass a copy of MIGRATION with empty migrations and an appropriate missing_suffix message.

To do:

  • make_reader(migrate: bool = True) flag + documentation
  • Storage implementation
  • a test_reader_lifecycle.py test (StorageError should be raised if migrations are needed and migrate=False)
  • a matching --migrate/--no-migrate CLI flag (default true)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions