Skip to content

Database migration should create SQL constraints for relations #2332

@bajtos

Description

@bajtos

See #1718 for background context.

As a user building an LB4 application with HasMany BelongsTo or HasOne relation, I want lb4 automigrate to define SQL constraints (foreign key, unique) in such way that referential integrity will be correctly enforced by the database.

Acceptance criteria

  • Improve the base SQL connector loopback-connector to include CONSTRAINT definitions when updating tables.
  • Find out how to test this functionality in automated way in our connectors. It's important to test both autoupdate (incremental changes to existing schema) and automigrate (creating new tables).

Ensure the new tests are executed as part of connector test suite and that they pass on our CI for the following connectors

Depending on how much work the following connectors will require, either improve them as part of this story or create follow-up stories:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions