-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f5567b
commit 6ffe0c6
Showing
3 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
database/migrations/2024_05_18_080116_create_imports_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class() extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::create('imports', function (Blueprint $table) { | ||
$table->id(); | ||
$table->timestamp('completed_at')->nullable(); | ||
$table->string('file_name'); | ||
$table->string('file_path'); | ||
$table->string('importer'); | ||
$table->unsignedInteger('processed_rows')->default(0); | ||
$table->unsignedInteger('total_rows'); | ||
$table->unsignedInteger('successful_rows')->default(0); | ||
$table->foreignId('user_id')->constrained()->cascadeOnDelete(); | ||
$table->boolean('state')->default(true)->comment('状态'); | ||
$table->unsignedInteger('order')->default(0)->comment('排序'); | ||
$table->timestamps(); | ||
$table->softDeletes(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('imports'); | ||
} | ||
}; |
38 changes: 38 additions & 0 deletions
38
database/migrations/2024_05_18_080117_create_exports_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class() extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::create('exports', function (Blueprint $table) { | ||
$table->id(); | ||
$table->timestamp('completed_at')->nullable(); | ||
$table->string('file_disk'); | ||
$table->string('file_name')->nullable(); | ||
$table->string('exporter'); | ||
$table->unsignedInteger('processed_rows')->default(0); | ||
$table->unsignedInteger('total_rows'); | ||
$table->unsignedInteger('successful_rows')->default(0); | ||
$table->foreignId('user_id')->constrained()->cascadeOnDelete(); | ||
$table->boolean('state')->default(true)->comment('状态'); | ||
$table->unsignedInteger('order')->default(0)->comment('排序'); | ||
$table->timestamps(); | ||
$table->softDeletes(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('exports'); | ||
} | ||
}; |
33 changes: 33 additions & 0 deletions
33
database/migrations/2024_05_18_080118_create_failed_import_rows_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class() extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::create('failed_import_rows', function (Blueprint $table) { | ||
$table->id(); | ||
$table->json('data'); | ||
$table->foreignId('import_id')->constrained()->cascadeOnDelete(); | ||
$table->text('validation_error')->nullable(); | ||
$table->boolean('state')->default(true)->comment('状态'); | ||
$table->unsignedInteger('order')->default(0)->comment('排序'); | ||
$table->timestamps(); | ||
$table->softDeletes(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('failed_import_rows'); | ||
} | ||
}; |