Skip to content

Conversation

@kidzen
Copy link

@kidzen kidzen commented Nov 6, 2017

should only exclude junction table from expandable

@kidzen
Copy link
Author

kidzen commented Nov 23, 2017

!empty($fk) will skip parent table that does not have any parent to have children to be excluded from generate this expanded column.

        $this->createTable('{{%parent}}', [
            'id' => $this->primaryKey(),
            'name' => $this->string(),
        ]);
        $this->createTable('{{%child}}', [
            'id' => $this->primaryKey(),
            'parent_id' => $this->integer(),
            'name' => $this->string(),
        ]);
        $this->addForeignKey('fk1','{{child}}','parent_id','{{parent}}','id');

use this, and see parent/index..it will not be expanded...instead, use

sizeof($tableSchema->primaryKey) < 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant