Skip to content

Commit b7ee155

Browse files
authored
Align entity definition with schema migration and update jooq generated sources (#1664)
* ensure db migration contains all constraints and indeces, remove hibernate constraint and index annotations, regenerate jooq sources * fix column names * regenerate jooq sources from clean db
1 parent 6d00f52 commit b7ee155

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+6532
-37
lines changed

server/src/main/java/org/eclipse/openvsx/entities/AdminStatistics.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import java.util.stream.Collectors;
1818

1919
@Entity
20-
@Table(uniqueConstraints = { @UniqueConstraint(columnNames = { "year", "month"})})
20+
@Table(name = "admin_statistics")
2121
public class AdminStatistics {
2222

2323
@Id

server/src/main/java/org/eclipse/openvsx/entities/Extension.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
import java.util.Objects;
2323

2424
@Entity
25-
@Table(uniqueConstraints = {
26-
@UniqueConstraint(columnNames = { "publicId" }),
27-
@UniqueConstraint(columnNames = { "namespace_id", "name" })
28-
})
25+
@Table(name = "extension")
2926
public class Extension implements Serializable {
3027

3128
@Serial

server/src/main/java/org/eclipse/openvsx/entities/ExtensionVersion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import java.util.stream.Collectors;
2626

2727
@Entity
28-
@Table(uniqueConstraints = { @UniqueConstraint(columnNames = { "targetPlatform", "version" })})
28+
@Table(name = "extension_version")
2929
public class ExtensionVersion implements Serializable {
3030

3131
@Serial

server/src/main/java/org/eclipse/openvsx/entities/Namespace.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
import java.util.stream.Collectors;
2222

2323
@Entity
24-
@Table(uniqueConstraints = {
25-
@UniqueConstraint(columnNames = { "publicId" }),
26-
@UniqueConstraint(columnNames = { "name" })
27-
})
24+
@Table(name = "namespace")
2825
public class Namespace implements Serializable {
2926

3027
@Serial

server/src/main/java/org/eclipse/openvsx/entities/PersonalAccessToken.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@
1919
import java.util.Objects;
2020

2121
@Entity
22-
@Table(uniqueConstraints = { @UniqueConstraint(columnNames = "value") })
22+
@Table(name = "personal_access_token")
2323
public class PersonalAccessToken implements Serializable {
2424

25-
public static final int EXPIRY_DAYS = 90;
26-
2725
@Serial
2826
private static final long serialVersionUID = 1L;
2927

server/src/main/java/org/eclipse/openvsx/entities/ScannerJob.java

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,23 @@
1919
/**
2020
* Represents a scan job in the database.
2121
* Each scan job tracks the status of a specific scanner's work on an extension version.
22-
*
22+
* <p>
2323
* Multiple ScanJobs can be linked together via scanId to represent
2424
* all the scanning work for a single extension version upload.
2525
*/
2626
@Entity
27-
@Table(
28-
name = "scan_job",
29-
indexes = {
30-
@Index(name = "scan_job_scan_id_idx", columnList = "scanId"),
31-
@Index(name = "scan_job_status_idx", columnList = "status"),
32-
@Index(name = "scan_job_extension_version_idx", columnList = "extensionVersionId"),
33-
@Index(name = "scan_job_type_status_created_idx", columnList = "scannerType, status, createdAt")
34-
},
35-
uniqueConstraints = {
36-
@UniqueConstraint(columnNames = {"scanId", "scannerType"})
37-
}
38-
)
27+
@Table(name = "scan_job")
3928
public class ScannerJob {
4029

4130
/**
4231
* Tracks the current state of the scan job.
43-
*
32+
* <p>
4433
* Status flow for synchronous scanners:
4534
* QUEUED → PROCESSING → COMPLETE/FAILED
46-
*
35+
* <p>
4736
* Status flow for asynchronous scanners:
4837
* QUEUED → PROCESSING → SUBMITTED → COMPLETE/FAILED
49-
*
38+
* <p>
5039
* REMOVED is set by cleanup service when scanner was removed from configuration.
5140
*/
5241
public enum JobStatus {
@@ -59,7 +48,7 @@ public enum JobStatus {
5948

6049
/**
6150
* Check if this status is terminal (job has finished processing).
62-
*
51+
* <p>
6352
* Terminal states: COMPLETE, FAILED, REMOVED
6453
* Non-terminal states: QUEUED, PROCESSING, SUBMITTED
6554
*
@@ -71,7 +60,7 @@ public boolean isTerminal() {
7160

7261
/**
7362
* Check if this status represents an active/pending job.
74-
*
63+
* <p>
7564
* Active states: QUEUED, PROCESSING, SUBMITTED
7665
*
7766
*/
@@ -141,11 +130,11 @@ public boolean isActive() {
141130

142131
/**
143132
* JSON map of file names to SHA256 hashes for async scanners with file extraction.
144-
*
133+
* <p>
145134
* When an async scanner extracts files from the .vsix and sends them for scanning,
146135
* the temp files are cleaned up after submission. This field stores the filename→hash
147136
* mapping so we can properly set file hashes when results come back later.
148-
*
137+
* <p>
149138
* Format: {"extension/main.js": "abc123...", "extension/util.js": "def456..."}
150139
* Null when: no file extraction was used, or sync scanner
151140
*/

server/src/main/java/org/eclipse/openvsx/entities/UsageStats.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
import java.util.Objects;
2525

2626
@Entity
27-
@Table(uniqueConstraints = {
28-
@UniqueConstraint(columnNames = { "customer_id", "windowStart" }),
29-
})
27+
@Table(name = "usage_stats")
3028
public class UsageStats implements Serializable {
3129

3230
@Serial

server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Indexes.java

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)