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

sql: Generate models from postgresql #709

Merged
merged 1 commit into from Feb 6, 2020

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Feb 6, 2020

Lowercasing is due to postgresql not having case-sensitive table names.
It always technically workde before, but those table names never
existed literally.

The switch to generating from postgresql is to handle an upcoming
addition of an auto-incrementign ID to the Jobset table. Sqlite doesn't
seem to be able to handle the table having an auto incrementing ID
field which isn't the primary key, but we can't change the primary
key trivially.

Since hydra doesn't support sqlite and hasn't for many year anyway,
it is easier to just generate from pgsql directly.

Lowercasing is due to postgresql not having case-sensitive table names.
It always technically workde before, but those table names never
existed literally.

The switch to generating from postgresql is to handle an upcoming
addition of an auto-incrementign ID to the Jobset table. Sqlite doesn't
seem to be able to handle the table having an auto incrementing ID
field which isn't the primary key, but we can't change the primary
key trivially.

Since hydra doesn't support sqlite and hasn't for many year anyway,
it is easier to just generate from pgsql directly.
@grahamc
Copy link
Member Author

grahamc commented Feb 6, 2020

I'm not sure what testing is appropriate for this change, but for what it is worth, these all built fine:

nix-build ./release.nix -A build -A manual -A tests.install -A tests.api -A tests.notifications

@edolstra edolstra merged commit 2b4f149 into NixOS:master Feb 6, 2020
@edolstra
Copy link
Member

edolstra commented Feb 6, 2020

BTW there is already some code for running Postgres in tests/set-up.pl and tests/tear-down.pl, might be nice to unify those.

@grahamc grahamc deleted the generate-from-postgresql branch February 6, 2020 19:25
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.

None yet

2 participants