autoGeneratedUniqueIndexDefinition method
When shouldCreateUniqueIndex is true, the btree unique index that is
auto-created for this field on tableName; otherwise null.
Implementation
SerializableModelIndexDefinition? autoGeneratedUniqueIndexDefinition(
String tableName,
) {
if (!shouldCreateUniqueIndex) return null;
return SerializableModelIndexDefinition(
name: '${tableName}__${columnName}__unique_idx',
type: 'btree',
unique: true,
fields: [columnName],
);
}