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

Fix-xDbType #103

Merged
merged 6 commits into from
Dec 30, 2022
Merged

Fix-xDbType #103

merged 6 commits into from
Dec 30, 2022

Conversation

siggi-k
Copy link
Contributor

@siggi-k siggi-k commented Jul 6, 2022

x-db-type will no longer be reformatted from now on.
x-db-type is now the final entry in db.

nullalble property is handled correctly.

usecase

created_at:
  readOnly: true
  type: string
  format: datetime
  x-db-type: datetime
  nullable: false

fixes #100
fixes #99

@cebe cebe added the bug Something isn't working label Jul 7, 2022
@cebe cebe self-assigned this Jul 7, 2022
@cebe
Copy link
Owner

cebe commented Jul 7, 2022

Tests are failing after these changes.

case 'geometry':
case 'text':
case 'json':
return ($this->isMysql() && !$this->isMariaDb()) === false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

condition looks hard to read, should be positive check instead of negative.

Copy link
Contributor

@SOHELAHMED7 SOHELAHMED7 Oct 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Condition:

  is mysql is mariadb type in array final global negation
mysql json T !F=T T T F
mysql nonjson T !F=T F F T
mariadb json F !T=F T F T
mariadb nonjson F !T=F F F T

Default are not allowed for BLOB, TEXT, GEOMETRY, and JSON in MySQL prior to MySQL 8.0.13

Curious to know why it is allowed for MariaDB?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mariadb allows default value for JSON column at least, have been using that a few times. e.g. data JSON NOT NULL DEFAULT '{}'

@SOHELAHMED7
Copy link
Contributor

Completing this PR in #112

@cebe cebe merged commit 6ae03fb into cebe:master Dec 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

timestamp migrations do not work in MariaDB Attribute does not respect nullable or type null
3 participants