Skip to content

Database versioning is needed #7

Open

Description

@jtniehof

Work over the past few years has resulted in some small changes to the database structure. Right now there is code that allows everything to work with old or new databases, but at some point the structure should firm up and be assigned a version number, so that the structure of the database can be known (and eventually code to support old structures removed.)

Changes that I can recall:

Closure condition

This issue should be closed when the database versioning has been defined (e.g. what constitutes an increment, what is current, where is the version stored) and code is available to migrate earlier versions of database to current version, compatible at least with postgres and sqlite.

Activity

  1. jtniehof commented on Sep 29, 2020

    @jtniehof
    MemberAuthor

    I guess one question is whether we want to version the entire database, or table-by-table. I think the entire db is probably easier.

  2. balarsen commented on Sep 29, 2020

    @balarsen
    Contributor

    whole thing works for me... way easier to keep track

  3. jtniehof commented on Oct 5, 2020

    @jtniehof
    MemberAuthor

    Whole thing it seems to be. I think we can have an arg to the DButils __init__ specifying a minimum version and then have migration scripts...so once we define v.1, we have a script that migrates v. 0 to v. 1 and then the __init__ defaults to requiring v. 1, and we can rip out a lot of the peanut butter.

  4. jtniehof commented on Jan 19, 2022

    @jtniehof
    MemberAuthor

    Migration scripts might also want to fix types on databases where sqlite doesn't enforce typing...there are a lot of booleans that were treated as 0/1 in the code at some point and that has almost certainly leaked into database. Similarly for empty string vs. NULL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    technical-debtNot strictly a bug but suboptimal implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions