Skip to content

Commit

Permalink
Remove unneeded timestamp field from db
Browse files Browse the repository at this point in the history
  • Loading branch information
serverlesstechnology authored and Dave Garred committed Mar 31, 2022
1 parent 4dd16d7 commit d762a0d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions db/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ CREATE TABLE events
event_version text NOT NULL,
payload json NOT NULL,
metadata json NOT NULL,
timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT events_pk PRIMARY KEY (aggregate_type, aggregate_id, sequence)
);

Expand All @@ -20,7 +19,6 @@ CREATE TABLE snapshots
last_sequence bigint CHECK (last_sequence >= 0) NOT NULL,
current_snapshot bigint CHECK (current_snapshot >= 0) NOT NULL,
payload json NOT NULL,
timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT snapshots_pk PRIMARY KEY (aggregate_type, aggregate_id)
);

Expand All @@ -34,7 +32,7 @@ CREATE TABLE test_view
CONSTRAINT test_view_pk PRIMARY KEY (view_id)
);

INSERT INTO events (aggregate_type, aggregate_id, sequence, event_type, event_version, payload, metadata, timestamp)
INSERT INTO events (aggregate_type, aggregate_id, sequence, event_type, event_version, payload, metadata)
VALUES ('Customer', 'previous_event_in_need_of_upcast', 1, 'NameAdded', '1.0', '{
"NameAdded": {}
}', '{}', DEFAULT);
}', '{}');

0 comments on commit d762a0d

Please sign in to comment.