From 51d65c2cf2cf9d8fa4986f0d39f317e5efc555ac Mon Sep 17 00:00:00 2001 From: Esteban Gallego Date: Tue, 28 Nov 2023 10:44:01 -0500 Subject: [PATCH 1/3] Create Wizard Templates table --- ...7_215150_create_wizard_templates_table.php | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 database/migrations/2023_11_27_215150_create_wizard_templates_table.php diff --git a/database/migrations/2023_11_27_215150_create_wizard_templates_table.php b/database/migrations/2023_11_27_215150_create_wizard_templates_table.php new file mode 100644 index 0000000000..93c66d3b29 --- /dev/null +++ b/database/migrations/2023_11_27_215150_create_wizard_templates_table.php @@ -0,0 +1,37 @@ +id(); + $table->uuid('uuid')->unique(); + $table->unsignedBigInteger('process_template_id')->nullable(); + $table->unsignedInteger('process_id'); + $table->unsignedInteger('media_id'); + $table->timestamps(); + + // Foreign keys + $table->foreign('process_id') + ->references('id') + ->on('processes') + ->onDelete('cascade') + ->constrained('processes'); + $table->foreign('media_id') + ->references('id') + ->on('media') + ->onDelete('cascade') + ->constrained('media'); + }); + } + + public function down() + { + Schema::dropIfExists('wizard_templates'); + } +} From 4bbba5f55c16367d482e36e5c8e37ac3d90aa671 Mon Sep 17 00:00:00 2001 From: Esteban Gallego Date: Tue, 28 Nov 2023 10:44:42 -0500 Subject: [PATCH 2/3] Add asset_type to the process_template table --- ...asset_type_column_to_process_templates.php | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 database/migrations/2023_11_28_150344_add_asset_type_column_to_process_templates.php diff --git a/database/migrations/2023_11_28_150344_add_asset_type_column_to_process_templates.php b/database/migrations/2023_11_28_150344_add_asset_type_column_to_process_templates.php new file mode 100644 index 0000000000..d311e876d6 --- /dev/null +++ b/database/migrations/2023_11_28_150344_add_asset_type_column_to_process_templates.php @@ -0,0 +1,27 @@ +string('asset_type')->nullable()->after('is_system'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('process_templates', function (Blueprint $table) { + $table->dropColumn('asset_type'); + }); + } +}; From 4adbbae270e70f3ccde4b4696c63326bcdd5363c Mon Sep 17 00:00:00 2001 From: Esteban Gallego Date: Tue, 28 Nov 2023 15:59:12 -0500 Subject: [PATCH 3/3] Update media_collection column --- .../2023_11_27_215150_create_wizard_templates_table.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/database/migrations/2023_11_27_215150_create_wizard_templates_table.php b/database/migrations/2023_11_27_215150_create_wizard_templates_table.php index 93c66d3b29..d7a34c4789 100644 --- a/database/migrations/2023_11_27_215150_create_wizard_templates_table.php +++ b/database/migrations/2023_11_27_215150_create_wizard_templates_table.php @@ -13,7 +13,7 @@ public function up() $table->uuid('uuid')->unique(); $table->unsignedBigInteger('process_template_id')->nullable(); $table->unsignedInteger('process_id'); - $table->unsignedInteger('media_id'); + $table->string('media_collection')->nullable(); $table->timestamps(); // Foreign keys @@ -22,11 +22,6 @@ public function up() ->on('processes') ->onDelete('cascade') ->constrained('processes'); - $table->foreign('media_id') - ->references('id') - ->on('media') - ->onDelete('cascade') - ->constrained('media'); }); }