Lash/add filter

This commit is contained in:
Louis Holbrook
2021-04-04 13:03:58 +00:00
parent 82e2674555
commit 673d80774a
17 changed files with 641 additions and 130 deletions

View File

@@ -1,4 +1,4 @@
DROP TABLE chain_sync;
DROP TABLE IF EXISTS chain_sync CASCADE;
CREATE TABLE IF NOT EXISTS chain_sync (
id serial primary key not null,
blockchain varchar not null,
@@ -6,21 +6,7 @@ CREATE TABLE IF NOT EXISTS chain_sync (
tx_start int not null default 0,
block_cursor int not null default 0,
tx_cursor int not null default 0,
flags bytea not null,
num_flags int not null,
block_target int default null,
date_created timestamp not null,
date_updated timestamp default null
);
DROP TABLE chain_sync_filter;
CREATE TABLE IF NOT EXISTS chain_sync_filter (
id serial primary key not null,
chain_sync_id int not null,
flags bytea default null,
count int not null default 0,
digest char(64) not null default '0000000000000000000000000000000000000000000000000000000000000000',
CONSTRAINT fk_chain_sync
FOREIGN KEY(chain_sync_id)
REFERENCES chain_sync(id)
);

12
sql/postgresql/2.sql Normal file
View File

@@ -0,0 +1,12 @@
DROP TABLE IF EXISTS chain_sync_filter;
CREATE TABLE IF NOT EXISTS chain_sync_filter (
id serial primary key not null,
chain_sync_id integer not null,
flags bytea default null,
flags_start bytea default null,
count integer not null default 0,
digest char(64) not null,
CONSTRAINT fk_chain_sync
FOREIGN KEY(chain_sync_id)
REFERENCES chain_sync(id)
);

View File

@@ -1,13 +1,11 @@
CREATE TABLE IF NOT EXISTS chain_sync (
id serial primary key not null,
id integer primary key autoincrement,
blockchain varchar not null,
block_start int not null default 0,
tx_start int not null default 0,
block_cursor int not null default 0,
tx_cursor int not null default 0,
flags bytea not null,
num_flags int not null,
block_target int default null,
block_start integer not null default 0,
tx_start integer not null default 0,
block_cursor integer not null default 0,
tx_cursor integer not null default 0,
block_target integer default null,
date_created timestamp not null,
date_updated timestamp default null
);

View File

@@ -1,9 +1,10 @@
CREATE TABLE IF NOT EXISTS chain_sync_filter (
id serial primary key not null,
chain_sync_id int not null,
id integer primary key autoincrement not null,
chain_sync_id integer not null,
flags bytea default null,
count int not null default 0,
digest char(64) not null default '0000000000000000000000000000000000000000000000000000000000000000',
flags_start bytea default null,
count integer not null default 0,
digest char(64) not null,
CONSTRAINT fk_chain_sync
FOREIGN KEY(chain_sync_id)
REFERENCES chain_sync(id)