Skip to content

Commit 507a335

Browse files
JaBistDuNarrischJaBistDuNarrisch
authored andcommitted
Removed try catch in ColumnExists
1 parent 6d28a20 commit 507a335

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/Migrator/Providers/Impl/Oracle/OracleDialect.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Data;
3-
using System.Linq;
43
using DotNetProjects.Migrator.Framework;
54

65
namespace DotNetProjects.Migrator.Providers.Impl.Oracle;

src/Migrator/Providers/TransformationProvider.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -538,19 +538,12 @@ public virtual bool ColumnExists(string table, string column)
538538

539539
public virtual bool ColumnExists(string table, string column, bool ignoreCase)
540540
{
541-
try
541+
if (ignoreCase)
542542
{
543-
if (ignoreCase)
544-
{
545-
return GetColumns(table).Any(col => col.Name.ToLower() == column.ToLower());
546-
}
547-
548-
return GetColumns(table).Any(col => col.Name == column);
549-
}
550-
catch (Exception)
551-
{
552-
return false;
543+
return GetColumns(table).Any(x => x.Name.Equals(column, StringComparison.OrdinalIgnoreCase));
553544
}
545+
546+
return GetColumns(table).Any(x => x.Name == column);
554547
}
555548

556549
public virtual void ChangeColumn(string table, Column column)

0 commit comments

Comments
 (0)