sqlectron / sqlectron-core

Home Page:https://sqlectron.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix failing test for mysql 8

MasterOdin opened this issue · comments

  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)

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.