createCommand method

String createCommand()
override
the text of the sql command that will create the object in the database

Implementation

String createCommand() {
  StringBuffer sb = new StringBuffer();
  sb.write("CREATE ${_unique ? "UNIQUE" : ""} INDEX ");
  sb.write(" `${this._name}` ON `${this._tbl.name}` ( ");
  for (DbColumn col in this._cols) {
    sb.write("`${col.name}` ,");
  }

  //
  return sb.toString().removeLastChar() + ")";
}