Skip to content

Make foreign keys not nullable #230

@rod-glover

Description

@rod-glover

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions