-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy path20241030141929_dips.up.sql
36 lines (28 loc) · 1.13 KB
/
20241030141929_dips.up.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
-- Add up migration script here
CREATE TABLE IF NOT EXISTS indexing_agreements (
id UUID PRIMARY KEY,
signature BYTEA NOT NULL,
signed_payload BYTEA NOT NULL,
protocol_network VARCHAR(255) NOT NULL,
chain_id VARCHAR(255) NOT NULL,
base_price_per_epoch NUMERIC(39) NOT NULL,
price_per_entity NUMERIC(39) NOT NULL,
subgraph_deployment_id VARCHAR(255) NOT NULL,
service CHAR(40) NOT NULL,
payee CHAR(40) NOT NULL,
payer CHAR(40) NOT NULL,
deadline TIMESTAMP WITH TIME ZONE NOT NULL,
duration_epochs BIGINT NOT NULL,
max_initial_amount NUMERIC(39) NOT NULL,
max_ongoing_amount_per_epoch NUMERIC(39) NOT NULL,
min_epochs_per_collection BIGINT NOT NULL,
max_epochs_per_collection BIGINT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
cancelled_at TIMESTAMP WITH TIME ZONE,
signed_cancellation_payload BYTEA,
current_allocation_id CHAR(40),
last_allocation_id CHAR(40),
last_payment_collected_at TIMESTAMP WITH TIME ZONE
);
CREATE UNIQUE INDEX IX_UNIQ_SIGNATURE_AGREEMENT on indexing_agreements(signature);