forked from cebe/yii2-openapi
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from php-openapi/3-bug-addremove-property-and-a…
…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
- Loading branch information
Showing
18 changed files
with
218 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...issue_fix/3_bug_add_remove_property_and_at_the_same_time_change_it_at_x_indexes/index.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
return [ | ||
'openApiPath' => '@specs/issue_fix/3_bug_add_remove_property_and_at_the_same_time_change_it_at_x_indexes/index.yaml', | ||
'generateUrls' => false, | ||
'generateModels' => true, | ||
'excludeModels' => [ | ||
'Error', | ||
], | ||
'generateControllers' => false, | ||
'generateMigrations' => true, | ||
'generateModelFaker' => false, | ||
]; |
38 changes: 38 additions & 0 deletions
38
...ssue_fix/3_bug_add_remove_property_and_at_the_same_time_change_it_at_x_indexes/index.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
openapi: "3.0.0" | ||
info: | ||
version: 1.0.0 | ||
title: 3_bug_add_remove_property_and_at_the_same_time_change_it_at_x_indexes | ||
paths: | ||
/: | ||
get: | ||
summary: List | ||
operationId: list | ||
responses: | ||
'200': | ||
description: The information | ||
|
||
components: | ||
schemas: | ||
Address: | ||
type: object | ||
description: desc | ||
x-indexes: | ||
- 'unique:shortName,postCode' | ||
required: | ||
- id | ||
properties: | ||
id: | ||
type: integer | ||
readOnly: true | ||
|
||
name: | ||
type: string | ||
maxLength: 64 | ||
|
||
shortName: | ||
type: string | ||
maxLength: 64 | ||
|
||
postCode: | ||
type: string | ||
maxLength: 64 |
23 changes: 23 additions & 0 deletions
23
...hange_it_at_x_indexes/mysql/migrations_mysql_db/m200000_000000_change_table_addresses.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/** | ||
* Table for Address | ||
*/ | ||
class m200000_000000_change_table_addresses extends \yii\db\Migration | ||
{ | ||
public function up() | ||
{ | ||
$this->addColumn('{{%addresses}}', 'postCode', $this->string(64)->null()->defaultValue(null)); | ||
$this->dropIndex('addresses_shortName_postalCode_key', '{{%addresses}}'); | ||
$this->createIndex('addresses_shortName_postCode_key', '{{%addresses}}', ["shortName", "postCode"], true); | ||
$this->dropColumn('{{%addresses}}', 'postalCode'); | ||
} | ||
|
||
public function down() | ||
{ | ||
$this->addColumn('{{%addresses}}', 'postalCode', $this->string(64)->null()->defaultValue(null)); | ||
$this->dropIndex('addresses_shortName_postCode_key', '{{%addresses}}'); | ||
$this->createIndex('addresses_shortName_postalCode_key', '{{%addresses}}', ["shortName", "postalCode"], true); | ||
$this->dropColumn('{{%addresses}}', 'postCode'); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
..._add_remove_property_and_at_the_same_time_change_it_at_x_indexes/mysql/models/Address.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace app\models; | ||
|
||
class Address extends \app\models\base\Address | ||
{ | ||
|
||
|
||
} | ||
|
Oops, something went wrong.