protected void writeForeignKey(DdlWrite write, String tableName, Column column)
      throws IOException {

    String fkName = column.getForeignKeyName();
    String references = column.getReferences();
    int pos = references.lastIndexOf('.');
    if (pos == -1) {
      throw new IllegalStateException(
          "Expecting period '.' character for table.column split but not found in ["
              + references
              + "]");
    }
    String refTableName = references.substring(0, pos);
    String refColumnName = references.substring(pos + 1);

    String[] cols = {column.getName()};
    String[] refCols = {refColumnName};

    writeForeignKey(
        write, fkName, tableName, cols, refTableName, refCols, column.getForeignKeyIndex());
  }