Giter Club home page Giter Club logo

Comments (3)

myzkyy avatar myzkyy commented on May 18, 2024 1

@k1LoW
Thank you for your response.

I noticed that it was a bug of MySQL and it has been fixed at 8.0.14.
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-14.html

Names of referenced columns of foreign keys were always shown in lowercase in SHOW CREATE TABLE output and the INFORMATION_SCHEMA.KEY_COLUMN_USAGE table. (Bug #27353767, Bug #88718)

Upgrading my local MySQL resolved this issue.

Sorry for bothering you. Thank you for your support!

from tbls.

k1LoW avatar k1LoW commented on May 18, 2024

Hi, @myzkyy Thank you for your report!!

I'll fix it as soon as possible.

from tbls.

k1LoW avatar k1LoW commented on May 18, 2024

I tried to check and could not reproduce it.

Is there something in the tbls.yml?

mysql> SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 8.0.19    |
+-----------+
1 row in set (0.00 sec)

mysql> CREATE DATABASE `issue-255` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected, 1 warning (0.01 sec)

mysql> USE `issue-255`;
Database changed
mysql> CREATE TABLE table1 (productCode INT PRIMARY KEY);
Query OK, 0 rows affected (0.01 sec)

mysql> CREATE TABLE table2 (productCode INT, FOREIGN KEY(`productCode`) REFERENCES table1(`productcode`));
Query OK, 0 rows affected (0.03 sec)

mysql> SHOW CREATE TABLE table1;
+--------+--------------------------------------------------------------------------------------------------------------------------+
| Table  | Create Table                                                                                                             |
+--------+--------------------------------------------------------------------------------------------------------------------------+
| table1 | CREATE TABLE `table1` (
  `productCode` int NOT NULL,
  PRIMARY KEY (`productCode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+--------+--------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> SHOW CREATE TABLE table2;
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table  | Create Table                                                                                                                                                                                                                     |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| table2 | CREATE TABLE `table2` (
  `productCode` int DEFAULT NULL,
  KEY `productCode` (`productCode`),
  CONSTRAINT `table2_ibfk_1` FOREIGN KEY (`productCode`) REFERENCES `table1` (`productCode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql>
$ tbls version
1.43.1
$ tbls doc my://root:mypass@localhost:33308/issue-255 -f issue/255 # no tbls.yml
issue/255/schema.svg
issue/255/table1.svg
issue/255/table2.svg
issue/255/README.md
issue/255/table1.md
issue/255/table2.md

from tbls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.