Error when executing drizzle-kit push

I have a view in my db, 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?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server