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

Foreign Keys must be nullable? #1413

Closed
2x2xplz opened this issue Aug 20, 2017 · 1 comment
Closed

Foreign Keys must be nullable? #1413

2x2xplz opened this issue Aug 20, 2017 · 1 comment

Comments

@2x2xplz
Copy link

2x2xplz commented Aug 20, 2017

DBFlow Version: upgrading from 4.0.beta-7 to 4.0.5
Issue Kind (Bug, Question, Feature): Question

Please note if you are using Instant Run, there may be bugs where generated classes are not created. Ensure you are using
the apt or kapt plugins and that incremental compilation is off.

Description:
When upgrading to the latest DBFlow version, all my Foreign Keys are rejected in the build process because they are not nullable types (using Kotlin). While I understand that in theory an FK may have reason to be null, it can also be viewed as a violation of referential integrity (especially if the FK references a Primary Key).

Is it possible to turn this off? Otherwise the entire app must be re-written to support null checking on all of these objects, even though they should never be null.

I did see #1344 where you state "Currently foreign key fields don't support NOT NULL on individual references." Can they support NOT NULL on the entire database or codebase, if not individually?

@2x2xplz
Copy link
Author

2x2xplz commented Oct 10, 2017

updated after 4.1.0 release in #1459 . Closed here

@2x2xplz 2x2xplz closed this as completed Oct 10, 2017
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

No branches or pull requests

1 participant