I have the following (auto-generated) script for creating the JPA entities that Axon requires:
`
– Script for creating the Axon required tables.
CREATE TABLE IF NOT EXISTS public.association_value_entry
(
id bigint NOT NULL,
association_key character varying(255) NOT NULL,
association_value character varying(255),
saga_id character varying(255) NOT NULL,
saga_type character varying(255),
CONSTRAINT association_value_entry_pkey PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS public.saga_entry
(
saga_id character varying(255) NOT NULL,
revision character varying(255),
saga_type character varying(255),
serialized_saga oid,
CONSTRAINT saga_entry_pkey PRIMARY KEY (saga_id)
);
CREATE TABLE IF NOT EXISTS public.token_entry
(
processor_name character varying(255) NOT NULL,
segment integer NOT NULL,
owner character varying(255),
“timestamp” character varying(255) NOT NULL,
token oid,
token_type character varying(255),
CONSTRAINT token_entry_pkey PRIMARY KEY (processor_name, segment)
);
`
My question is that the type character varying(255)
is used a lot. Would this be better in Postgres as a JSONB column?
I.E. are fields such as association_key and ``association_value
always expected to be serialised to JSON in Axon?
Regards,