Skip to content

Commit

Permalink
CORE-16329 - Avro and DB schema for new Scheduler component. (#1218)
Browse files Browse the repository at this point in the history
Avro and DB schema for new Scheduler component.
  • Loading branch information
driessamyn authored Sep 8, 2023
1 parent 9fdb8b7 commit 14819c0
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"type": "record",
"name": "ScheduledTaskTrigger",
"namespace": "net.corda.data.scheduler",
"fields": [
{
"name": "name",
"type": "string",
"doc": "Name of the scheduled task."
},
{
"name": "timestamp",
"type": {
"type": "long",
"logicalType": "timestamp-millis"
},
"doc": "Timestamp for the trigger."
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
<include file="net/corda/db/schema/config/migration/static-network-creation-v1.0.xml"/>

<include file="net/corda/db/schema/config/migration/config-creation-v5.1.xml"/>
<include file="net/corda/db/schema/config/migration/scheduler-creation-v5.1.xml"/>
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">

<property name="now" value="now()" dbms="hsqldb"/>
<property name="now" value="now()" dbms="postgresql"/>

<changeSet author="R3.Corda" id="scheduler-creation-v5.1">

<createTable tableName="task_scheduler_log">
<column name="task_name" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="last_scheduled" type="TIMESTAMP WITH TIME ZONE" defaultValueDate="${now}">
<constraints nullable="false"/>
</column>
<column name="scheduler_id" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
</createTable>

<addPrimaryKey columnNames="task_name" constraintName="task_scheduler_log_task_name_pk" tableName="task_scheduler_log"/>
</changeSet>
</databaseChangeLog>

0 comments on commit 14819c0

Please sign in to comment.