Skip to content

A free open source IT asset/license management system

Migration to add show_in_requestable_list boolean

snipec4adc3ccc8d1
diff --git a/database/migrations/2023_10_25_064324_add_show_in_requestable_to_custom_fields.php b/database/migrations/2023_10_25_064324_add_show_in_requestable_to_custom_fields.php
new file mode 100644
index 0000000000..ed667590f8
--- /dev/null
+++ b/database/migrations/2023_10_25_064324_add_show_in_requestable_to_custom_fields.php
@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddShowInRequestableToCustomFields extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::table('custom_fields', function (Blueprint $table) {
+ $table->boolean('show_in_requestable_list')->after('show_in_email')->default(0);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('custom_fields', function (Blueprint $table) {
+ if (Schema::hasColumn('custom_fields', 'show_in_requestable_list')) {
+ $table->dropColumn('show_in_requestable_list');
+ }
+ });
+ }
+}