forked from NixOS/hydra
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename all database identifiers to dashed variants
Having CamelCase names for tables and columns doesn't really work out well, because we'd need to not only quote those names during creation but also all queries would need to use double quotes around these identifiers. Now every database identifier is consistent and lower-case only, which should make it easier to use within raw statements (and inside the SQL shell) and also less confusing in terms of schema definition versus raw statements or other code references. Of course, this isn't a very trivial change, so I wrote a small script which makes it easy to rebase this very commit should there be changes to master in the meantime. The Nix expression generating the script can be found here (yes, it's gory and a variant of "write-once-never-touch-again"): https://gist.github.com/aszlig/59ea813c28731d339b9764c46f363200 Note that I've left "userName" as-is (just making it lower-case in the schema) because there were a lot of references in the code that overlap with the column name. Another table I didn't touch except from making it lower-case (which it is anyway on PostgreSQL) is "schemaversion", because that table is needed for upgrading existing instances. Moreover, the reason why there now is no relation from jobset_inputs to jobsets (and back) anymore in the DBIx schema is that because it is now created using PostgreSQL instead of SQLite, that foreign key however was defined for SQLite only: > #ifdef SQLITE > , > foreign key (project, name, nixExprInput) > references JobsetInputs(project, jobset, > name) > #endif I've ran tests.install, tests.api and the tests in build.x86_64-linux and they all have passed. In addition to running those tests, I've dumped my running Hydra instance with database schema version 45 and tested the change. The upgrade worked successfully and the web interface is still working after a few tests. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
- Loading branch information
Showing
100 changed files
with
1,921 additions
and
1,248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.