updates for active directory now with docs
tests / ci (push) Canceled after 0s

This commit is contained in:
Mark Gregory
2026-11-11 17:15:37 +00:00
parent 4ebcd12565
commit 90f8655595
7 changed files with 433 additions and 0 deletions
@@ -0,0 +1,26 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('users', function (Blueprint $table): void {
$table->softDeletes();
});
DB::table('users')->whereNotNull('ad_guid')->whereNotNull('ad_disabled_at')
->update(['deleted_at' => DB::raw('ad_disabled_at')]);
}
public function down(): void
{
Schema::table('users', function (Blueprint $table): void {
$table->dropSoftDeletes();
});
}
};
@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('ad_sync_runs', function (Blueprint $table): void {
$table->uuid('id')->primary();
$table->string('status', 16);
$table->boolean('dry_run');
$table->boolean('deactivate_missing');
$table->json('counts')->nullable();
$table->string('failure')->nullable();
$table->unsignedInteger('duration_ms');
$table->timestamp('finished_at')->index();
$table->index(['dry_run', 'status', 'finished_at']);
});
Schema::table('users', function (Blueprint $table): void {
$table->string('ad_disabled_reason', 32)->nullable();
});
}
public function down(): void
{
Schema::table('users', function (Blueprint $table): void {
$table->dropColumn('ad_disabled_reason');
});
Schema::dropIfExists('ad_sync_runs');
}
};