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

Make foreign keys not nullable #230

Open
2 tasks
rod-glover opened this issue Jan 14, 2025 · 0 comments
Open
2 tasks

Make foreign keys not nullable #230

rod-glover opened this issue Jan 14, 2025 · 0 comments

Comments

@rod-glover
Copy link
Contributor

rod-glover commented Jan 14, 2025

A foreign key can be nullable or not, according to whether it is optional or required, respectively.

It appears that all foreign keys declared in all tables in CRMP are nullable. This does not seem logically correct in most cases; a meta_history record with a null station_id does not make any sense. Possible exceptions are objects that are not "owned" by a network; however, at the time of writing, no such objects exist.

TASKS:

  • Determine in what cases NULL FKs are logically allowed, i.e., in what cases it is optional.
  • In cases where FKs are logically required (most cases), add the NOT NULL constraint.
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