drizzle-team / drizzle-kit-mirror

Docs and issues repository for drizzle-kit
289 stars 17 forks source link

[Bug]: `extensionsFilters: ["postgis"]` does not work #447

Open MellKam opened 4 months ago

MellKam commented 4 months ago

I tried to use drizzle-kit push with new extensionsFilter for postgis, but it still propmts me to delete postgis tables

Warning  Found data-loss statements:
· You're about to delete geometry_columns table with 13 items
· You're about to delete spatial_ref_sys table with 8500 items

THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED

or thinks that I wanted to rename them

Is conference_categories table created or renamed from another table?
❯ + conference_categories                     create table
  ~ geography_columns › conference_categories rename table
  ~ geometry_columns › conference_categories  rename table
  ~ spatial_ref_sys › conference_categories   rename table
AndriiSherman commented 4 months ago

checking that

drwpwrs commented 4 months ago

In case it's helpful:

drizzle-kit 0.22.1, drizzle-orm 0.31.0

MellKam commented 4 months ago

@drwpwrs Yeah, I also tried tablesFilter: ['!(geography_columns|geometry_columns|spatial_ref_sys)'], but it doesn't really work

mifreudenthaler commented 3 months ago

having the same issue. Any news regarding this, or any known workaround? thanks

Edit: @MellKam @drwpwrs I found a workaround. in the docs it states that tablesFilter works exactly the opposite way. We have to add all our tables to the tablesFilter and it works as expected:

{
...,
tablesFilter: [users, customers, orders, order_items, ...],
...
}