sqlectron / sqlectron-core

https://sqlectron.github.io/
MIT License
221 stars 69 forks source link

Fix failing test for mysql 8 #78

Closed MasterOdin closed 4 years ago

MasterOdin commented 4 years ago
  1) db
       mysql
         given is already connected
           .getTableCreateScript
             should return table create script:
     AssertionError: expected 'CREATE TABLE `users` (\n  `id` int NOT NULL AUTO_INCREMENT,\n  `username` varchar(45) DEFAULT NULL,\n  `email` varchar(150) DEFAULT NULL,\n  `password` varchar(45) DEFAULT NULL,\n  `role_id` int DEFAULT NULL,\n  `createdat` datetime DEFAULT NULL,\n  PRIMARY KEY (`id`),\n  KEY `role_id` (`role_id`),\n  CONSTRAINT `users_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci' to include 'CREATE TABLE `users` (\n  `id` int(11) NOT NULL AUTO_INCREMENT,\n  `username` varchar(45) DEFAULT NULL,\n  `email` varchar(150) DEFAULT NULL,\n  `password` varchar(45) DEFAULT NULL,\n  `role_id` int(11) DEFAULT NULL,\n  `createdat` datetime DEFAULT NULL,\n  PRIMARY KEY (`id`),\n  KEY `role_id` (`role_id`),\n  CONSTRAINT `users_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB'
      at Context.<anonymous> (spec/db.spec.js:307:39)
      at Generator.next (<anonymous>)
      at step (spec/db.spec.js:31:191)
      at /home/runner/work/sqlectron-core/sqlectron-core/spec/db.spec.js:31:361
      at process._tickCallback (internal/process/next_tick.js:68:7)
MasterOdin commented 4 years ago

This failure is expected as display width for integers is deprecated in mysql 8 (see https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html) because they did not actually do what people thought they did, as they were just a display helper, not a limit on size of the field.