Skip to content

A free open source IT asset/license management system

Change settings table `saml_idp_metadata` to MEDIUMTEXT

snipec85a33be6a9d
diff --git a/database/migrations/2023_07_05_092237_change_settings_table_increase_saml_idp_metadata_size.php b/database/migrations/2023_07_05_092237_change_settings_table_increase_saml_idp_metadata_size.php
new file mode 100644
index 0000000000..0e200e11b5
--- /dev/null
+++ b/database/migrations/2023_07_05_092237_change_settings_table_increase_saml_idp_metadata_size.php
@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class ChangeSettingsTableIncreaseSamlIdpMetadataSize extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * This migration changes the format of the saml_idp_metadata field to MEDIUMTEXT
+ * to avoid truncating
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::table('settings', function (Blueprint $table) {
+ $table->mediumText('saml_idp_metadata')->nullable()->default(null)->change();
+ });
+
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('settings', function (Blueprint $table) {
+ $table->text('saml_idp_metadata')->nullable()->default(null)->change();
+ });
+ }
+}