From 67c85b996e3b32a69dece22bee0d8c712bfab35a Mon Sep 17 00:00:00 2001 From: Johannes Beck Date: Sat, 23 Mar 2024 20:25:38 +0100 Subject: [PATCH] Update schemaspy and schema --- etc/create-postgresql.sql | 4 ++-- pom.xml | 4 ++-- src/main/docker/x1-postgres-stomp-test/sql/ddl.sql | 4 ++-- src/main/java/x1/stomp/model/Share.java | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/etc/create-postgresql.sql b/etc/create-postgresql.sql index ce6235fa..94820262 100644 --- a/etc/create-postgresql.sql +++ b/etc/create-postgresql.sql @@ -5,10 +5,10 @@ CREATE TABLE stocks.share ( key character varying(25) NOT NULL, name character varying(80) NOT NULL, version bigint, - CONSTRAINT share_pkey PRIMARY KEY (id) + CONSTRAINT share_pkey PRIMARY KEY (id), + CONSTRAINT idx_key UNIQUE (key); ); CREATE SEQUENCE stocks.share_seq INCREMENT BY 50; -CREATE UNIQUE INDEX idx_key ON stocks.share (key); CREATE INDEX idx_name ON stocks.share (name); diff --git a/pom.xml b/pom.xml index 377cc114..8e8f7e77 100644 --- a/pom.xml +++ b/pom.xml @@ -581,14 +581,14 @@ x1.maven schemaspy-maven-plugin - 1.10 + 2.0 db.x1 stocks stocks stocks stocks - pgsql + pgsql11 diff --git a/src/main/docker/x1-postgres-stomp-test/sql/ddl.sql b/src/main/docker/x1-postgres-stomp-test/sql/ddl.sql index ce6235fa..94820262 100644 --- a/src/main/docker/x1-postgres-stomp-test/sql/ddl.sql +++ b/src/main/docker/x1-postgres-stomp-test/sql/ddl.sql @@ -5,10 +5,10 @@ CREATE TABLE stocks.share ( key character varying(25) NOT NULL, name character varying(80) NOT NULL, version bigint, - CONSTRAINT share_pkey PRIMARY KEY (id) + CONSTRAINT share_pkey PRIMARY KEY (id), + CONSTRAINT idx_key UNIQUE (key); ); CREATE SEQUENCE stocks.share_seq INCREMENT BY 50; -CREATE UNIQUE INDEX idx_key ON stocks.share (key); CREATE INDEX idx_name ON stocks.share (name); diff --git a/src/main/java/x1/stomp/model/Share.java b/src/main/java/x1/stomp/model/Share.java index a1d45646..535a773d 100644 --- a/src/main/java/x1/stomp/model/Share.java +++ b/src/main/java/x1/stomp/model/Share.java @@ -23,9 +23,9 @@ @Cacheable @XmlRootElement(name = "share") @XmlAccessorType(XmlAccessType.FIELD) -@Table(name = "share", uniqueConstraints = @UniqueConstraint(columnNames = "key"), indexes = { - @Index(columnList = "key", name = "idx_key", unique = false), - @Index(columnList = "name", name = "idx_name", unique = false) }) +@Table(name = "share", + uniqueConstraints = @UniqueConstraint(columnNames = "key", name = "idx_key"), + indexes = { @Index(columnList = "name", name = "idx_name", unique = false) }) @NamedQuery(name = Share.FIND_BY_KEY, query = "select s from Share s where s.key = :key") @NamedQuery(name = Share.LIST_ALL, query = "select s from Share s order by s.name") @NamedQuery(name = Share.COUNT_ALL, query = "select count(s.id) from Share s")