Maintain local ⭤ remote in sync with automatic AT Protocol parity for Laravel (alpha & unstable)
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add database migrations

+75
+37
database/migrations/create_parity_conflicts_table.php
··· 1 + <?php 2 + 3 + use Illuminate\Database\Migrations\Migration; 4 + use Illuminate\Database\Schema\Blueprint; 5 + use Illuminate\Support\Facades\Schema; 6 + 7 + return new class extends Migration 8 + { 9 + public function up(): void 10 + { 11 + $table = config('parity.conflicts.table', 'parity_conflicts'); 12 + 13 + Schema::create($table, function (Blueprint $table) { 14 + $table->id(); 15 + $table->string('model_type'); 16 + $table->unsignedBigInteger('model_id'); 17 + $table->string('uri')->nullable(); 18 + $table->json('local_data'); 19 + $table->json('remote_data'); 20 + $table->string('status')->default('pending'); 21 + $table->string('resolution')->nullable(); 22 + $table->timestamp('resolved_at')->nullable(); 23 + $table->timestamps(); 24 + 25 + $table->index(['model_type', 'model_id']); 26 + $table->index('status'); 27 + $table->index('uri'); 28 + }); 29 + } 30 + 31 + public function down(): void 32 + { 33 + $table = config('parity.conflicts.table', 'parity_conflicts'); 34 + 35 + Schema::dropIfExists($table); 36 + } 37 + };
+38
database/migrations/create_parity_import_states_table.php
··· 1 + <?php 2 + 3 + use Illuminate\Database\Migrations\Migration; 4 + use Illuminate\Database\Schema\Blueprint; 5 + use Illuminate\Support\Facades\Schema; 6 + 7 + return new class extends Migration 8 + { 9 + public function up(): void 10 + { 11 + $table = config('parity.import.state_table', 'parity_import_states'); 12 + 13 + Schema::create($table, function (Blueprint $table) { 14 + $table->id(); 15 + $table->string('did'); 16 + $table->string('collection'); 17 + $table->string('status')->default('pending'); 18 + $table->string('cursor')->nullable(); 19 + $table->unsignedInteger('records_synced')->default(0); 20 + $table->unsignedInteger('records_skipped')->default(0); 21 + $table->unsignedInteger('records_failed')->default(0); 22 + $table->timestamp('started_at')->nullable(); 23 + $table->timestamp('completed_at')->nullable(); 24 + $table->text('error')->nullable(); 25 + $table->timestamps(); 26 + 27 + $table->unique(['did', 'collection']); 28 + $table->index('status'); 29 + }); 30 + } 31 + 32 + public function down(): void 33 + { 34 + $table = config('parity.import.state_table', 'parity_import_states'); 35 + 36 + Schema::dropIfExists($table); 37 + } 38 + };