aboutsummaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
Diffstat (limited to 'database')
-rw-r--r--database/migrations/2020_01_03_190703_remove_mediopassive_voice.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/database/migrations/2020_01_03_190703_remove_mediopassive_voice.php b/database/migrations/2020_01_03_190703_remove_mediopassive_voice.php
new file mode 100644
index 0000000..beddf3e
--- /dev/null
+++ b/database/migrations/2020_01_03_190703_remove_mediopassive_voice.php
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+use HebrewParseTrainer\Form;
+
+class RemoveMediopassiveVoice extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Form::where('voice', 'MP')->update(['voice' => 'M']);
+
+ DB::statement("ALTER TABLE forms CHANGE COLUMN voice voice ENUM('A', 'M', 'P') NOT NULL");
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ DB::statement("ALTER TABLE forms CHANGE COLUMN voice voice ENUM('A', 'M', 'P', 'MP') NOT NULL");
+ }
+}