@ -14,8 +14,12 @@ class AddIndexParentmidToMessagesTable extends Migration
public function down()
{
$this->disableForeignKeyCheck();
$this->schema->table('messages', function (Blueprint $table) {
$table->dropIndex('messages_parentmid_index');
});
$this->enableForeignKeyCheck();
}
@ -15,10 +15,13 @@ class RemoveJidForeignFromMembersTable extends Migration
$this->schema->table('members', function (Blueprint $table) {
$table->foreign('jid')
->references('id')->on('contacts');
@ -19,9 +19,13 @@ class AddBundleIdDeviceIdUniqueToBundleSessionsTable extends Migration
$this->schema->table('bundle_sessions', function (Blueprint $table) {
$table->dropUnique('bundle_sessions_bundle_id_deviceid_unique');
$table->renameColumn('deviceid', 'device_id');
@ -0,0 +1,22 @@
<?php
use Movim\Migration;
class SetCorrectCollationEmojiToReactionsTable extends Migration
public function up()
/**
* MySQL specific fix to ensure that the emojis are properly handled
* See https://github.com/movim/movim/issues/1042
*/
if ($this->schema->getConnection()->getDriverName() == 'mysql') {
$this->schema->getConnection()->unprepared('alter table reactions modify emoji varchar(32) charset utf8mb4 collate utf8mb4_bin;');