Import Design Model from Other Tool

DbSchema model can be imported using Groovy scripts. In the example below we have exported the schema column comments from PowerDesigner to CSV file and import them in DbSchema using the script below. The schema was previous reverse engineer from the database. The delimiter used in this file is '|'. Here is the test csv file:

SAKILA|customer|customer_id|The customer unique identifier
SAKILA|customer|store_id|The id of the store where the purchase was done

And the script:

import com.wisecoders.dbs.schema.*

new File('/tmp/schemaComments.csv').eachLine { line ->
String[] data = line.split('\\|')
println "Split is: ${data}"
if ( data.size() == 4 ){
  Schema sch = project.getSchema( null, data[0] )
  if ( sch != null ){
     println "Found Schema ${sch} "
     Table table = sch.tables.getByName( data[1] )
      if ( table != null ){
        println "Found Table ${table} "
        Column col = table.columns.getByName( data[2] )
        if ( col != null ){
          println "Found Column ${col} "
          col.setComment( data[3] )
        }
      }
    }
  }
}

Please don't hesitate to ask us on Help/Report Bug menu option for more samples or published classes or methods.