We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Inversed reference for detect junction table require CASCADE.
Input
title: Document properties: id: type: integer labels: type: array readOnly: true description: Inversed reference for detect junction table documents2labels items: $ref: '#/components/schemas/Label'
title: Label properties: id: type: integer documents: type: array readOnly: true description: Inversed reference for detect junction table documents2labels items: $ref: '#/components/schemas/Document'
Migration Actual
public function safeUp() { $this->createTable('{{%documents2labels}}', [ 'document_id' => $this->integer()->notNull(), 'label_id' => $this->integer()->notNull(), ]); $this->addPrimaryKey('pk_document_id_label_id', '{{%documents2labels}}', 'document_id,label_id'); $this->addForeignKey('fk_documents2labels_document_id_documents_id', '{{%documents2labels}}', 'document_id', '{{%documents}}', 'id'); $this->addForeignKey('fk_documents2labels_label_id_labels_id', '{{%documents2labels}}', 'label_id', '{{%labels}}', 'id'); } public function safeDown() { $this->dropForeignKey('fk_documents2labels_label_id_labels_id', '{{%documents2labels}}'); $this->dropForeignKey('fk_documents2labels_document_id_documents_id', '{{%documents2labels}}'); $this->dropPrimaryKey('pk_document_id_label_id', '{{%documents2labels}}'); $this->dropTable('{{%documents2labels}}'); }
Migration Expected
public function safeUp() { $this->createTable('{{%documents2labels}}', [ 'document_id' => $this->integer()->notNull(), 'label_id' => $this->integer()->notNull(), ]); $this->addPrimaryKey('pk_document_id_label_id', '{{%documents2labels}}', 'document_id,label_id'); $this->addForeignKey('fk_documents2labels_document_id_documents_id', '{{%documents2labels}}', 'document_id', '{{%documents}}', 'id', 'CASCADE'); $this->addForeignKey('fk_documents2labels_label_id_labels_id', '{{%documents2labels}}', 'label_id', '{{%labels}}', 'id', 'CASCADE'); } public function safeDown() { $this->dropForeignKey('fk_documents2labels_label_id_labels_id', '{{%documents2labels}}'); $this->dropForeignKey('fk_documents2labels_document_id_documents_id', '{{%documents2labels}}'); $this->dropPrimaryKey('pk_document_id_label_id', '{{%documents2labels}}'); $this->dropTable('{{%documents2labels}}'); }
The text was updated successfully, but these errors were encountered:
The difference in actual and expected can be visualised at https://www.diffchecker.com/tARQD8qv/
Sorry, something went wrong.
SOHELAHMED7
Successfully merging a pull request may close this issue.
Inversed reference for detect junction table require CASCADE.
Input
Migration Actual
Migration Expected
The text was updated successfully, but these errors were encountered: