Skip to content

Commit 39e4018

Browse files
committed
feat: aggregated proofs migration
1 parent 95337bf commit 39e4018

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
defmodule Explorer.Repo.Migrations.CreateAggregatedProofs do
2+
use Ecto.Migration
3+
4+
def change do
5+
create table(:aggregated_proofs, primary_key: false) do
6+
add(:number, :integer, primary_key: true)
7+
add(:merkle_root, :string)
8+
add(:status, :integer)
9+
add(:tx_hash, :string)
10+
add(:blob_versioned_hash, :string)
11+
add(:number_of_proofs, :integer)
12+
add(:block_number, :integer)
13+
14+
timestamps()
15+
end
16+
17+
create table(:proofs_agg_mode) do
18+
add(
19+
:aggregated_proof_number,
20+
references(:aggregated_proofs, column: :number, type: :integer, on_delete: :delete_all)
21+
)
22+
23+
add(:proof_hash, :string)
24+
add(:index, :integer)
25+
26+
timestamps()
27+
end
28+
29+
create(index(:proofs_agg_mode, [:aggregated_proof_number]))
30+
end
31+
end

0 commit comments

Comments
 (0)