createIndex method
Helper to create index (skips if exists)
Implementation
Future<void> createIndex({
required String name,
required String table,
required List<String> columns,
bool unique = false,
}) async {
final exists = await schemaManager.indexExists(name, table);
if (exists) return;
final uniqueKeyword = unique ? 'UNIQUE ' : '';
final sql =
'CREATE ${uniqueKeyword}INDEX IF NOT EXISTS $name ON $table (${columns.join(', ')});';
await connection.execute(sql);
}