Skip to content

Commit a49979d

Browse files
macpieconnormck333bbalser
authored
Create migration test (#1062)
* Create migration test * Update tracker * Fix gateway DB calls * Fix Clippy * PR comments * Add some print to debug * Fix timestamp check * Added new API for retrieving historical gateway info * Add v1 to historical gateway info protobuf * Refactored gateway service reducing code dupe * Changed proto branch * Fixed formatting errors * Gateway historical info test assertions updated * Fixed formatting errors * Fixed formatting errors * Increased sleep in historical info test * Tests cleanup, removed println, changed assert! to assert_eq * Removed sleep from test * Updated gateway tracker test name & reduced test size * Removed println in tests * Add info_historical command to mobile_config_cli * Changed historical info to info_at_timestamp * Update mobile verifiers to use new info_at_timestamp API * Revert "Update mobile verifiers to use new info_at_timestamp API" This reverts commit e83d7b8. * Updated metric name * Reverted proto branch to master * Update Cargo.lock * Revert "Update Cargo.lock" This reverts commit 8263ea8. * Update helium-proto Cargo.lock * Attempt to cleanup runner * another attempt * attempt free disk space action * Remove cleanup jobs --------- Co-authored-by: Connor McKenzie <[email protected]> Co-authored-by: Brian Balser <[email protected]>
1 parent e2ff00c commit a49979d

File tree

23 files changed

+1030
-425
lines changed

23 files changed

+1030
-425
lines changed

Cargo.lock

Lines changed: 33 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

file_store_oracles/src/traits/msg_verify.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ impl_msg_verify!(mobile_config::GatewayInfoStreamResV3, signature);
102102
impl_msg_verify!(mobile_config::BoostedHexInfoStreamReqV1, signature);
103103
impl_msg_verify!(mobile_config::BoostedHexModifiedInfoStreamReqV1, signature);
104104
impl_msg_verify!(mobile_config::BoostedHexInfoStreamResV1, signature);
105+
impl_msg_verify!(mobile_config::GatewayInfoAtTimestampReqV1, signature);
105106
impl_msg_verify!(sub_dao::SubDaoEpochRewardInfoReqV1, signature);
106107
impl_msg_verify!(sub_dao::SubDaoEpochRewardInfoResV1, signature);
107108
impl_msg_verify!(poc_mobile::SubscriberVerifiedMappingEventReqV1, signature);

mobile_config/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,4 @@ tls-init = { path = "../tls_init" }
6161
[dev-dependencies]
6262
rand = { workspace = true }
6363
tokio-stream = { workspace = true, features = ["net"] }
64+
tempfile = "3"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
-- 1. Drop the primary key constraint on address
2+
ALTER TABLE
3+
gateways DROP CONSTRAINT IF EXISTS gateways_pkey;
4+
5+
-- 2. Rename column updated_at -> inserted_at
6+
ALTER TABLE
7+
gateways RENAME COLUMN updated_at TO inserted_at;
8+
9+
-- 3. Backfill inserted_at with created_at values
10+
UPDATE
11+
gateways
12+
SET
13+
inserted_at = created_at;
14+
15+
-- 4. Ensure inserted_at is NOT NULL and has a default value of now()
16+
ALTER TABLE
17+
gateways
18+
ALTER COLUMN inserted_at SET DEFAULT now(),
19+
ALTER COLUMN inserted_at SET NOT NULL;
20+
21+
-- 5. Create an index on (address, inserted_at DESC)
22+
CREATE INDEX IF NOT EXISTS gateways_address_inserted_idx ON gateways (address, inserted_at DESC);
23+
24+
-- 6. Create an PK on (address, inserted_at DESC)
25+
ALTER TABLE
26+
gateways
27+
ADD
28+
CONSTRAINT gateways_pkey PRIMARY KEY (address, inserted_at);

0 commit comments

Comments
 (0)