Skip to content

Commit 26e9afb

Browse files
Hadi FadlallahHadi Fadlallah
Hadi Fadlallah
authored and
Hadi Fadlallah
committed
Ignored unique indexes in the SQL command
1 parent 4ede05e commit 26e9afb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SQLToNeo4j/SQLCommands.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public static class SQLcommands
88
{
99
public static string GetIndexes = "SELECT 'INDEX ' + ind.name + ' FOR (t:' + t.name +') ON (' + STRING_AGG('t.' + Col.name,',') + ')'" +
1010
" FROM sys.indexes ind INNER JOIN sys.index_columns ic ON ind.object_id = ic.object_id and ind.index_id = ic.index_id INNER JOIN sys.columns col ON ic.object_id = col.object_id and ic.column_id = col.column_id INNER JOIN sys.tables t ON ind.object_id = t.object_id" +
11-
" WHERE ind.type = 2 and (t.is_node = 1 or t.is_edge = 1) and col.name not like 'graph_id_%' and t.name <> 'sysdiagrams'" +
11+
" WHERE ind.type = 2 and (t.is_node = 1 or t.is_edge = 1) and col.name not like 'graph_id_%' and t.name <> 'sysdiagrams' and ind.is_unique = 0 and ind.is_unique_constraint = 0 " +
1212
" GROUP BY ind.name, t.name";
1313
public static string GetFullTextIndexes = "SELECT 'db.index.fulltext.' + case t.is_node when 1 then 'createNodeIndex(\"N_' else 'createRelationshipIndex(\"Rel_' end + cat.name + '\", [' + STRING_AGG('\"' + t.name + '\"',', ') + '], [' + STRING_AGG('\"' + col.name + '\"',', ') + '])' " +
1414
" FROM sys.fulltext_catalogs cat INNER JOIN sys.fulltext_indexes ind ON cat.fulltext_catalog_id = ind.fulltext_catalog_id INNER JOIN sys.fulltext_index_columns ic ON ind.object_id = ic.object_id " +

0 commit comments

Comments
 (0)