fix: [plugin:tags] Database migration
parent
39f7a3f9e1
commit
121990a941
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue