Skip to content

fix(media): Migrate type column to string-backed enum#39

Merged
kyledoesdev merged 1 commit into
masterfrom
hotfix/fix-music-edit-error
Jun 9, 2026
Merged

fix(media): Migrate type column to string-backed enum#39
kyledoesdev merged 1 commit into
masterfrom
hotfix/fix-music-edit-error

Conversation

@kyledoesdev

Copy link
Copy Markdown
Owner

Renames the media.type_id column to media.type and converts it to a string type, aligning with the MediaType enum which is now string-backed.

This change enhances type safety, improves database readability with descriptive string values (e.g., 'movie' instead of '1'), and leverages Laravel's enum casting. It also resolves display issues in views by utilizing the label() method of the enum.

Renames the `media.type_id` column to `media.type` and converts it to a string type, aligning with the `MediaType` enum which is now string-backed.

This change enhances type safety, improves database readability with descriptive string values (e.g., 'movie' instead of '1'), and leverages Laravel's enum casting. It also resolves display issues in views by utilizing the `label()` method of the enum.
@kyledoesdev kyledoesdev merged commit 9532e2a into master Jun 9, 2026
1 check 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.

1 participant