Archive old migrations (#426)

* Archive old migrations

* Fix invalid placement of migrations
This commit is contained in:
Rikard Bartholf
2024-10-17 11:19:12 +02:00
committed by GitHub
parent 763262c108
commit ddcbd0afb0
500 changed files with 0 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
DROP VIEW IF EXISTS v_order_emails;
CREATE VIEW v_order_emails AS
select
orders.id order_id,
orders.inserted::date order_date,
billing.email billing_email,
billing.first_name billing_firstname,
billing.last_name billing_lastname
from
orders
left join addresses billing on billing_address_id = billing.id
where
orders.paid = 1
;
-- If we want to read this with direct access from BigQuery to Postgres:
-- CREATE USER bigquery WITH PASSWORD 'secret';
-- GRANT SELECT ON v_order_emails TO bigquery;
-- GRANT USAGE ON SCHEMA public TO bigquery;
-- We don't need this now as we will access the view ourselves instead and get the results to BigQuery via S3.