-- Drops postgis-image extras that we don't use.
--
-- The postgis/postgis:16-3.4 base image's own init (10_postgis.sh) installs:
--   postgis, postgis_topology, fuzzystrmatch, postgis_tiger_geocoder
--
-- We only need `postgis` proper. The TIGER geocoder is a US Census Bureau dataset
-- (~35 tables, ~10 MB) that's irrelevant for РФ-region work. Topology and
-- fuzzystrmatch are unused too.
--
-- This script lives in /docker-entrypoint-initdb.d/ and runs ONCE on a fresh
-- volume, alphabetically AFTER 10_postgis.sh — so it sees a fully-extended DB
-- and trims the parts we don't need.
--
-- IF EXISTS + CASCADE: idempotent, won't fail if extension is already gone.

DROP EXTENSION IF EXISTS postgis_tiger_geocoder CASCADE;
DROP EXTENSION IF EXISTS postgis_topology CASCADE;
DROP EXTENSION IF EXISTS fuzzystrmatch CASCADE;

-- Empty schemas the dropped extensions left behind.
DROP SCHEMA IF EXISTS tiger CASCADE;
DROP SCHEMA IF EXISTS tiger_data CASCADE;
DROP SCHEMA IF EXISTS topology CASCADE;
