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

Allow negative values with IntEnumField #895

Merged
merged 3 commits into from
Sep 7, 2021

Conversation

Terrance
Copy link
Contributor

@Terrance Terrance commented Sep 1, 2021

Description

This permits negative values for a non-generated IntEnumField.

Motivation and Context

Fixes #889.

How Has This Been Tested?

Tests updated to check the new minimum both for generated and non-generated fields.

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.*
    (there are 4 existing test failures from develop)

@Terrance
Copy link
Contributor Author

Terrance commented Sep 5, 2021

@long2ice Looks like you may be the only active maintainer, and I see there's a lot of open PRs awaiting review and without any initial comment -- is there anything that can be done to help with reviews, or otherwise move things along?

@coveralls
Copy link

coveralls commented Sep 6, 2021

Pull Request Test Coverage Report for Build 1208488420

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.0009%) to 94.187%

Totals Coverage Status
Change from base Build 1196561330: 0.0009%
Covered Lines: 4785
Relevant Lines: 5011

💛 - Coveralls

@long2ice
Copy link
Member

long2ice commented Sep 6, 2021

Thanks! Could you update changelog?

This expands the range of accepted values for SmallIntField (and
therefore IntEnumField) to include negative values down to -32768,
which assumes the underlying SMALLINT column uses signed integers.

Database-specific notes:

* PostgreSQL only provides signed SMALLINT columns.
* MySQL provides a signed SMALLINT column by default.
* SQLite doesn't enforce a range on its only integer type.
@long2ice
Copy link
Member

long2ice commented Sep 7, 2021

Thanks!

@long2ice long2ice closed this Sep 7, 2021
@long2ice long2ice reopened this Sep 7, 2021
@long2ice long2ice merged commit 7e2ac1b into tortoise:develop Sep 7, 2021
@Terrance Terrance deleted the int-enum-negative branch September 7, 2021 07: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.

Allow negative enum values with IntEnumField
3 participants