-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deploy/migrations): fix 025 migration order and add dbt model me…
…tadata
- Loading branch information
Showing
3 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
9 changes: 4 additions & 5 deletions
9
deploy/migrations/clickhouse/025_rm_beacon_attestation_signature.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
ALTER TABLE default.beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' | ||
DROP COLUMN signature; | ||
|
||
ALTER TABLE default.beacon_api_eth_v1_events_attestation ON CLUSTER '{cluster}' | ||
DROP COLUMN signature; | ||
|
||
|
||
ALTER TABLE default.beacon_p2p_attestation_local ON CLUSTER '{cluster}' | ||
ALTER TABLE default.beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' | ||
DROP COLUMN signature; | ||
|
||
ALTER TABLE default.beacon_p2p_attestation ON CLUSTER '{cluster}' | ||
DROP COLUMN signature; | ||
|
||
ALTER TABLE default.beacon_p2p_attestation_local ON CLUSTER '{cluster}' | ||
DROP COLUMN signature; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DROP TABLE IF EXISTS model_metadata on cluster '{cluster}' SYNC; | ||
DROP TABLE IF EXISTS model_metadata_local on cluster '{cluster}' SYNC; |
17 changes: 17 additions & 0 deletions
17
deploy/migrations/clickhouse/026_dbt_model_metadata.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
CREATE TABLE dbt.model_metadata_local on cluster '{cluster}' | ||
( | ||
model LowCardinality(String), | ||
updated_date_time DateTime Codec(ZSTD(1)), | ||
last_run_date_time DateTime Codec(ZSTD(1)) | ||
) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) | ||
PARTITION BY model | ||
ORDER BY (model); | ||
|
||
ALTER TABLE dbt.model_metadata_local ON CLUSTER '{cluster}' | ||
MODIFY COMMENT 'Stores metadata about the dbt model run', | ||
COMMENT COLUMN model 'Source of the data that was imported', | ||
COMMENT COLUMN updated_date_time 'When this row was last updated', | ||
COMMENT COLUMN last_run_date_time 'The end date the model was last run with'; | ||
|
||
CREATE TABLE dbt.model_metadata on cluster '{cluster}' AS dbt.model_metadata_local | ||
ENGINE = Distributed('{cluster}', dbt, model_metadata_local, cityHash64(model)); |