feat: prepare ARR for controlled public deployment
This commit is contained in:
17
database/004_refresh_active_daily_facts_view.sql
Normal file
17
database/004_refresh_active_daily_facts_view.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- Refresh the records.* expansion after migration 002 added Finance source-link columns.
|
||||
-- PostgreSQL 15+
|
||||
-- Target database: booking_test.
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE OR REPLACE VIEW finance.v_active_daily_facts AS
|
||||
SELECT records.*
|
||||
FROM finance.current_daily_versions AS current_version
|
||||
JOIN finance.daily_records AS records
|
||||
ON records.daily_version_id = current_version.daily_version_id
|
||||
WHERE records.outcome = 'retained';
|
||||
|
||||
COMMENT ON VIEW finance.v_active_daily_facts IS
|
||||
'All columns from retained rows in each business date current active daily version, refreshed after schema migrations add row fields.';
|
||||
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user