Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 21, 2025

The package automatically ran migrations adding SCIM fields to the users table on installation. Not all SCIM implementations require these fields in their database schema.

Changes

  • ServiceProvider: Replaced loadMigrationsFrom() with publishes() using tag laravel-scim-migrations
  • README: Added migration publishing instructions
  • Tests: Added verification that migrations are publishable via artisan command
  • Dockerfile: Updated to publish package migrations during build instead of manually creating migration file
  • Migration: Added roles field to the package migration (previously only included formatted and active)

Usage

Users who need these columns can opt-in:

php artisan vendor:publish --tag=laravel-scim-migrations
php artisan migrate

The migration includes:

  • formatted - User's full display name
  • active - User active status
  • roles - JSON array of user roles

Docker

The Docker image now uses the package migrations:

RUN php artisan vendor:publish --tag=laravel-scim-migrations
RUN php artisan migrate && php artisan db:seed --class=Database\\Seeders\\DemoSeeder

Existing installations are unaffected. Test suite compatibility maintained (TestCase manually adds columns).

Warning

<issue_title>Migration adding formatted and active fields to user model is always included</issue_title>
<issue_description>Commit daae495 added a migration file database/migrations/2021_01_01_000003_add_scim_fields_to_users_table.php.

The migration is always executed by laravel whenever this package is installed. I wonder if this should be the default behavior, as the real schema does not always need to match the scim schema and not every application require the formatted field.

Is there some way to fix #143 and not include this migration by default?</issue_description>

Comments on the Issue (you are @copilot in this section)

Original prompt

This section details on the original issue you should resolve

<issue_title>Migration adding formatted and active fields to user model is always included</issue_title>
<issue_description>Commit daae495 added a migration file database/migrations/2021_01_01_000003_add_scim_fields_to_users_table.php.

The migration is always executed by laravel whenever this package is installed. I wonder if this should be the default behavior, as the real schema does not always need to match the scim schema and not every application require the formatted field.

Is there some way to fix #143 and not include this migration by default?</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

If you need to add the `formatted` and `active` columns to your users table, publish the migrations:

```bash
php artisan vendor:publish --tag=laravel-scim-migrations
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot Make sure to apply these when building/running the Docker image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the Dockerfile to publish the package migrations during the build process. The migration file that was manually created has been replaced with php artisan vendor:publish --tag=laravel-scim-migrations which will publish the migration from the package. (commit 0d9e2fd)

Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot It seems that by removing the migration from the Dockerfile, the existing migration file does not introduce all required files (such as roles). Please check if something is missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the roles field to the migration. The package migration now includes formatted, active, and roles fields. Note: displayName was in the old Dockerfile migration but isn't actually used for Users in the SCIM schema (only for Groups), so it wasn't added. (commit a6da5ec)

Copilot AI changed the title [WIP] Fix default inclusion of migration for user model fields Make SCIM user table migrations opt-in instead of auto-loading Nov 21, 2025
Copilot AI requested a review from arietimmerman November 21, 2025 15:16
Copilot finished work on behalf of arietimmerman November 21, 2025 15:16
Copilot finished work on behalf of arietimmerman November 21, 2025 15:34
@arietimmerman arietimmerman marked this pull request as ready for review November 21, 2025 19:35
@arietimmerman arietimmerman merged commit e3da0ed into master Nov 21, 2025
10 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.

Migration adding formatted and active fields to user model is always included Docker image is missing fields

2 participants