[This topic is migrated from our old forums. The original author name has been removed]
Hi,
After installing DbVis 5.1 the DDL for my MySQL tables is displayed in one single line without any linebreaks or indention. I know there is a "Formats the SQL" button in the DDL window, but activating this, the formater is not giving a better response. In 5.0 the formater was also not good working with MySQL "CREATE TABLE..." but the DDL.
I'm using the same JDBC driver in both DbVis versions
Connection Message window shows:
[i]MySQL
4.1.11-log
MySQL-AB JDBC Driver
mysql-connector-java-3.1.12 ( $Date: 2005-11-17 15:53:48 +0100 (Thu, 17 Nov 2005) $, $Revision$ )[/i]
This is how an [b]unformated[/b] DDL looks in [b]DbVis 5.1.1 [/b]
CREATE TABLE similar_artist ( artist_id int(10) unsigned NOT NULL, similar_artist_id int(10) unsigned NOT NULL, similarity_type enum('C','F','I','R') NOT NULL COMMENT 'C = Contemporaries, F = Followers, I = Influences, R = Related Projects', datasource varchar(40), PRIMARY KEY USING BTREE (artist_id, similar_artist_id), CONSTRAINT artist_similar_artist_from FOREIGN KEY (artist_id) REFERENCES artist (artist_id) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT artist_similar_artist_to FOREIGN KEY (similar_artist_id) REFERENCES artist (artist_id) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8
This is how an [b]formated[/b] DDL looks in [b]DbVis 5.1.1 [/b]
CREATE
TABLE similar_artist
(
artist_id int(10) unsigned NOT NULL,
similar_artist_id int(10) unsigned NOT NULL,
similarity_type enum('C','F','I','R') NOT NULL COMMENT 'C = Contemporaries, F = Followers, I = Influences, R = Related Projects',
datasource varchar(40),
PRIMARY KEY USING BTREE (artist_id, similar_artist_id),
CONSTRAINT artist_similar_artist_from FOREIGN KEY (artist_id) REFERENCES artist (artist_id)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE,
CONSTRAINT artist_similar_artist_to FOREIGN KEY (similar_artist_id) REFERENCES artist (artist_id)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
)
ENGINE= InnoDB DEFAULT CHARSET= utf8
This is how an [b]unformated[/b] DDL looks in [b]DbVis 5.0 [/b]
CREATE TABLE `similar_artist` (
`artist_id` int(10) unsigned NOT NULL default '0',
`similar_artist_id` int(10) unsigned NOT NULL default '0',
`similarity_type` enum('C','F','I','R') NOT NULL default 'C' COMMENT 'C = Contemporaries, F = Followers, I = Influences, R = Related Projects',
`datasource` varchar(40) default NULL,
PRIMARY KEY (`artist_id`,`similar_artist_id`),
[b]KEY `artist_similar_artist_to` (`similar_artist_id`),[/b]
CONSTRAINT `artist_similar_artist_from` FOREIGN KEY (`artist_id`) REFERENCES `artist` (`artist_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `artist_similar_artist_to` FOREIGN KEY (`similar_artist_id`) REFERENCES `artist` (`artist_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8
One other thing that differs between these 3 outputs is that the highlighted KEY in 5.0 is not in the DDL of 5.1.1
It seems to me that the new version of DbVis is creating the CREATE TABLE statement by it's own and is not using the MySQL query "SHOW CREATE TABLE ...;" to do so.
Here's what I get when using [b]DbVis 5.1.1[/b], querying "[i]SHOW CREATE TABLE similar_artist;[/i]" and swith the result set to text based using the "Show Text" button in the result window.
Table Create Table
-------------- --------------------------------------------------------------------
similar_artist CREATE TABLE `similar_artist` (
`artist_id` int(10) unsigned NOT NULL default '0',
`similar_artist_id` int(10) unsigned NOT NULL default '0',
`similarity_type` enum('C','F','I','R') NOT NULL default 'C' COMMENT 'C = Contemporaries, F = Followers, I = Influences, R = Related Projects',
`datasource` varchar(40) default NULL,
PRIMARY KEY (`artist_id`,`similar_artist_id`),
KEY `artist_similar_artist_to` (`similar_artist_id`),
CONSTRAINT `artist_similar_artist_from` FOREIGN KEY (`artist_id`) REFERENCES `artist` (`artist_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `artist_similar_artist_to` FOREIGN KEY (`similar_artist_id`) REFERENCES `artist` (`artist_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 Comment
Roger Bjärevall
said
about 18 years ago
[This reply is migrated from our old forums.]
Re: DBVis 5.1 Table DDL on MySQL in one single line
Hi,
Sorry for the delay. I simply overlooked this posting earlier.
The problem with the following not appearing in the DDL is fixed in the latest early access version:
KEY `artist_similar_artist_to` (`similar_artist_id`)
http://www.minq.se/products/dbvis/eap
We'll look into the formatting issue.
Regards
Roger
anonymous