Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expandable only exclude junction table #129

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

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