cebe / yii2-openapi

REST API application generator for Yii2, openapi 3.0 YAML -> Yii2
MIT License
130 stars 23 forks source link

If data type is not changed then still migrations are generated for timestamp in MySQL #143

Closed SOHELAHMED7 closed 1 year ago

SOHELAHMED7 commented 1 year ago

DB: MySQL

OpenAPI schema:

# User:
title: User
x-table: user
type: object
description: Database schema of a User.

# ...

properties:

  id:
    type: integer
    readOnly: true
    example: 1337

  # other fields...

  created_at:
    type: string
    format: date-time
    example: '2020-03-14T21:42:17Z'
    readOnly: true

  updated_at:
    type: string
    format: date-time
    example: '2020-03-14T21:42:17Z'
    readOnly: true

Generated migrations :

unwanted-migrations

Expected:

This migrations does not make any sense and should not be generated

Hint for solution: This happens because we haven't explicitly mentioned x-db-type, so by default it is considered timestamp data type

Type: Bug