Skip to content

A free open source IT asset/license management system

Migration for min_amt on licenses

sniped0d29e03dbce
diff --git a/database/migrations/2024_02_28_093807_add_min_qty_to_licenses.php b/database/migrations/2024_02_28_093807_add_min_qty_to_licenses.php
new file mode 100644
index 0000000000..0cdfa1f875
--- /dev/null
+++ b/database/migrations/2024_02_28_093807_add_min_qty_to_licenses.php
@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddMinQtyToLicenses extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::table('licenses', function (Blueprint $table) {
+ $table->integer('min_amt')->nullable()->default(null);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('licenses', function (Blueprint $table) {
+ if (Schema::hasColumn('licenses', 'min_amt')) {
+ $table->dropColumn('min_amt');
+ }
+ });
+ }
+}