© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago
JP

Error when executing drizzle-kit push

I have a view in my db,
debug-view
debug-view
here is the definition in the schema:
export const debugView = mysqlView("debug_view", {
    t: varchar("t", { length: 5 }),
    err: mysqlEnum("err", ['default','success','failed','error','exception','warn','info','important']).default('default').notNull(),
    schema: varchar("schema", { length: 255 }).notNull(),
    event: varchar("event", { length: 50 }).notNull(),
    waiting_events: varchar("waiting_events", { length: 10 }),
    res_id: varchar("res_id", { length: 255 }),
    state: varchar("state", { length: 255 }).notNull(),
    type: varchar("type", { length: 255 }),
    label: varchar("label", { length: 255 }).notNull(),
    failed_as_text: text("failed_as_text"),
    failed: json("failed"),
    conditions: json("conditions"),
    data: json("data"),
}).existing();
export const debugView = mysqlView("debug_view", {
    t: varchar("t", { length: 5 }),
    err: mysqlEnum("err", ['default','success','failed','error','exception','warn','info','important']).default('default').notNull(),
    schema: varchar("schema", { length: 255 }).notNull(),
    event: varchar("event", { length: 50 }).notNull(),
    waiting_events: varchar("waiting_events", { length: 10 }),
    res_id: varchar("res_id", { length: 255 }),
    state: varchar("state", { length: 255 }).notNull(),
    type: varchar("type", { length: 255 }),
    label: varchar("label", { length: 255 }).notNull(),
    failed_as_text: text("failed_as_text"),
    failed: json("failed"),
    conditions: json("conditions"),
    data: json("data"),
}).existing();

when I run drizzle-kit push, I'm getting this output:
[✓] Pulling schema from database...
Reading schema files:
C:\prg\work\newcomers\app\backend\src\db\schema.ts

 Warning  Found data-loss statements:
· You're about to delete debug_view table with 583 items

THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED

Do you still want to push changes?
❯ No, abort
  Yes, I want to remove 1 table,
[✓] Pulling schema from database...
Reading schema files:
C:\prg\work\newcomers\app\backend\src\db\schema.ts

 Warning  Found data-loss statements:
· You're about to delete debug_view table with 583 items

THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED

Do you still want to push changes?
❯ No, abort
  Yes, I want to remove 1 table,

Having this definition or not does not make any difference.
I can't pass this point, the only way to continue having that view is to remove it from the DB, make the push, and re-create it.
Any advice?
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 push error
Drizzle TeamDTDrizzle Team / help
2y ago
drizzle-kit push
Drizzle TeamDTDrizzle Team / help
5mo ago
Error with drizzle-kit push
Drizzle TeamDTDrizzle Team / help
16mo ago
Error when calling drizzle-kit push:pg again
Drizzle TeamDTDrizzle Team / help
3y ago