Open pedrovrima opened 11 months ago
Fixing, thanks!
@pedrovrima can't reproduce it. Could you send me a create table
statements with which I can reproduce it?
This is part of the .SQL drop of the db that generated the above error. Not sure if it makes a difference, but this was created with Sequelize years ago, dumped and then imported to planet scale. Introspecting from planet scale is generating the default("NULL")
CREATE TABLE `BANDER_REGISTER` (
`bander_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL COMMENT 'null',
`code` varchar(3) NOT NULL COMMENT 'null',
`email` varchar(45) NOT NULL COMMENT 'null',
`phone` varchar(14) NOT NULL COMMENT 'null',
`notes` varchar(250) NOT NULL COMMENT 'null',
`created_at` datetime NOT NULL DEFAULT current_timestamp(),
`original_id` int(11) DEFAULT NULL COMMENT 'null',
`updated_at` datetime DEFAULT NULL COMMENT 'null',
`has_changed` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`bander_id`)
);
Strange, just did the same schema and can't see any default("NULL")
after introspection. I'm using drizzle-kit@0.19.11
I'm also using mysql2@2.3.3
, maybe you have v3?
We will bundle specific driver versions inside drizzle-kit, so it won't make a difference between environments. Didn't have a chance to do it yet
yep - have mysql2@3.4.1
and drizzle-kit@0.18.1
.
So at the latest it should work well, should we close this issue then?
I'll give it a shot later today, but i guess so!
Hey @AndriiSherman , just updated drizzle-kit to 0.19.2 and this issue persists. I am reopening this issue, if you don't mind.
Actually, from PlanetScale it works just fine. the .DEFAULT("NULL") is being generated when I introspect from a MySQL DB hosted in a A2Hosting server
I am not sure if this is actually a bug or not, but my db had some DEFAULT NULL in it which were introspected as .default("NULL").
This triggers a TS errors if the variable is int(), for example. Since it is not needed in MySQL, I would recommend ignoring these statements when introspecting.