Skip to content

Commit 0d9e2fd

Browse files
Publish SCIM migrations in Docker build process
Co-authored-by: arietimmerman <[email protected]>
1 parent 09023eb commit 0d9e2fd

File tree

1 file changed

+2
-46
lines changed

1 file changed

+2
-46
lines changed

Dockerfile

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -277,52 +277,8 @@ class DemoSeeder extends Seeder
277277
}
278278
EOM
279279

280-
# Add migration to add SCIM fields to users table
281-
RUN cat > /example/database/migrations/2021_01_01_000003_add_scim_fields_to_users_table.php <<'EOM'
282-
<?php
283-
284-
use Illuminate\Database\Migrations\Migration;
285-
use Illuminate\Database\Schema\Blueprint;
286-
use Illuminate\Support\Facades\Schema;
287-
288-
return new class extends Migration {
289-
public function up(): void
290-
{
291-
Schema::table('users', function (Blueprint $table) {
292-
if (!Schema::hasColumn('users', 'formatted')) {
293-
$table->string('formatted')->nullable();
294-
}
295-
if (!Schema::hasColumn('users', 'displayName')) {
296-
$table->string('displayName')->nullable();
297-
}
298-
if (!Schema::hasColumn('users', 'active')) {
299-
$table->boolean('active')->default(false);
300-
}
301-
if (!Schema::hasColumn('users', 'roles')) {
302-
$table->json('roles')->nullable();
303-
}
304-
});
305-
}
306-
307-
public function down(): void
308-
{
309-
Schema::table('users', function (Blueprint $table) {
310-
if (Schema::hasColumn('users', 'formatted')) {
311-
$table->dropColumn('formatted');
312-
}
313-
if (Schema::hasColumn('users', 'displayName')) {
314-
$table->dropColumn('displayName');
315-
}
316-
if (Schema::hasColumn('users', 'active')) {
317-
$table->dropColumn('active');
318-
}
319-
if (Schema::hasColumn('users', 'roles')) {
320-
$table->dropColumn('roles');
321-
}
322-
});
323-
}
324-
};
325-
EOM
280+
# Publish SCIM migrations from the package
281+
RUN php artisan vendor:publish --tag=laravel-scim-migrations
326282

327283
# Run migrations and seed demo data
328284
RUN php artisan migrate && php artisan db:seed --class=Database\\Seeders\\DemoSeeder

0 commit comments

Comments
 (0)