Drizzle push not respecting .existing views. Have to drop the view everytime i change schema

Like the title says, everytime i change my schema and push it via npx drizzle-kit push. It prompts me to drop the view table.
export const eventStatsView = pgView("inve_event_stats_view", {

}).existing();
export const eventStatsView = pgView("inve_event_stats_view", {

}).existing();
so whenever i push schema changes drizzle doesnt prompt me to drop the table to make changes. However, even after putting the view in my schema.ts, whenever i push i still get a prompt to drop the view!
➜ INVE git:(development) ✗ npx drizzle-kit push
drizzle-kit: v0.21.4
drizzle-orm: v0.30.10

No config path provided, using default path
Reading config file '/Users/genio/Developer/INVE-APPS/INVE/INVE/drizzle.config.ts'
Using 'postgres' driver for database querying
+ INVE_event_messages table will be created
+ INVE_qr_guests_entry table will be created
--- all table conflicts resolved ---

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

THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED

Do you still want to push changes?
[x] All changes were aborted
➜ INVE git:(development) ✗ npx drizzle-kit push
drizzle-kit: v0.21.4
drizzle-orm: v0.30.10

No config path provided, using default path
Reading config file '/Users/genio/Developer/INVE-APPS/INVE/INVE/drizzle.config.ts'
Using 'postgres' driver for database querying
+ INVE_event_messages table will be created
+ INVE_qr_guests_entry table will be created
--- all table conflicts resolved ---

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

THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED

Do you still want to push changes?
[x] All changes were aborted
Because the view is complex, i created it in the database directly via SQL. Then in drizzle i should just say its existing and it shouldnt care about it and ignore it right? But that doesnt seem to be the case, so how can i instruct drizzle to trust me and just ignore it haha I would appreciate it if i could get a calrafication on how to properly handle this. Thank you
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?