Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: new db schema #398

Merged
merged 1 commit into from
Apr 13, 2023
Merged

*: new db schema #398

merged 1 commit into from
Apr 13, 2023

Conversation

sgotti
Copy link
Member

@sgotti sgotti commented Mar 30, 2023

  • Remove query tables. Use a standard sql approach storing all possible fields as columns.

    • Some fields that are complex (like runtasks) are saved as json.
    • For postgres use native sequences. For sqlite3 emulate them with a sequence table.
  • Add sqlg package that provides code generators, db, lock and a db manager for setup/migration.

  • Future migrations could be done with the new migration logic and won't require a conversion from an export but will be done directly on the database.

  • Added migration command to migrate from an export of the db schema available in master (at commit 248a9e0) in addition to the one already available to migrate from v0.7.x. To define if the source export is the one at v0.7.x or at commit 248a9e0 the migrate command provides a "--source-version" option.

  • Run test for both sqlite3 and postgres databases

    • Currently integration tests are run only for sqlite3

@sgotti sgotti force-pushed the new_db_schema branch 13 times, most recently from 4857515 to 7d8b816 Compare April 6, 2023 11:57
@sgotti sgotti force-pushed the new_db_schema branch 2 times, most recently from 886e549 to 5fb2b20 Compare April 7, 2023 19:50
@sgotti sgotti force-pushed the new_db_schema branch 5 times, most recently from b0030c2 to b69d2b6 Compare April 13, 2023 07:32
* Remove query tables. Use a standard sql approach storing all possible
  fields as columns.
  * Some fields that are complex (like runtasks) are saved as json.
  * For postgres use native sequences. For sqlite3 emulate them with a
    sequence table.
* Add sqlg package that provides code generators, db, lock and a db
  manager for setup/migration.
* Future migrations could be done with the new migration logic and won't
  require a conversion from an export but will be done directly on the
  database.

* Added migration command to migrate from an export of the db schema
  available in master (at commit 248a9e0) in addition to the one
  already available to migrate from v0.7.x.
  To define if the source export is the one at v0.7.x or at commit
  248a9e0 the migrate command provides a "--source-version" option.

* Run test for both sqlite3 and postgres databases
  * Currently integration tests are run only for sqlite3
@sgotti sgotti merged commit c486af0 into agola-io:master Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant