Skip to content

Commit 6af65cf

Browse files
committed
minor refactoring - sql schema updated
1 parent 67c78b9 commit 6af65cf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/resources/sql/event_sourcing.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
-- ########################
44

55
-- Registered deciders and the respectful events that these deciders can publish (decider can publish and/or source its own state from these event types only)
6+
DROP TABLE IF EXISTS deciders CASCADE;
67
CREATE TABLE IF NOT EXISTS deciders
78
(
89
-- decider name/type

src/main/resources/sql/event_streaming.sql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
-- The views table is a registry of all views/subscribers that are able to subscribe to all events with a "pooling_delay" frequency.
77
-- You can not start consuming events without previously registering the view.
88
-- see: `stream_events` function
9-
CREATE TABLE views
9+
DROP TABLE IF EXISTS views CASCADE;
10+
CREATE TABLE IF NOT EXISTS views
1011
(
1112
-- view identifier/name
1213
"view" TEXT,
@@ -46,8 +47,6 @@ CREATE TABLE IF NOT EXISTS locks
4647
FOREIGN KEY ("view") REFERENCES views ("view") ON DELETE CASCADE
4748
);
4849

49-
CREATE INDEX IF NOT EXISTS locks_index ON locks ("decider_id", "locked_until", "last_offset");
50-
5150
-- SIDE EFFECT: before_update_views_table - automatically bump "updated_at" when modifying a view
5251
CREATE OR REPLACE FUNCTION "before_update_views_table"() RETURNS trigger AS
5352
'

0 commit comments

Comments
 (0)