-- Move page_configs data from db_events to db_blog.
-- Run after split-databases.sh if page_configs data ended up in db_events.
--
-- Usage:
--   PGHOST=db PGUSER=postgres PGPASSWORD=change-me psql -f move-page-configs.sql
--

-- Step 1: Dump page_configs from db_events into db_blog
\c db_events
COPY page_configs TO '/tmp/page_configs.csv' WITH CSV HEADER;

\c db_blog
TRUNCATE page_configs;
COPY page_configs FROM '/tmp/page_configs.csv' WITH CSV HEADER;

-- Step 2: Verify
SELECT count(*) AS blog_page_configs FROM page_configs;
