Skip to content

Commit 878765b

Browse files
author
Dennis Labordus
committed
Split version in 3 separate columns. Easier ordering them.
Signed-off-by: Dennis Labordus <[email protected]>
1 parent 235d268 commit 878765b

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

doc/postgresql.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ Table: scl_file
1515
| Column | Type | Required | Description |
1616
| ----------------- | -------------------- | ----------| ------------------------------------------------------------------ |
1717
| id | uuid | True | Unique ID generated according to standards |
18-
| version | varchar(20) | True | Versioning according to [Semantic Versioning](https://semver.org/) |
18+
| major_version | smallint | True | Versioning according to [Semantic Versioning](https://semver.org/) |
19+
| minor_version | smallint | True | Versioning according to [Semantic Versioning](https://semver.org/) |
20+
| patch_version | smallint | True | Versioning according to [Semantic Versioning](https://semver.org/) |
1921
| type | varchar(3) | True | The type of SCL stored |
2022
| name | varchar(255) | True | The name of the SCL File |
2123
| scl_data | text | True | The SCL XML Content |

repository-postgresql/src/main/java/org/lfenergy/compas/scl/data/repository/postgres/CompasSclDataPostgreSQLRepository.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import org.lfenergy.compas.scl.data.model.SclType;
1010
import org.lfenergy.compas.scl.data.model.Version;
1111
import org.lfenergy.compas.scl.data.repository.CompasSclDataRepository;
12-
import org.slf4j.Logger;
13-
import org.slf4j.LoggerFactory;
1412

1513
import javax.enterprise.context.ApplicationScoped;
1614
import javax.inject.Inject;
@@ -24,15 +22,12 @@
2422

2523
@ApplicationScoped
2624
public class CompasSclDataPostgreSQLRepository implements CompasSclDataRepository {
27-
private static final Logger LOGGER = LoggerFactory.getLogger(CompasSclDataPostgreSQLRepository.class);
28-
2925
public static final String NOT_IMPLEMENTED = "Not implemented!";
3026

3127
private DataSource dataSource;
3228

3329
@Inject
3430
public CompasSclDataPostgreSQLRepository(DataSource dataSource) {
35-
LOGGER.info("Starting PostgreSQL Repository.");
3631
this.dataSource = dataSource;
3732
}
3833

repository-postgresql/src/main/resources/org/lfenergy/compas/scl/data/repository/postgres/db/migration/V1_0__create_scl_file.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
--
1010
create table scl_file (
1111
id uuid not null,
12-
version varchar(20) not null,
12+
major_version smallint not null,
13+
minor_version smallint not null,
14+
patch_version smallint not null,
1315
type varchar(3) not null,
1416
name varchar(255) not null,
1517
scl_data text not null,
@@ -20,7 +22,9 @@ create index scl_file_type on scl_file(type);
2022

2123
comment on table scl_file is 'Table holding all the SCL Data. The combination id and version are unique (pk).';
2224
comment on column scl_file.id is 'Unique ID generated according to standards';
23-
comment on column scl_file.version is 'Versioning according to Semantic Versioning';
25+
comment on column scl_file.major_version is 'Versioning according to Semantic Versioning (Major Position)';
26+
comment on column scl_file.minor_version is 'Versioning according to Semantic Versioning (Minor Position)';
27+
comment on column scl_file.patch_version is 'Versioning according to Semantic Versioning (Patch Position)';
2428
comment on column scl_file.type is 'The type of SCL stored';
2529
comment on column scl_file.name is 'The name of the SCL File';
2630
comment on column scl_file.scl_data is ' The SCL XML Content';

0 commit comments

Comments
 (0)