Skip to content
Snippets Groups Projects
Commit d2a08206 authored by npedot's avatar npedot
Browse files

extracts functional parse

parent ba391132
No related branches found
No related tags found
No related merge requests found
......@@ -171,14 +171,8 @@ class Schema () {
}
fun addFunctional(tableName:String, setExpression: String): Schema {
val constraintsToAdd = Constraint.set(setExpression)
for (constraint in constraintsToAdd) {
constraint.name=tableName+".functional"
constraint.type=Constraint.TYPE.FUNCTIONAL.name
constraint.source.table=tableName
constraint.target.table=tableName
}
constraints().addAll(constraintsToAdd)
constraints().addAll(SchemaCmdParser
.parseFunctionals(tableName, setExpression))
return this
}
......
......@@ -11,5 +11,16 @@ object SchemaCmdParser {
return table
}
fun parseFunctionals(tableName: String,setExpression: String): Set<Constraint> {
val constraintsToAdd = Constraint.set(setExpression)
for (constraint in constraintsToAdd) {
constraint.name = tableName + ".functional"
constraint.type = Constraint.TYPE.FUNCTIONAL.name
constraint.source.table = tableName
constraint.target.table = tableName
}
return constraintsToAdd
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment