diff --git a/database/migrations/2024_05_18_080116_create_imports_table.php b/database/migrations/2024_05_18_080116_create_imports_table.php new file mode 100644 index 0000000..ca9f5b3 --- /dev/null +++ b/database/migrations/2024_05_18_080116_create_imports_table.php @@ -0,0 +1,38 @@ +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'); + } +}; diff --git a/database/migrations/2024_05_18_080117_create_exports_table.php b/database/migrations/2024_05_18_080117_create_exports_table.php new file mode 100644 index 0000000..08625ea --- /dev/null +++ b/database/migrations/2024_05_18_080117_create_exports_table.php @@ -0,0 +1,38 @@ +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'); + } +}; diff --git a/database/migrations/2024_05_18_080118_create_failed_import_rows_table.php b/database/migrations/2024_05_18_080118_create_failed_import_rows_table.php new file mode 100644 index 0000000..fc44af8 --- /dev/null +++ b/database/migrations/2024_05_18_080118_create_failed_import_rows_table.php @@ -0,0 +1,33 @@ +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'); + } +};