Sha256: e55e54a2879dec4834cfb2fed1552acd254dc1858ce77f8a758fee5a0daaa028

Contents?: true

Size: 1.58 KB

Versions: 19

Compression:

Stored size: 1.58 KB

Contents

CREATE TABLE public.events
(
    id                uuid                        DEFAULT public.gen_random_uuid() NOT NULL,
    context           character varying COLLATE "POSIX"                            NOT NULL,
    stream_name       character varying COLLATE "POSIX"                            NOT NULL,
    stream_id         character varying COLLATE "POSIX"                            NOT NULL,
    global_position   bigserial                                                    NOT NULL,
    stream_revision   integer                                                      NOT NULL,
    data              jsonb                       DEFAULT '{}'::jsonb              NOT NULL,
    metadata          jsonb                       DEFAULT '{}'::jsonb              NOT NULL,
    link_id           uuid,
    link_partition_id bigint,
    created_at        timestamp without time zone DEFAULT now()                    NOT NULL,
    type              character varying COLLATE "POSIX"                            NOT NULL
) PARTITION BY LIST (context);

ALTER TABLE ONLY public.events
    ADD CONSTRAINT events_pkey PRIMARY KEY (context, stream_name, type, global_position);

CREATE INDEX idx_events_stream_id_and_stream_revision ON public.events USING btree (stream_id, stream_revision);
CREATE INDEX idx_events_stream_id_and_global_position ON public.events USING btree (stream_id, global_position);

CREATE INDEX idx_events_id ON public.events USING btree (id);
CREATE INDEX idx_events_link_id ON public.events USING btree (link_id);
CREATE INDEX idx_events_global_position ON public.events USING btree (global_position);

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
pg_eventstore-1.7.0 db/migrations/1_create_events.sql
pg_eventstore-1.6.0 db/migrations/1_create_events.sql
pg_eventstore-1.5.0 db/migrations/1_create_events.sql
pg_eventstore-1.4.0 db/migrations/1_create_events.sql
pg_eventstore-1.3.4 db/migrations/1_create_events.sql
pg_eventstore-1.3.3 db/migrations/1_create_events.sql
pg_eventstore-1.3.2 db/migrations/1_create_events.sql
pg_eventstore-1.3.1 db/migrations/1_create_events.sql
pg_eventstore-1.3.0 db/migrations/1_create_events.sql
pg_eventstore-1.2.0 db/migrations/1_create_events.sql
pg_eventstore-1.1.5 db/migrations/1_create_events.sql
pg_eventstore-1.1.4 db/migrations/1_create_events.sql
pg_eventstore-1.1.3 db/migrations/1_create_events.sql
pg_eventstore-1.1.2 db/migrations/1_create_events.sql
pg_eventstore-1.1.1 db/migrations/1_create_events.sql
pg_eventstore-1.1.0 db/migrations/1_create_events.sql
pg_eventstore-1.0.4 db/migrations/1_create_events.sql
pg_eventstore-1.0.0.rc2 db/migrations/1_create_events.sql
pg_eventstore-1.0.0.rc1 db/migrations/1_create_events.sql