columnIndexName function

String columnIndexName(
  1. String table,
  2. String column, {
  3. bool unique = false,
})

The name of the index of the column column of the table table, <table>_<column>_idx, as PostgreSQL names one, or, if unique, <table>_<column>_key.

Implementation

String columnIndexName(String table, String column, {bool unique = false}) =>
    '${sql.unqualifiedPostgresName(table)}_'
    '${sql.unquoteIdentifier(column, '"')}_${unique ? 'key' : 'idx'}';