Skip to content

Commit 8d8e809

Browse files
fix(fortuna): migrate timestamp columns to bigint (#2938)
* fix(fortuna): migrate timestamp columns integer -> bigint * fix(fortuna): migrate timestamp columns integer -> bigint * bump ver * fix(fortuna): add Bytes utoipa schema
1 parent 1f1c17f commit 8d8e809

File tree

7 files changed

+12
-16
lines changed

7 files changed

+12
-16
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/fortuna/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fortuna"
3-
version = "9.1.2"
3+
version = "9.2.0"
44
edition = "2021"
55

66
[lib]

apps/fortuna/migrations/20250801232728_add_callback_fields.down.sql

Lines changed: 0 additions & 4 deletions
This file was deleted.

apps/fortuna/migrations/20250801232728_add_callback_fields.up.sql

Lines changed: 0 additions & 4 deletions
This file was deleted.

apps/fortuna/migrations/20250707000000_init.up.sql renamed to apps/fortuna/migrations/20250807000000_init.up.sql

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ CREATE TABLE request(
33
network_id INTEGER NOT NULL,
44
provider VARCHAR(40) NOT NULL,
55
sequence INTEGER NOT NULL,
6-
created_at INTEGER NOT NULL,
7-
last_updated_at INTEGER NOT NULL,
6+
created_at BIGINT NOT NULL,
7+
last_updated_at BIGINT NOT NULL,
88
state VARCHAR(10) NOT NULL,
99
request_block_number INTEGER NOT NULL,
1010
request_tx_hash VARCHAR(64) NOT NULL,
@@ -16,9 +16,11 @@ CREATE TABLE request(
1616
info TEXT,
1717
gas_used VARCHAR(100),
1818
gas_limit VARCHAR(100) NOT NULL,
19+
callback_failed INTEGER,
20+
callback_return_value VARCHAR,
21+
callback_gas_used VARCHAR(100),
1922
PRIMARY KEY (network_id, sequence, provider, request_tx_hash)
2023
);
21-
2224
CREATE INDEX request__network_id__state__created_at ON request(network_id, state, created_at);
2325
CREATE INDEX request__network_id__created_at ON request(network_id, created_at);
2426
CREATE INDEX request__sender__network_id__state__created_at ON request(sender, network_id, state, created_at);
@@ -31,6 +33,7 @@ CREATE INDEX request__sequence__state__created_at ON request(sequence, state, cr
3133
CREATE INDEX request__sequence__created_at ON request(sequence, created_at);
3234
CREATE INDEX request__state__created_at ON request(state, created_at);
3335
CREATE INDEX request__created_at ON request(created_at);
34-
35-
CREATE INDEX request__request_tx_hash ON request (request_tx_hash) WHERE request_tx_hash IS NOT NULL;
36-
CREATE INDEX request__reveal_tx_hash ON request (reveal_tx_hash) WHERE reveal_tx_hash IS NOT NULL;
36+
CREATE INDEX request__request_tx_hash ON request (request_tx_hash)
37+
WHERE request_tx_hash IS NOT NULL;
38+
CREATE INDEX request__reveal_tx_hash ON request (reveal_tx_hash)
39+
WHERE reveal_tx_hash IS NOT NULL;

apps/fortuna/src/history.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pub enum RequestEntryState {
5151
/// the error code and any additional returned data. Note that "" often indicates an out-of-gas error.
5252
/// If the callback returns more than 256 bytes, only the first 256 bytes of the callback return value are included.
5353
/// NOTE: This field is the raw bytes returned from the callback, not hex-decoded. The client should decode it as needed.
54+
#[schema(example = "0x4e487b710000000000000000000000000000000000000000000000000000000000000011", value_type = String)]
5455
callback_return_value: Bytes,
5556
/// How much gas the callback used.
5657
#[schema(example = "567890", value_type = String)]

0 commit comments

Comments
 (0)