Skip to content

Fix Migrations: Don't Use Group Eloquent Model#49

Merged
ardelato merged 1 commit intohermesfrom
fix--group-migrations
Feb 25, 2026
Merged

Fix Migrations: Don't Use Group Eloquent Model#49
ardelato merged 1 commit intohermesfrom
fix--group-migrations

Conversation

@ardelato
Copy link
Collaborator

@ardelato ardelato commented Feb 25, 2026

Description

This popped up after #47. There is an issue if we start from a fresh environment and re-run all migrations.

The migration 2024_09_16_093650_inactive_groups is querying the groups table with a deleted_at column that doesn't exist yet. This is a migration ordering issue the model (i.e. current code) uses SoftDeletes but the column hasn't been added at the time this migration runs, its added in the 2026_02_18_000000_add_soft_deletes_to_groups_table` migration.

As such, we need to update the prior migration to not use the Eloquent model and use the query builder instead.

TL;DR The ORM did not match the DB schema during migrations. The fix is to not use ORMs to query the DB during migrations.

qa_req 0 I applied this change to fix the test cluster instance.

The migration 2024_09_16_093650_inactive_groups is querying the groups
table with a deleted_at column that doesn't exist yet.
This is a migration ordering issue the model (i.e. current code)
uses SoftDeletes but the column hasn't been added at the time this migration
runs, its added in the 2026_02_18_000000_add_soft_deletes_to_groups_table migration.

As such, we need to update the prior migration to not use the Eloquent
model and use the query builder instead.

TL;DR The ORM did not match the DB schema during migrations. The fix is
to not use ORMs to query the DB during migrations.
Copy link

@batbattur batbattur left a comment

Choose a reason for hiding this comment

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

CR 🚛

@ardelato ardelato merged commit 8f04d6d into hermes Feb 25, 2026
@ardelato ardelato deleted the fix--group-migrations branch February 25, 2026 22:28
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