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

In Pgsql, column data type change from varchar(255) to json "using" should be used #125

Closed
SOHELAHMED7/yii2-openapi
#7
@SOHELAHMED7

Description

@SOHELAHMED7

In Pgsql, if we change db type from varchar(255) to json, alter column statement should have "using".

Example:

From:

name:
          type: string
          x-db-type: varchar(255)

To:

name:
          type: array
          x-db-type: JSON
          nullable: false
          default: '{}'

This should not be generated in migration:

$this->db->createCommand('ALTER TABLE {{%fruits}} ALTER COLUMN name SET DATA TYPE json')->execute();

But this should be generated:

$this->db->createCommand('ALTER TABLE {{%fruits}} ALTER COLUMN name SET DATA TYPE json using "name"::json')->execute();

PR will be SOHELAHMED7#7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions