We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
drizzle-orm
0.30.10
drizzle-kit
0.21.0
database
MySQL
When generating a schema with the introspect command for a database that has columns with double type columns, import is not inserted.
This is because double is not taken into account in the logic that determines whether or not to insert an import.
const columnImports = Object.values(it.columns).map((col) => { let patched = importsPatch[col.type] ?? col.type; patched = patched.startsWith("varchar(") ? "varchar" : patched; patched = patched.startsWith("char(") ? "char" : patched; patched = patched.startsWith("binary(") ? "binary" : patched; patched = patched.startsWith("decimal(") ? "decimal" : patched; patched = patched.startsWith("smallint(") ? "smallint" : patched; patched = patched.startsWith("enum(") ? "mysqlEnum" : patched; patched = patched.startsWith("datetime(") ? "datetime" : patched; patched = patched.startsWith("varbinary(") ? "varbinary" : patched; patched = patched.startsWith("int(") ? "int" : patched; return patched; })
If a column uses type double, import is correctly inserted.
The following patch can be applied as a workaround until this issue is resolved.
diff --git a/bin.cjs b/bin.cjs index fef2511d2e2d69c877fc925c281d88aa828f150f..12c700646dd7e88184b6a38f604d26f3fa32953a 100755 --- a/bin.cjs +++ b/bin.cjs @@ -107701,6 +107701,7 @@ var init_introspect_mysql = __esm({ patched = patched.startsWith("datetime(") ? "datetime" : patched; patched = patched.startsWith("varbinary(") ? "varbinary" : patched; patched = patched.startsWith("int(") ? "int" : patched; + patched = patched.startsWith("double(") ? "double" : patched; return patched; }).filter((type) => { return mysqlImportsList.has(type);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What version of
drizzle-orm
are you using?0.30.10
What version of
drizzle-kit
are you using?0.21.0
What type of
database
are you using?MySQL
Describe the Bug
When generating a schema with the introspect command for a database that has columns with double type columns, import is not inserted.
This is because double is not taken into account in the logic that determines whether or not to insert an import.
Expected behavior
If a column uses type double, import is correctly inserted.
Patch
The following patch can be applied as a workaround until this issue is resolved.
The text was updated successfully, but these errors were encountered: