diff --git a/app/Models/AccessLogModel.php b/app/Models/AccessLogModel.php deleted file mode 100644 index 34e07d2..0000000 --- a/app/Models/AccessLogModel.php +++ /dev/null @@ -1,20 +0,0 @@ -uuid('processId'); + $table->uuid('processId')->primary()->unique(); + $table->uuid('groupId'); $table->text('errReason')->nullable(); $table->text('errStatus')->nullable(); - $table->timestamp('createdAt')->nullable()->useCurrent()->useCurrentOnUpdate(); - - // Configure primary key - $table->primary('processId'); + $table->timestamp('created_at')->nullable()->useCurrent()->useCurrentOnUpdate(); + $table->timestamp('updated_at')->nullable()->useCurrentOnUpdate(); // Configure foreign keys $table->foreign('processId')->references('processId')->on('pdfCompress')->name('pdf_compress_fk'); $table->foreign('processId')->references('processId')->on('pdfMerge')->name('pdf_merge_fk'); $table->foreign('processId')->references('processId')->on('pdfSplit')->name('pdf_split_fk'); - $table->foreign('processId')->references('processId')->on('pdfDelete')->name('pdf_delete_fk'); $table->foreign('processId')->references('processId')->on('pdfCnv')->name('pdf_cnv_fk'); $table->foreign('processId')->references('processId')->on('pdfWatermark')->name('pdf_watermark_fk'); $table->foreign('processId')->references('processId')->on('pdfHtml')->name('pdf_html_fk'); diff --git a/database/migrations/2024_09_11_232920_create_cnv_table.php b/database/migrations/2024_09_11_232920_create_cnv_table.php index 4d7d988..0bbea2e 100644 --- a/database/migrations/2024_09_11_232920_create_cnv_table.php +++ b/database/migrations/2024_09_11_232920_create_cnv_table.php @@ -19,20 +19,21 @@ public function up(): void { Schema::create('pdfConvert', function (Blueprint $table) { - $table->id('cnvId'); + $table->id('cnvId')->primary()->unique(); $table->text('fileName')->nullable(); - $table->string('fileSize', 25)->nullable(); - $table->string('container', 25)->nullable(); + $table->char('fileSize', length: 25)->nullable(); + $table->enum('container', ['jpg','docx','pptx','xlsx','pdf'])->nullable(); $table->boolean('imgExtract'); $table->boolean('result'); $table->boolean('isBatch'); - $table->uuid('processId'); - $table->uuid('batchId')->nullable(); + $table->text('batchName')->nullable(); + $table->uuid('groupId'); + $table->uuid('processId')->unique(); $table->timestamp('procStartAt')->nullable(); $table->timestamp('procEndAt')->nullable(); - $table->text('procDuration')->nullable(); + $table->char('procDuration', length: 25)->nullable(); $table->boolean('isReport')->nullable()->default(false); - $table->timestamp('createdAt')->nullable()->useCurrent()->useCurrentOnUpdate(); + $table->timestamp('created_at')->nullable()->useCurrent()->useCurrentOnUpdate(); $table->timestamp('updated_at')->nullable()->useCurrentOnUpdate(); // Configure foreign key diff --git a/database/migrations/2024_09_11_232924_create_compress_table.php b/database/migrations/2024_09_11_232924_create_compress_table.php index cb26b77..e595e86 100644 --- a/database/migrations/2024_09_11_232924_create_compress_table.php +++ b/database/migrations/2024_09_11_232924_create_compress_table.php @@ -19,20 +19,21 @@ public function up(): void { Schema::create('pdfCompress', function (Blueprint $table) { - $table->id('compressId'); + $table->id('compressId')->primary()->unique(); $table->text('fileName')->nullable(); - $table->string('fileSize', 25)->nullable(); - $table->string('compFileSize', 25)->nullable(); - $table->string('compMethod', 25)->nullable(); + $table->char('fileSize', length: 25)->nullable(); + $table->char('compFileSize', length: 25)->nullable(); + $table->enum('compMethod', ['low','recommended','extreme'])->nullable(); $table->boolean('result'); $table->boolean('isBatch'); - $table->uuid('processId'); - $table->uuid('batchId')->nullable(); + $table->text('batchName')->nullable(); + $table->uuid('groupId'); + $table->uuid('processId')->unique(); $table->timestamp('procStartAt')->nullable(); $table->timestamp('procEndAt')->nullable(); - $table->text('procDuration')->nullable(); + $table->char('procDuration', length: 25)->nullable(); $table->boolean('isReport')->nullable()->default(false); - $table->timestamp('createdAt')->nullable()->useCurrent()->useCurrentOnUpdate(); + $table->timestamp('created_at')->nullable()->useCurrent()->useCurrentOnUpdate(); $table->timestamp('updated_at')->nullable()->useCurrentOnUpdate(); // Configure foreign key diff --git a/database/migrations/2024_09_11_232931_create_html_table.php b/database/migrations/2024_09_11_232931_create_html_table.php index 3145605..4f0fc96 100644 --- a/database/migrations/2024_09_11_232931_create_html_table.php +++ b/database/migrations/2024_09_11_232931_create_html_table.php @@ -19,19 +19,20 @@ public function up(): void { Schema::create('pdfHtml', function (Blueprint $table) { - $table->id('htmlId'); + $table->id('htmlId')->primary()->unique(); $table->text('urlName')->nullable(); - $table->text('urlMargin')->nullable(); - $table->text('urlOrientation')->nullable(); + $table->integer('urlMargin')->nullable(); + $table->enum('urlOrientation', ['landscape','portrait'])->nullable(); $table->boolean('urlSinglePage')->nullable(); - $table->text('urlSize')->nullable(); + $table->enum('urlSize', ['A3','A4','A5','Letter'])->nullable(); $table->boolean('result'); - $table->uuid('processId'); + $table->uuid('groupId'); + $table->uuid('processId')->unique(); $table->timestamp('procStartAt')->nullable(); $table->timestamp('procEndAt')->nullable(); - $table->text('procDuration')->nullable(); + $table->char('procDuration', length: 25)->nullable(); $table->boolean('isReport')->nullable()->default(false); - $table->timestamp('createdAt')->nullable()->useCurrent()->useCurrentOnUpdate(); + $table->timestamp('created_at')->nullable()->useCurrent()->useCurrentOnUpdate(); $table->timestamp('updated_at')->nullable()->useCurrentOnUpdate(); // Configure foreign key diff --git a/database/migrations/2024_09_11_232937_create_job_logs_table.php b/database/migrations/2024_09_11_232937_create_job_logs_table.php index d808a83..b7f3f3e 100644 --- a/database/migrations/2024_09_11_232937_create_job_logs_table.php +++ b/database/migrations/2024_09_11_232937_create_job_logs_table.php @@ -19,16 +19,18 @@ public function up(): void { Schema::create('jobLogs', function (Blueprint $table) { - $table->id('jobsId'); - $table->string('jobsName', 25); - $table->string('jobsEnv', 25); - $table->string('jobsRuntime', 25); + $table->id('jobsId')->primary()->unique(); + $table->char('jobsName', length: 25); + $table->enum('jobsEnv', ['production', 'local']); + $table->char('jobsRuntime', length: 25); $table->boolean('jobsResult'); + $table->uuid('groupId'); + $table->uuid('processId')->unique(); $table->timestamp('procStartAt')->nullable(); $table->timestamp('procEndAt')->nullable(); - $table->text('procDuration')->nullable(); - $table->uuid('processId'); - $table->timestamp('createdAt')->nullable()->useCurrent()->useCurrentOnUpdate(); + $table->char('procDuration', length: 25)->nullable(); + $table->timestamp('created_at')->nullable()->useCurrent()->useCurrentOnUpdate(); + $table->timestamp('updated_at')->nullable()->useCurrentOnUpdate(); // Configure foreign key $table->foreign('processId')->references('processId')->on('appLogs'); diff --git a/database/migrations/2024_09_11_232946_create_notify_logs_table.php b/database/migrations/2024_09_11_232946_create_notify_logs_table.php index 9d485e4..abe823c 100644 --- a/database/migrations/2024_09_11_232946_create_notify_logs_table.php +++ b/database/migrations/2024_09_11_232946_create_notify_logs_table.php @@ -19,13 +19,14 @@ public function up(): void { Schema::create('notifyLogs', function (Blueprint $table) { - $table->id('notifyId'); - $table->uuid('processId'); - $table->string('notifyName', 25); + $table->id('notifyId')->primary()->unique(); + $table->uuid('processId')->unique(); + $table->char('notifyName', length: 25); $table->boolean('notifyResult'); $table->text('notifyMessage')->nullable(); $table->json('notifyResponse')->nullable(); - $table->timestamp('createdAt')->nullable()->useCurrent()->useCurrentOnUpdate(); + $table->timestamp('created_at')->nullable()->useCurrent()->useCurrentOnUpdate(); + $table->timestamp('updated_at')->nullable()->useCurrentOnUpdate(); // Configure foreign key $table->foreign('processId')->references('processId')->on('appLogs'); diff --git a/database/migrations/2024_09_11_232953_create_merge_table.php b/database/migrations/2024_09_11_232953_create_merge_table.php index fb331e2..a60a767 100644 --- a/database/migrations/2024_09_11_232953_create_merge_table.php +++ b/database/migrations/2024_09_11_232953_create_merge_table.php @@ -19,18 +19,19 @@ public function up(): void { Schema::create('pdfMerge', function (Blueprint $table) { - $table->id('mergeId'); + $table->id('mergeId')->primary()->unique(); $table->text('fileName')->nullable(); - $table->string('fileSize', 25)->nullable(); + $table->char('fileSize', length: 25)->nullable(); $table->boolean('result'); $table->boolean('isBatch'); - $table->uuid('processId'); - $table->uuid('batchId')->nullable(); + $table->text('batchName')->nullable(); + $table->uuid('groupId'); + $table->uuid('processId')->unique(); $table->timestamp('procStartAt')->nullable(); $table->timestamp('procEndAt')->nullable(); - $table->text('procDuration')->nullable(); + $table->char('procDuration', length: 25)->nullable(); $table->boolean('isReport')->nullable()->default(false); - $table->timestamp('createdAt')->nullable()->useCurrent()->useCurrentOnUpdate(); + $table->timestamp('created_at')->nullable()->useCurrent()->useCurrentOnUpdate(); $table->timestamp('updated_at')->nullable()->useCurrentOnUpdate(); // Configure foreign key diff --git a/database/migrations/2024_09_11_232958_create_split_table.php b/database/migrations/2024_09_11_232958_create_split_table.php index bcf77c4..c8b9578 100644 --- a/database/migrations/2024_09_11_232958_create_split_table.php +++ b/database/migrations/2024_09_11_232958_create_split_table.php @@ -19,25 +19,26 @@ public function up(): void { Schema::create('pdfSplit', function (Blueprint $table) { - $table->id('splitId'); + $table->id('splitId')->primary()->unique(); $table->text('fileName')->nullable(); - $table->string('fileSize', 25)->nullable(); - $table->string('fromPage', 5)->nullable(); - $table->string('toPage', 5)->nullable(); - $table->text('customSplitPage')->nullable(); - $table->text('customDeletePage')->nullable(); - $table->text('fixedRange')->nullable(); - $table->string('mergePDF', 25)->nullable(); - $table->string('action', 10)->nullable(); + $table->char('fileSize', length: 25)->nullable(); + $table->integer('fromPage')->nullable(); + $table->integer('toPage')->nullable(); + $table->char('customSplitPage', length: 25)->nullable(); + $table->char('customDeletePage', length: 25)->nullable(); + $table->char('fixedRange', length: 25)->nullable(); + $table->enum('mergePDF', ['true', 'false'])->nullable(); + $table->enum('action', ['delete','split'])->nullable(); $table->boolean('result'); $table->boolean('isBatch'); - $table->uuid('processId'); - $table->uuid('batchId')->nullable(); + $table->uuid('groupId'); + $table->uuid('processId')->unique(); + $table->text('batchName')->nullable(); $table->timestamp('procStartAt')->nullable(); $table->timestamp('procEndAt')->nullable(); - $table->text('procDuration')->nullable(); + $table->char('procDuration', length: 25)->nullable(); $table->boolean('isReport')->nullable()->default(false); - $table->timestamp('createdAt')->nullable()->useCurrent()->useCurrentOnUpdate(); + $table->timestamp('created_at')->nullable()->useCurrent()->useCurrentOnUpdate(); $table->timestamp('updated_at')->nullable()->useCurrentOnUpdate(); // Configure foreign key diff --git a/database/migrations/2024_09_11_233004_create_watermark_table.php b/database/migrations/2024_09_11_233004_create_watermark_table.php index 031a6a7..d089a9b 100644 --- a/database/migrations/2024_09_11_233004_create_watermark_table.php +++ b/database/migrations/2024_09_11_233004_create_watermark_table.php @@ -19,29 +19,30 @@ public function up(): void { Schema::create('pdfWatermark', function (Blueprint $table) { - $table->id('watermarkId'); + $table->id('watermarkId')->primary()->unique(); $table->text('fileName')->nullable(); - $table->string('fileSize', 25)->nullable(); - $table->string('watermarkFontFamily', 25)->nullable(); - $table->string('watermarkFontStyle', 25)->nullable(); - $table->string('watermarkFontSize', 5)->nullable(); - $table->string('watermarkFontTransparency', 5)->nullable(); + $table->char('fileSize', length: 25)->nullable(); + $table->enum('watermarkFontFamily', ['Arial','Arial Unicode MS','Comic Sans MS','Courier','Times New Roman','Verdana'])->nullable(); + $table->enum('watermarkFontStyle', ['Regular','Bold','Italic'])->nullable(); + $table->integer('watermarkFontSize')->nullable(); + $table->integer('watermarkFontTransparency')->nullable(); $table->text('watermarkImage')->nullable(); - $table->string('watermarkLayout', 25)->nullable(); - $table->string('watermarkMosaic', 25)->nullable(); - $table->string('watermarkRotation', 25)->nullable(); - $table->string('watermarkStyle', 25)->nullable(); + $table->enum('watermarkLayout', ['above','below'])->nullable(); + $table->boolean('watermarkMosaic')->nullable(); + $table->integer('watermarkRotation')->nullable(); + $table->enum('watermarkStyle', ['img','txt'])->nullable(); $table->text('watermarkText')->nullable(); - $table->string('watermarkPage', 25)->nullable(); + $table->char('watermarkPage', length: 25)->nullable(); $table->boolean('result'); $table->boolean('isBatch'); - $table->uuid('processId'); - $table->uuid('batchId')->nullable(); + $table->text('batchName')->nullable(); + $table->uuid('groupId'); + $table->uuid('processId')->unique(); $table->timestamp('procStartAt')->nullable(); $table->timestamp('procEndAt')->nullable(); $table->text('procDuration')->nullable(); $table->boolean('isReport')->nullable()->default(false); - $table->timestamp('createdAt')->nullable()->useCurrent()->useCurrentOnUpdate(); + $table->timestamp('created_at')->nullable()->useCurrent()->useCurrentOnUpdate(); $table->timestamp('updated_at')->nullable()->useCurrentOnUpdate(); // Configure foreign key diff --git a/database/migrations/2024_09_16_175911_create_access_logs.php b/database/migrations/2024_09_16_175911_create_access_logs.php deleted file mode 100644 index 4b0661f..0000000 --- a/database/migrations/2024_09_16_175911_create_access_logs.php +++ /dev/null @@ -1,40 +0,0 @@ -id('accessId'); - $table->uuid('processId'); - $table->text('routePath')->nullable(); - $table->text('accessIpAddress')->nullable(); - $table->timestamp('createdAt')->nullable()->useCurrent()->useCurrentOnUpdate(); - - // Configure foreign key - $table->foreign('processId')->references('processId')->on('appLogs'); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('accessLogs'); - } -}; \ No newline at end of file