Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117911866
D1528.1775399255.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D1528.1775399255.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D1528: Ensure that discounts are unique
Attached
Detach File
Event Timeline