From 792b1b889fb11cc7267af0399fbae5b0b67f69b8 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:32:05 +0100 Subject: [PATCH] faet(migration): Add SSL fields to database tables --- ...2616_add_ssl_fields_to_database_tables.php | 70 +++++++++++++++++++ ...d_ssl_fields_to_standalone_postgresqls.php | 30 -------- 2 files changed, 70 insertions(+), 30 deletions(-) create mode 100644 database/migrations/2025_01_27_102616_add_ssl_fields_to_database_tables.php delete mode 100644 database/migrations/2025_01_27_102616_add_ssl_fields_to_standalone_postgresqls.php diff --git a/database/migrations/2025_01_27_102616_add_ssl_fields_to_database_tables.php b/database/migrations/2025_01_27_102616_add_ssl_fields_to_database_tables.php new file mode 100644 index 000000000..361e2fd32 --- /dev/null +++ b/database/migrations/2025_01_27_102616_add_ssl_fields_to_database_tables.php @@ -0,0 +1,70 @@ +boolean('enable_ssl')->default(true); + $table->enum('ssl_mode', ['allow', 'prefer', 'require', 'verify-ca', 'verify-full'])->default('require'); + }); + Schema::table('standalone_mysqls', function (Blueprint $table) { + $table->boolean('enable_ssl')->default(true); + $table->enum('ssl_mode', ['PREFERRED', 'REQUIRED', 'VERIFY_CA', 'VERIFY_IDENTITY'])->default('REQUIRED'); + }); + Schema::table('standalone_mariadbs', function (Blueprint $table) { + $table->boolean('enable_ssl')->default(true); + }); + Schema::table('standalone_redis', function (Blueprint $table) { + $table->boolean('enable_ssl')->default(false); + }); + Schema::table('standalone_keydbs', function (Blueprint $table) { + $table->boolean('enable_ssl')->default(false); + }); + Schema::table('standalone_dragonflies', function (Blueprint $table) { + $table->boolean('enable_ssl')->default(false); + }); + Schema::table('standalone_mongodbs', function (Blueprint $table) { + $table->boolean('enable_ssl')->default(true); + $table->enum('ssl_mode', ['allow', 'prefer', 'require', 'verify-full'])->default('require'); + }); + } + + /** + * Reverse the migrations. + */ + public function down() + { + Schema::table('standalone_postgresqls', function (Blueprint $table) { + $table->dropColumn('enable_ssl'); + $table->dropColumn('ssl_mode'); + }); + Schema::table('standalone_mysqls', function (Blueprint $table) { + $table->dropColumn('enable_ssl'); + $table->dropColumn('ssl_mode'); + }); + Schema::table('standalone_mariadbs', function (Blueprint $table) { + $table->dropColumn('enable_ssl'); + }); + Schema::table('standalone_redis', function (Blueprint $table) { + $table->dropColumn('enable_ssl'); + }); + Schema::table('standalone_keydbs', function (Blueprint $table) { + $table->dropColumn('enable_ssl'); + }); + Schema::table('standalone_dragonflies', function (Blueprint $table) { + $table->dropColumn('enable_ssl'); + }); + Schema::table('standalone_mongodbs', function (Blueprint $table) { + $table->dropColumn('enable_ssl'); + $table->dropColumn('ssl_mode'); + }); + } +}; diff --git a/database/migrations/2025_01_27_102616_add_ssl_fields_to_standalone_postgresqls.php b/database/migrations/2025_01_27_102616_add_ssl_fields_to_standalone_postgresqls.php deleted file mode 100644 index 3b0ce8aa4..000000000 --- a/database/migrations/2025_01_27_102616_add_ssl_fields_to_standalone_postgresqls.php +++ /dev/null @@ -1,30 +0,0 @@ -boolean('enable_ssl')->default(true); - $table->string('ssl_mode')->nullable()->default('require'); - }); - } - - /** - * Reverse the migrations. - */ - public function down() - { - Schema::table('standalone_postgresqls', function (Blueprint $table) { - $table->dropColumn('enable_ssl'); - $table->dropColumn('ssl_mode'); - }); - } -};