Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SchemaSync output and FOREING KEYS #54

Open
Niemi opened this issue Sep 7, 2017 · 0 comments
Open

SchemaSync output and FOREING KEYS #54

Niemi opened this issue Sep 7, 2017 · 0 comments

Comments

@Niemi
Copy link

Niemi commented Sep 7, 2017

can we sort output so, that CREATE TABLE statement was before CONSTRAINT FOREIGN KEY definition.(see output below)
Many thanks,

[sample output]
--
-- Schema Sync 0.9.4 Revert Script
-- Created: Wed, Sep 06, 2017
-- Server Version: 5.7.17-log
-- Apply To: localhost/mydb
--

USE `mydb`;
SET FOREIGN_KEY_CHECKS = 0;
CREATE TABLE `CALL` ( 
`UUID` varchar(45) NOT NULL, 
`CREATED` timestamp(3) NULL DEFAULT CURRENT_TIMESTAMP(3), 
`UPDATED` timestamp(3) NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), 
`GETIT_CALLER_ID` bigint(20) DEFAULT NULL, 
`SECOND_PARTY` varchar(190) DEFAULT NULL, 
`ANONYMOUS` bit(1) DEFAULT NULL, 
`myPHONES` bigint(20) NOT NULL, 
`DIRECTION` varchar(45) DEFAULT NULL, 
`MEDIA_SERVER_ID` varchar(190) DEFAULT NULL, 
`CALL_UUID` varchar(190) DEFAULT NULL, 
`CLOSED` bit(1) DEFAULT NULL, 
`CALL_ID` varchar(190) DEFAULT NULL, 
PRIMARY KEY (`UUID`), 
KEY `CALL_myPHONES_CREATED_GETIT_CALLER_SECOND_PARTY_CLOSED_CALL_ID` (`myPHONES`,`CREATED`,`GETIT_CALLER_ID`,`SECOND_PARTY`,`CLOSED`,`CALL_ID`), 
CONSTRAINT `FK_myPHONES` FOREIGN KEY (`myPHONES`) REFERENCES `myPHONES` (`myPHONES`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ...others tables definitions --
CREATE TABLE `myPHONES` (
`myPHONES` bigint(20) NOT NULL,
`CREATED` timestamp(3) NULL DEFAULT CURRENT_TIMESTAMP(3), 
`UPDATED` timestamp(3) NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
 PRIMARY KEY (`myPHONES`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
[end of sample output]
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant