-
Notifications
You must be signed in to change notification settings - Fork 811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sql): PostgreSQL compatibility for executions and partitions #3812
Conversation
@@ -14,6 +14,6 @@ databaseChangeLog: | |||
nullable: false | |||
- column: | |||
name: expiry | |||
type: bigint(13) | |||
type: bigint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't validCheckSum
be required here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it would be - I've added the original checksum to the migration.
sql: CREATE TABLE `deleted_executions` (id INT AUTO_INCREMENT, execution_id char(26) NOT NULL, execution_type ENUM("pipeline", "orchestration") NOT NULL, deleted_at DATETIME NOT NULL, CONSTRAINT deleted_executions_pk PRIMARY KEY (id)) | ||
sql: ALTER TABLE `deleted_executions` MODIFY COLUMN `execution_type` ENUM("pipeline", "orchestration") NOT NULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
.run { | ||
when (jooq.dialect()) { | ||
SQLDialect.POSTGRES -> { | ||
onConflict(DSL.field("id")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be lock_name
, not id
which is not a field in this table. lock_name
is the primary key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed, thank you.
Includes the following changes: - Removing bigint display qualifiers - these are MySQL specific, and display-only - Avoid using `forceIndex` on PostgreSQL - it does not support that feature - Remove MySQL-specific column backticks for `partition`, and replace with `DSL.name` throughout - A number of queries used MySQL-specific upsert features. These have been expanded with PostgreSQL-compatible varieties. - Add new PostgreSQL module with runtimeOnly driver dependency - Add PostgreSQL tests for orca-sql
3e21970
to
b5f5d12
Compare
@robzienert Thanks for the review! This is still dependent on spinnaker/keiko#176 - would it be possible to get eyes on that sometime as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the fixups! looking at keiko now
merged keiko, it should produce a release https://github.com/spinnaker/keiko/releases/tag/v3.8.0 |
Thanks @marchello2000 ! I'll wait for the next Kork release, and then this PR should (hopefully) test correctly. |
…nnaker#3812) * fix(sql): PostgreSQL compatibility for executions and partitions Includes the following changes: - Removing bigint display qualifiers - these are MySQL specific, and display-only - Avoid using `forceIndex` on PostgreSQL - it does not support that feature - Remove MySQL-specific column backticks for `partition`, and replace with `DSL.name` throughout - A number of queries used MySQL-specific upsert features. These have been expanded with PostgreSQL-compatible varieties. - Add new PostgreSQL module with runtimeOnly driver dependency - Add PostgreSQL tests for orca-sql * Update kork/keiko pins to include required dependency changes Co-authored-by: Adam Jordens <adam@jordens.org> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Includes the following changes:
forceIndex
on PostgreSQL - it does not support that featurepartition
, and replace withDSL.name
throughoutDepends on:
spinnaker/kork#716
spinnaker/keiko#176