© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•4mo ago•
1 reply
Lucas

Error running `drizzle-kit push` after schema update

This is my first time using Drizzle.
After making my first schema change, the generated SQL code contains errors.
DROP TABLE `__new_leads`;
CREATE TABLE `__new_leads` (
        `id` text PRIMARY KEY NOT NULL,
        `cpf` text,
        `email` text,
        `phone` text,
        `date` text NOT NULL
);

INSERT INTO `__new_leads`("id", "cpf", "email", "phone", "date") SELECT "id", "cpf", "email", "phone", "date" FROM `leads`;
DROP TABLE `leads`;
ALTER TABLE `__new_leads` RENAME TO `leads`;
DROP TABLE `__new_leads`;
CREATE TABLE `__new_leads` (
        `id` text PRIMARY KEY NOT NULL,
        `cpf` text,
        `email` text,
        `phone` text,
        `date` text NOT NULL
);

INSERT INTO `__new_leads`("id", "cpf", "email", "phone", "date") SELECT "id", "cpf", "email", "phone", "date" FROM `leads`;
DROP TABLE `leads`;
ALTER TABLE `__new_leads` RENAME TO `leads`;

The schema went from
id, cpf, date
id, cpf, date
to
id, cpf, email, phone, date
id, cpf, email, phone, date
.
It tries to query the leads column which does not exist in the previous table.
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

drizzle-kit migration schema push error
Drizzle TeamDTDrizzle Team / help
2y ago
drizzle-kit push error
Drizzle TeamDTDrizzle Team / help
2y ago
Error running npx drizzle-kit push:mysql
Drizzle TeamDTDrizzle Team / help
3y ago
drizzle-kit push ignores SQL schema
Drizzle TeamDTDrizzle Team / help
8mo ago