This is an automated email from the ASF dual-hosted git repository.
fanningpj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-persistence-jdbc.git
The following commit(s) were added to refs/heads/main by this push:
new 43be797 Make TAG column nullable in oracle-create-schema.sql (#485)
43be797 is described below
commit 43be797a11632893e326214a18796165bb9d1dd0
Author: PJ Fanning <[email protected]>
AuthorDate: Fri Apr 10 23:57:39 2026 +0200
Make TAG column nullable in oracle-create-schema.sql (#485)
* Make TAG column nullable in oracle-create-schema.sql
oracle migration
Update MigrationScriptSpec.scala
Update DurableStateStorePluginSpec.scala
change test
* Update DurableStateStorePluginSpec.scala
---
.../oracle-durable-state-tag-nullable-migration.sql | 11 +++++++++++
.../src/main/resources/schema/oracle/oracle-create-schema.sql | 2 +-
.../jdbc/state/scaladsl/JdbcDurableStateSpec.scala | 7 +++++++
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git
a/core/src/main/resources/schema/oracle/migration-2.0.0/oracle-durable-state-tag-nullable-migration.sql
b/core/src/main/resources/schema/oracle/migration-2.0.0/oracle-durable-state-tag-nullable-migration.sql
new file mode 100644
index 0000000..562b771
--- /dev/null
+++
b/core/src/main/resources/schema/oracle/migration-2.0.0/oracle-durable-state-tag-nullable-migration.sql
@@ -0,0 +1,11 @@
+-- SPDX-License-Identifier: Apache-2.0
+
+-- see https://github.com/apache/pekko-persistence-jdbc/pull/323
+
+-- Script is provided as an example only and has only been partially tested.
+-- Please review and test thoroughly before using in production and
+-- ideally, in a test environment first.
+-- Always back up your database before running migration scripts.
+
+ALTER TABLE DURABLE_STATE MODIFY TAG VARCHAR(255) NULL
+/
diff --git a/core/src/main/resources/schema/oracle/oracle-create-schema.sql
b/core/src/main/resources/schema/oracle/oracle-create-schema.sql
index 63501b2..9ac5586 100644
--- a/core/src/main/resources/schema/oracle/oracle-create-schema.sql
+++ b/core/src/main/resources/schema/oracle/oracle-create-schema.sql
@@ -67,7 +67,7 @@ CREATE TABLE DURABLE_STATE
STATE_PAYLOAD BLOB NOT NULL,
STATE_SERIAL_ID NUMBER(10) NOT NULL,
STATE_SERIAL_MANIFEST VARCHAR(255),
- TAG VARCHAR(255) NOT NULL,
+ TAG VARCHAR(255),
STATE_TIMESTAMP NUMERIC NOT NULL,
PRIMARY KEY (PERSISTENCE_ID)
)
diff --git
a/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/JdbcDurableStateSpec.scala
b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/JdbcDurableStateSpec.scala
index 035d0db..5f38632 100644
---
a/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/JdbcDurableStateSpec.scala
+++
b/core/src/test/scala/org/apache/pekko/persistence/jdbc/state/scaladsl/JdbcDurableStateSpec.scala
@@ -49,6 +49,13 @@ abstract class JdbcDurableStateSpec(config: Config,
schemaType: SchemaType) exte
v shouldBe pekko.Done
}
}
+ "add a valid state with empty tag successfully" in {
+ whenReady {
+ stateStoreString.upsertObject("p123-empty-tag", 1, "a valid string",
"")
+ } { v =>
+ v shouldBe pekko.Done
+ }
+ }
"support composite upsert-fetch-repeat loop" in {
whenReady {
for {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]