Trouble with tablesFilter
Im running a PostgreSQL Database to which i recently added the PostGIS extension. However if i try to push my schema it prompts me if i want to delete the tables "spatial_ref_sys" and "geometry_columns" both are created by the PostGIS extension. I dont want to delete those tables. But i also don't want to integrate them into my schema since they are managed by the extension. To try and combat this problem i added tablesFilter to my drizzle config.
tablesFilter: ["!spatial_ref_sys","!geometry_columns"],
This however changes nothing. But if i remove either of those filters it correctly filters out the table that i left in.
Is there anything im missing?
5 Replies
without having read the documentation, logically that behaviour makes sense:
!spatial_ref_sys will match geometry columns, and vice versa.
maybe there's a way to blacklist instead of whitelisting? or a way to combine boolean logic so "!spatial_ref_sys && !geometrycolumns"
you could also consider using pgTableCreator for prepending a known string you can match against "example*"
Try a single filter of the form
!@(spatial_ref_sys|geometry_columns)
Or you could also put those tables in a separate schema and use schemaFilterThat worked, thanks a bunch 🙂
@laf_RSW which solution did you apply? The form filtrr or moving these tables to another schema?
@aleix10kst thr form filter worked for me