Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2530054
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/database/migrations/2021_04_08_160000_expires_at_column_fix.php b/src/database/migrations/2021_04_08_160000_expires_at_column_fix.php
new file mode 100644
index 00000000..47c72a2e
--- /dev/null
+++ b/src/database/migrations/2021_04_08_160000_expires_at_column_fix.php
@@ -0,0 +1,38 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Support\Facades\DB;
+
+// phpcs:ignore
+class ExpiresAtColumnFix extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ // This is to remove "ON UPDATE" clause from the column
+ // There's no way to do this with Laravel schema migration tools,
+ // we have to use raw queries.
+
+ // Note: Whenever you create a table with custom timestamp() column don't forget to use
+ // also one of nullable() or useCurrent() to make sure "ON UPDATE" is not added.
+
+ DB::statement("ALTER TABLE `signup_codes` MODIFY `expires_at`"
+ . " TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP");
+ DB::statement("ALTER TABLE `verification_codes` MODIFY `expires_at`"
+ . " TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP");
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ // empty
+ }
+}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Feb 3, 6:09 AM (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
427043
Default Alt Text
(1 KB)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment