mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 10:58:55 +00:00
9ec594eec5
* Adds xmlitem model and route, rest-assured Api suffix fix, updates pytest and pytest-cov versions * Adds python client sample files * Adds samples update * Adds rest-assured sample client update * Adds sample updates in ensure-up-to-date * Changes rest-assured files back to master version, removes fix for issue #13 * Updates samples |
||
---|---|---|
.. | ||
.openapi-generator | ||
.openapi-generator-ignore | ||
mysql_schema.sql | ||
README.md |
MySQL Schema Codegen
Main goal of this generator is to provide database structure file almost identical you usually generate with:
- PHPMyAdmin (Export structure only, SQL syntax)
- Adminer
mysqldump
function
Requirements
- MySQL Server ^5.7.8 (
JSON
column type added)
Openapi Data Type to MySQL Data Type mapping
Openapi Data Type | Openapi Data Format | Dependent properties | MySQL Data Types | Default MySQL Data Type |
---|---|---|---|---|
integer |
int32 |
minimum / maximum / minimumExclusive / maximumExclusive |
TINYINT / SMALLINT / MEDIUMINT / INT / BIGINT |
INT |
integer |
int64 |
minimum / maximum / minimumExclusive / maximumExclusive |
TINYINT / SMALLINT / MEDIUMINT / INT / BIGINT |
BIGINT |
boolean |
TINYINT |
TINYINT |
||
number |
float |
DECIMAL |
DECIMAL |
|
number |
double |
DECIMAL |
DECIMAL |
|
string |
minLength / maxLength |
CHAR / VARCHAR / TEXT / MEDIUMTEXT / LONGTEXT |
TEXT |
|
string |
byte |
TEXT |
TEXT |
|
string |
binary |
MEDIUMBLOB |
MEDIUMBLOB |
|
file |
MEDIUMBLOB |
MEDIUMBLOB |
||
string |
date |
DATE |
DATE |
|
string |
date-time |
DATETIME |
DATETIME |
|
string |
enum |
ENUM |
ENUM |
|
array |
JSON |
JSON |
||
object |
JSON |
JSON |
||
\Model\User (referenced definition) |
TEXT |
TEXT |
How to use
Produced file(mysql_schema.sql
) contains every table definition. Current implementation doesn't drop or modify existed tables, if you want rewrite whole schema make sure they're not presented.
PHPMyAdmin
- Choose Import tab from the home screen
- In section File to import click to Choose File and find generated
mysql_schema.sql
- Make sure Format selector set to SQL
- Push Go button
Adminer
- Click Import link in left sidebar
- In File upload fieldset click to Choose Files and find generated
mysql_schema.sql
- Push Execute button