Skip to content

[FEAT] Adds support for constraints in relationships. [FIX] Replacing .yml in filenames. #2

Open
ghosthi wants to merge 2 commits into
leafsphp:mainfrom
ghosthi:main
Open

[FEAT] Adds support for constraints in relationships. [FIX] Replacing .yml in filenames. #2
ghosthi wants to merge 2 commits into
leafsphp:mainfrom
ghosthi:main

Conversation

@ghosthi

@ghosthi ghosthi commented Feb 9, 2026

Copy link
Copy Markdown

What kind of change does this PR introduce? (pls check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe below

Description

This PR fixes the replace on .yml file titles on migrations that used to be replaced with rtrim, which can lead to unexpected behaviour on Schemas with names ending with characters "y", "m" or "l".

This PR also introduces the feature of allowing the use of constraints in Schema Relationships without changing the previous behaviour.

Using the previous format on schema files like so

# you can add foreign ids for other models under the relationships key key
relationships:
  - User

Will allow creation of relationship columns as usual.

With this PR, using it like this:

relationships:
  - User: id
  - Role: id

Will allow constrained relationships (with foreign key referenced) in the database.

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Related Issue

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.

1 participant