Skip to content

LoadSchema

zerovian edited this page Feb 26, 2020 · 9 revisions

Example

Create a delta.df file:

ADD FIELD "active" OF "Customer" AS logical
  FORMAT "yes/no"
  POSITION 20
  INITIAL "yes"
  ORDER 210
  MAX-WIDTH 1

.
PSC
cpstream=ISO8859-1
.
0000000129

Add this to your the build.gradle of your project:

plugins {
  id "oe.espress.latte" version "<version>"
  id "base"
}    

import oe.espreso.latte.*

task createDB(type: CreateDatabase) {
    dbName = "sports2020"
    destDir = "${buildDir}"
    sourceDb = '/path/to/your/dlc/sports2020.db'
    largeFiles = true
}

task connectDB(type: DBConnection) {
    dependsOn createDB
    dbName = 'sports2020'
    dbDir = "${buildDir}"
    id = 'sports2020'
    singleUser = true
}

task updateSchema(type: LoadSchema) {
    dependsOn connectDB

    source 'path/to/folder/that/has/the/delta/file'
    include '*.df'

    refid = "sports2020"
}

Use the command ./gradlew updateSchema to run this example.

If successful, your sports2020.db in build should have a new active field in the existing Customers table.

Properties

Attribute Required Description Default value
srcFile Yes DF file to be loaded None
unfreeze No Unfreeze the tables in the database before loading the schema, then refreeze everything that was unfrozen after the load False
onlineChanges No Relaxes requirements to apply online changes (use SESSION:SCHEMA-CHANGE = 'NEW OBJECTS'). False
commitWhenErrors No Commits transaction even if there are errors. If set to true and there are errors, it just displays a warning. If set to false and there are errors, build fails False
callbackClass No Callback class during schema load. Only for OpenEdge 11.3+ None