Skip to content

Commit

Permalink
add migration files
Browse files Browse the repository at this point in the history
  • Loading branch information
minaxolone committed May 31, 2024
1 parent a2b095d commit e33ffde
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 2 deletions.
87 changes: 85 additions & 2 deletions api/olfyiv5-tables.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,93 @@
CREATE TABLE "state" (
CREATE DATABASE IF NOT EXISTS "olfyi_v5" ON CLUSTER "olfyi";

CREATE TABLE "state" ON CLUSTER "olfyi" (
"version" UInt64,
"address" UInt128,
"module_address" UInt128,
"struct_name" String,
"module_name" String,
"payload" String
)
ENGINE = MergeTree
ENGINE = ReplicatedMergeTree
ORDER BY "version";

CREATE TABLE "burn" ON CLUSTER "olfyi" (
"version" UInt64,
"timestamp_usecs" UInt64,
"amount" UInt64,
"currency" String,
"preburn_address" UInt128
)
ENGINE = ReplicatedMergeTree
ORDER BY "version";

CREATE TABLE "create_account" ON CLUSTER "olfyi" (
"version" UInt64,
"timestamp_usecs" UInt64,
"role_id" UInt64,
"created_address" UInt128
)
ENGINE = ReplicatedMergeTree
ORDER BY "version";

CREATE TABLE "mint" ON CLUSTER "olfyi" (
"version" UInt64,
"timestamp_usecs" UInt64,
"amount" UInt64,
"currency" String
)
ENGINE = ReplicatedMergeTree
ORDER BY "version";

CREATE TABLE "new_block" ON CLUSTER "olfyi" (
"version" UInt64,
"timestamp_usecs" UInt64,
"round" UInt64,
"proposer" UInt128,
"proposed_time" UInt64,
"gas_used" UInt64
)
ENGINE = ReplicatedMergeTree
ORDER BY "version";

CREATE TABLE "received_payment" ON CLUSTER "olfyi" (
"version" UInt64,
"timestamp_usecs" UInt64,
"amount" UInt64,
"currency" String,
"sender" UInt128,
"receiver" UInt128,
"metadata" String
)
ENGINE = ReplicatedMergeTree
ORDER BY "version";

CREATE TABLE "sent_payment" ON CLUSTER "olfyi" (
"version" UInt64,
"timestamp_usecs" UInt64,
"amount" UInt64,
"currency" String,
"sender" UInt128,
"receiver" UInt128,
"metadata" String
)
ENGINE = ReplicatedMergeTree
ORDER BY "version";

CREATE TABLE "user_transaction" ON CLUSTER "olfyi" (
"version" UInt64,
"timestamp_usecs" UInt64,
"sender" UInt128,
"sequence_number" UInt64,
"max_gas_amount" UInt64,
"gas_unit_price" UInt64,
"gas_currency" String,
"module_address" UInt128,
"module_name" String,
"function_name" String,
"arguments" Array(String),
"vm_status" String,
"gas_used" UInt64
)
ENGINE = ReplicatedMergeTree
ORDER BY "version";
2 changes: 2 additions & 0 deletions api/olfyiv6-tables.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE DATABASE IF NOT EXISTS olfyi_v6 ON CLUSTER olfyi;

2 changes: 2 additions & 0 deletions api/tables.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
CREATE DATABASE IF NOT EXISTS "olfyi" ON CLUSTER "olfyi";

CREATE TABLE "user_transaction" ON CLUSTER "olfyi" (
"version" UInt64,
"hash" UInt256,
Expand Down

0 comments on commit e33ffde

Please sign in to comment.