Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

default in OpenAPI schema does not generate migration with default() in MariaDB #115

Closed
SOHELAHMED7 opened this issue Oct 12, 2022 · 1 comment · Fixed by SOHELAHMED7/yii2-openapi#5

Comments

@SOHELAHMED7
Copy link
Contributor

OpenAPI schema

properties:
        id:
          type: integer
        list_owner:
          $ref: '#/components/schemas/ListOwner'
        price:
          description: price in EUR
          type: number
          x-db-type: decimal(10,2)
          default: 0

Generated Migration:

public function up()
    {
        $this->createTable('{{%table}}', [
            'id' => $this->primaryKey(),
            'list_owner_id' => $this->integer()->null()->defaultValue(null),
            'price' => 'decimal(10,2) NOT NULL', // <-- default is not set here
SOHELAHMED7 added a commit to SOHELAHMED7/yii2-openapi that referenced this issue Dec 30, 2022
@SOHELAHMED7
Copy link
Contributor Author

This issue can be closed once above PR is reviewed and merged

SOHELAHMED7 added a commit to SOHELAHMED7/yii2-openapi that referenced this issue Dec 30, 2022
…does-not-generate-migration-with-default-in-mariadb

Fix cebe#115
@SOHELAHMED7 SOHELAHMED7 reopened this Dec 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant