Page MenuHomePhorge

D1528.1775399255.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D1528.1775399255.diff

diff --git a/src/database/migrations/2020_09_02_150004_unique_discounts.php b/src/database/migrations/2020_09_02_150004_unique_discounts.php
new file mode 100644
--- /dev/null
+++ b/src/database/migrations/2020_09_02_150004_unique_discounts.php
@@ -0,0 +1,39 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+// phpcs:ignore
+class UniqueDiscounts extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::table(
+ 'discounts',
+ function (Blueprint $table) {
+ $table->unique(['discount', 'description', 'code', 'active']);
+ }
+ );
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table(
+ 'discounts',
+ function (Blueprint $table) {
+ $table->dropUnique(['discount', 'description', 'code', 'active']);
+ }
+ );
+ }
+}

File Metadata

Mime Type
text/plain
Expires
Sun, Apr 5, 2:27 PM (7 h, 14 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18833647
Default Alt Text
D1528.1775399255.diff (1 KB)

Event Timeline