-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrimTransactionsTable.sql
More file actions
22 lines (18 loc) · 1.06 KB
/
trimTransactionsTable.sql
File metadata and controls
22 lines (18 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*trimTransactionsTable.sql*/
ALTER TABLE raw_committee_transactions DROP COLUMN IF EXISTS last_updated;
ALTER TABLE raw_committee_transactions DROP COLUMN IF EXISTS filer_vectors;
ALTER TABLE raw_committee_transactions DROP COLUMN IF EXISTS contributor_payee_vectors;
ALTER TABLE raw_committee_transactions DROP COLUMN IF EXISTS purp_desc_vectors;
ALTER TABLE raw_committee_transactions DROP COLUMN IF EXISTS all_vectors;
CREATE TABLE tmp_transactions AS SELECT * FROM raw_committee_transactions;
DROP TABLE raw_committee_transactions;
CREATE TABLE raw_committee_transactions AS SELECT * FROM tmp_transactions;
DROP TABLE tmp_transactions;
ALTER TABLE raw_committees DROP COLUMN IF EXISTS last_updated;
ALTER TABLE raw_committees DROP COLUMN IF EXISTS committee_name_vectors;
ALTER TABLE raw_committees DROP COLUMN IF EXISTS measure_vectors;
ALTER TABLE raw_committees DROP COLUMN IF EXISTS all_vectors;
CREATE TABLE tmp_committees AS SELECT * FROM raw_committees;
DROP TABLE raw_committees;
CREATE TABLE raw_committees AS SELECT * FROM tmp_committees;
DROP TABLE tmp_committees;