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? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
GIVEN
title: Company x-table: companies type: object description: Database schema of a Company. x-indexes: - 'unique:shortName,postalCode' properties: id: type: integer readOnly: true name: type: string maxLength: 64 shortName: type: string postalCode: type: string
EXECUTE
rename "postalCode" to "postCode"
new schema
title: Company x-table: companies type: object description: Database schema of a Company. x-indexes: - 'unique:shortName,postCode' properties: id: type: integer readOnly: true name: type: string maxLength: 64 shortName: type: string postCode: type: string
execute
./yii gii/api
ACTUAL
class m240624_100002_change_table_companies extends \yii\db\Migration { public function safeUp() { $this->addColumn('{{%companies}}', 'postCode', $this->text()->null()->defaultValue(null)); $this->dropColumn('{{%companies}}', 'postalCode'); $this->dropIndex('companies_shortName_postalCode_key', '{{%companies}}'); $this->createIndex('companies_shortName_postCode_key', '{{%companies}}', ["shortName", "postCode"], true); } public function safeDown() { $this->dropIndex('companies_shortName_postCode_key', '{{%companies}}'); $this->createIndex('companies_shortName_postalCode_key', '{{%companies}}', ["shortName", "postalCode"], true); $this->addColumn('{{%companies}}', 'postalCode', $this->text()->null()->defaultValue(null)); $this->dropColumn('{{%companies}}', 'postCode'); } }
EXPECTED
class m240624_100002_change_table_companies extends \yii\db\Migration { public function safeUp() { $this->dropIndex('companies_shortName_postalCode_key', '{{%companies}}'); $this->addColumn('{{%companies}}', 'postCode', $this->text()->null()->defaultValue(null)); $this->dropColumn('{{%companies}}', 'postalCode'); $this->createIndex('companies_shortName_postCode_key', '{{%companies}}', ["shortName", "postCode"], true); } public function safeDown() { $this->dropIndex('companies_shortName_postCode_key', '{{%companies}}'); $this->addColumn('{{%companies}}', 'postalCode', $this->text()->null()->defaultValue(null)); $this->dropColumn('{{%companies}}', 'postCode'); $this->createIndex('companies_shortName_postalCode_key', '{{%companies}}', ["shortName", "postalCode"], true); } }
BUG
safeUp: first dropIndex , and only then dropColumn safeDown: first addColumn , and only then createIndex
The text was updated successfully, but these errors were encountered:
Merge pull request #5 from php-openapi/3-bug-addremove-property-and-a…
e993ed3
…t-the-same-time-change-it-at-x-indexes Resolve: Bug: add/remove property and at the same time change it at x-indexes: #3
SOHELAHMED7
Successfully merging a pull request may close this issue.
GIVEN
EXECUTE
rename "postalCode" to "postCode"
new schema
execute
ACTUAL
EXPECTED
BUG
safeUp: first dropIndex , and only then dropColumn
safeDown: first addColumn , and only then createIndex
The text was updated successfully, but these errors were encountered: