Browse Source
Don't use the parent id attribute anymore but respect https://xmpp.org/extensions/xep-0201.html#new for the Reply mechanism
pull/978/head
Don't use the parent id attribute anymore but respect https://xmpp.org/extensions/xep-0201.html#new for the Reply mechanism
pull/978/head
5 changed files with 51 additions and 14 deletions
-
13app/Message.php
-
5app/widgets/Chat/Chat.php
-
35database/migrations/20201106101328_add_parent_mid_to_messages_table.php
-
7lib/moxl/src/Stanza/Message.php
-
5lib/moxl/src/Xec/Action/Message/Publish.php
@ -0,0 +1,35 @@ |
|||
<?php |
|||
|
|||
use Movim\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
|
|||
class AddParentMidToMessagesTable extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->disableForeignKeyCheck(); |
|||
|
|||
$this->schema->table('messages', function (Blueprint $table) { |
|||
$table->integer('parentmid')->unsigned()->nullable(); |
|||
$table->dropColumn('parentthread'); |
|||
|
|||
$table->foreign('parentmid') |
|||
->references('mid')->on('messages') |
|||
->onDelete('set null'); |
|||
}); |
|||
|
|||
$this->enableForeignKeyCheck(); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->disableForeignKeyCheck(); |
|||
|
|||
$this->schema->table('messages', function (Blueprint $table) { |
|||
$table->dropColumn('parentmid'); |
|||
$table->string('parentthread', 128)->nullable(); |
|||
}); |
|||
|
|||
$this->enableForeignKeyCheck(); |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue