forked from boschresearch/catena-x-edc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.sql
55 lines (46 loc) · 1.45 KB
/
schema.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--
-- Copyright (c) 2022 ZF Friedrichshafen AG
--
-- This program and the accompanying materials are made available under the
-- terms of the Apache License, Version 2.0 which is available at
-- https://www.apache.org/licenses/LICENSE-2.0
--
-- SPDX-License-Identifier: Apache-2.0
--
-- Contributors:
-- ZF Friedrichshafen AG - Initial SQL Query
--
-- Statements are designed for and tested with Postgres only!
-- table: edc_cpadapter_queue
CREATE TABLE IF NOT EXISTS edc_lease
(
leased_by VARCHAR NOT NULL,
leased_at BIGINT,
lease_duration INTEGER NOT NULL,
lease_id VARCHAR NOT NULL
CONSTRAINT lease_pk
PRIMARY KEY
);
CREATE TABLE IF NOT EXISTS edc_cpadapter_queue
(
id VARCHAR NOT NULL,
created_at BIGINT NOT NULL,
channel VARCHAR,
message JSON,
invoke_after BIGINT NOT NULL,
lease_id VARCHAR
CONSTRAINT cpadapter_queue_lease_lease_id_fk
REFERENCES edc_lease
ON DELETE SET NULL,
PRIMARY KEY (id)
);
CREATE UNIQUE INDEX IF NOT EXISTS edc_cpadapter_queue_id_uindex
ON edc_cpadapter_queue (id);
CREATE TABLE IF NOT EXISTS edc_cpadapter_object_store
(
id VARCHAR NOT NULL,
created_at BIGINT NOT NULL,
type VARCHAR,
object JSON,
PRIMARY KEY (id)
);