Skip to content

fix: drop sessions FK and fix fixture phone numbers#119

Merged
ManukMinasyan merged 2 commits intomainfrom
fix/sessions-fk-and-fixture-phones
Feb 15, 2026
Merged

fix: drop sessions FK and fix fixture phone numbers#119
ManukMinasyan merged 2 commits intomainfrom
fix/sessions-fk-and-fixture-phones

Conversation

@ManukMinasyan
Copy link
Copy Markdown
Contributor

Summary

  • Drop the sessions.user_id foreign key constraint that references users.id — this causes integrity constraint violations when the sysadmin guard stores system_administrators IDs on login
  • Replace invalid 555 phone numbers in people seed fixtures with valid E.164 format (+1415555xxxx), since libphonenumber rejects reserved/fictional numbers

Test plan

  • Run migration on production: php artisan migrate
  • Verify sysadmin panel login at sysadmin.relaticle.test works without FK errors
  • Run php artisan db:seed to verify fixtures seed correctly with valid phone numbers

drop the sessions table FK on user_id that references users.id, which
causes integrity constraint violations when the sysadmin guard stores
system_administrators IDs on login.

replace invalid 555 phone numbers in people fixtures with valid E.164
format since libphonenumber rejects reserved/fictional numbers.
Copilot AI review requested due to automatic review settings February 15, 2026 21:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses two separate issues: (1) drops the sessions.user_id foreign key constraint to resolve integrity violations when the sysadmin guard stores system_administrators IDs during login, and (2) updates phone numbers in seed fixtures from fictional 555- format to valid E.164 format to satisfy libphonenumber validation requirements.

Changes:

  • Removes foreign key constraint from sessions.user_id to support multi-guard authentication where sessions store IDs from both users and system_administrators tables
  • Updates all people fixture phone numbers from invalid 555-xxx-xxxx format to valid E.164 format (+1415555xxxx)

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
database/migrations/2026_02_15_214730_drop_sessions_user_id_foreign_key.php New migration to drop the sessions.user_id foreign key constraint
app-modules/OnboardSeed/resources/fixtures/people/brian.yaml Updated phone number to E.164 format (+14155550100)
app-modules/OnboardSeed/resources/fixtures/people/dylan.yaml Updated phone number to E.164 format (+14155550101)
app-modules/OnboardSeed/resources/fixtures/people/ivan.yaml Updated phone number to E.164 format (+14155550102)
app-modules/OnboardSeed/resources/fixtures/people/tim.yaml Updated phone number to E.164 format (+14155550103)

…alls

Remove foreignUlid from original sessions migration to prevent FK
creation on fresh installs. Use Schema::getForeignKeys() to check
constraint existence before dropping on existing databases.
@ManukMinasyan ManukMinasyan merged commit e73a7af into main Feb 15, 2026
9 checks passed
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.

2 participants