[migration] add column harvest_json_path
This commit is contained in:
parent
bace7a47c0
commit
0a37fd2d91
|
|
@ -61,10 +61,11 @@ private function loadFormData(Project $project)
|
||||||
{
|
{
|
||||||
$this->formData = $project->toArray();
|
$this->formData = $project->toArray();
|
||||||
$this->pivot_json_path = $this->formData['pivot_json_path'];
|
$this->pivot_json_path = $this->formData['pivot_json_path'];
|
||||||
$this->formData['pivot_json_path'] = null;
|
|
||||||
$this->span_json_path = $this->formData['span_json_path'];
|
$this->span_json_path = $this->formData['span_json_path'];
|
||||||
$this->harvest_json_path = $this->formData['harvest_json_path'];
|
$this->harvest_json_path = $this->formData['harvest_json_path'];
|
||||||
|
$this->formData['pivot_json_path'] = null;
|
||||||
$this->formData['span_json_path'] = null;
|
$this->formData['span_json_path'] = null;
|
||||||
|
$this->formData['harvest_json_path'] = null;
|
||||||
$this->formData['boundingBoxes'] = $project->boundingBoxes->toArray();
|
$this->formData['boundingBoxes'] = $project->boundingBoxes->toArray();
|
||||||
$this->formData['mail_recipients'] = $project->emailRecipients->toArray() ?: [
|
$this->formData['mail_recipients'] = $project->emailRecipients->toArray() ?: [
|
||||||
[
|
[
|
||||||
|
|
|
||||||
19
laravel_app/app/Rules/HarvestFile.php
Normal file
19
laravel_app/app/Rules/HarvestFile.php
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Rules;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
|
||||||
|
class HarvestFile implements ValidationRule
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the validation rule.
|
||||||
|
*
|
||||||
|
* @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail
|
||||||
|
*/
|
||||||
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?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::table('projects', function (Blueprint $table) {
|
||||||
|
$table->string('harvest_json_path')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('projects', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('harvest_json_path');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Loading…
Reference in a new issue