Skip to content

fix: fix single quote unescape when the string is only quotes #4595

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

edenstrom
Copy link

This fixes #4349, where a column in the database has an empty value as the default.

Tested on MySQL

Not sure what tests to add for this though.

Table:

CREATE TABLE `countries` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

Result before:

name: varchar({ length: 255 }).default(').notNull(),

Result after:

name: varchar({ length: 255 }).default('').notNull(),

@monster-anshu
Copy link

Thanks much needed

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.

[BUG]:drizzle-kit pull with default varchar or text .default('') does not get generated correctly
2 participants