fix: [plugin:tags] Database migration

pull/79/head
Sami Mokaddem 2021-10-21 13:42:29 +02:00
parent 39f7a3f9e1
commit 121990a941
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 5 additions and 5 deletions

View File

@ -7,8 +7,8 @@ use Migrations\AbstractMigration;
class TagSystem extends AbstractMigration
{
public function change() {
$tags = $this->table('tags_tags')
->addColumn('namespace', 'string', [
$tags = $this->table('tags_tags');
$tags->addColumn('namespace', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
@ -50,8 +50,8 @@ class TagSystem extends AbstractMigration
])
->create();
$tagged = $this->table('tags_tagged')
->addColumn('tag_id', 'integer', [
$tagged = $this->table('tags_tagged');
$tagged->addColumn('tag_id', 'integer', [
'default' => null,
'null' => false,
'signed' => false,
@ -83,7 +83,7 @@ class TagSystem extends AbstractMigration
$tags->addIndex(['name'], ['unique' => true])
->update();
$tagged->addIndex(['tag_id', 'fk_id', 'fk_table'], ['unique' => true])
$tagged->addIndex(['tag_id', 'fk_id', 'fk_model'], ['unique' => true])
->update();
}
}