Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Changes in decimal unsigned columns not detected #15

Merged

Conversation

ccerrillo
Copy link
Contributor

@ccerrillo ccerrillo commented Oct 12, 2017

Modified regexp to accept unsigned decimal columns

Before the changes on decimal unsigned columns were not detected.

Test case:

FROM:

CREATE TABLE `test2` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `fk` int(10) NULL,
  `val` decimal(11,3) unsigned NOT NULL,
  `texto` char(60) NOT NULL DEFAULT 'default',
  `datade` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `new_field` int(10) NULL,
  PRIMARY KEY (`id`,`new_field`),
  KEY `FK__test1` (`fk`,`texto`),
  UNIQUE KEY `FK__test1` (`datade`),
  CONSTRAINT `FK__test3` FOREIGN KEY (`id`) REFERENCES `test` (`test1`)
  CONSTRAINT `FK__test3` FOREIGN KEY (`fk`) REFERENCES `test3` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 COMMENT='test1';

TO:

CREATE TABLE `test2` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `fk` int(10) NULL,
  `texto` char(60) NOT NULL DEFAULT 'default',
  `datade` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `new_field` int(10) NULL,
  PRIMARY KEY (`id`,`new_field`),
  KEY `FK__test1` (`fk`,`texto`),
  UNIQUE KEY `FK__test1` (`datade`),
  CONSTRAINT `FK__test3` FOREIGN KEY (`id`) REFERENCES `test` (`test1`)
  CONSTRAINT `FK__test3` FOREIGN KEY (`fk`) REFERENCES `test3` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 COMMENT='test1';

Modified regexp to accept unsigned decimal columns
@camcima camcima merged commit 3fbe9a1 into camcima:master Nov 2, 2017
@ccerrillo ccerrillo deleted the hotfix/decimal-unsigned-not-detected branch November 2, 2017 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants