From a969ca502f5d26073f56863be98f33e165b24d9b Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 8 Mar 2024 06:01:35 -0700 Subject: [PATCH] Add migrations --- ...red_inbox_attribute_to_instances_table.php | 28 ++++++++++++++++ ..._add_shared_inboxes_to_instances_table.php | 32 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 database/migrations/2024_03_08_122947_add_shared_inbox_attribute_to_instances_table.php create mode 100644 database/migrations/2024_03_08_123356_add_shared_inboxes_to_instances_table.php diff --git a/database/migrations/2024_03_08_122947_add_shared_inbox_attribute_to_instances_table.php b/database/migrations/2024_03_08_122947_add_shared_inbox_attribute_to_instances_table.php new file mode 100644 index 000000000..a3d69f271 --- /dev/null +++ b/database/migrations/2024_03_08_122947_add_shared_inbox_attribute_to_instances_table.php @@ -0,0 +1,28 @@ +string('shared_inbox')->nullable()->index(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('instances', function (Blueprint $table) { + $table->dropColumn('shared_inbox'); + }); + } +}; diff --git a/database/migrations/2024_03_08_123356_add_shared_inboxes_to_instances_table.php b/database/migrations/2024_03_08_123356_add_shared_inboxes_to_instances_table.php new file mode 100644 index 000000000..ff7eebc69 --- /dev/null +++ b/database/migrations/2024_03_08_123356_add_shared_inboxes_to_instances_table.php @@ -0,0 +1,32 @@ +domain)->whereNotNull('sharedInbox')->first(); + if($si && $si->sharedInbox) { + $instance->shared_inbox = $si->sharedInbox; + $instance->save(); + } + } + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + + } +};