File tree 1 file changed +11
-2
lines changed
DbUp.Support.SqlServer.Scripting
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -125,8 +125,17 @@ private IEnumerable<ScriptObject> GetObjectsFromMigrationScripts(SqlScript scrip
125
125
//if this group is empty, it means the second part of the regex matched (sp_rename)
126
126
if ( ! string . IsNullOrEmpty ( m . Groups [ REGEX_INDEX_ACTION_TYPE ] . Value ) )
127
127
{
128
-
129
- if ( Enum . TryParse < ObjectTypeEnum > ( m . Groups [ REGEX_INDEX_OBJECT_TYPE ] . Value , true , out var type ) )
128
+ if ( ! Enum . TryParse < ObjectTypeEnum > ( m . Groups [ REGEX_INDEX_OBJECT_TYPE ] . Value , true , out var type ) )
129
+ {
130
+ //We're adjusting for "PROC" vs "PROCEDURE" since we're checking for it in m_targetDbObjectRegex but it's not an enum member ( "PROCEDURE|PROC" )
131
+ if ( m . Groups [ REGEX_INDEX_OBJECT_TYPE ] . Value . Equals ( "PROC" , StringComparison . OrdinalIgnoreCase ) )
132
+ {
133
+ type = ObjectTypeEnum . Procedure ;
134
+ }
135
+ //else it's ObjectTypeEnum.Undefined
136
+ }
137
+
138
+ if ( type != ObjectTypeEnum . Undefined )
130
139
{
131
140
//replace CREATE OR ALTER by CREATE
132
141
var actionString = m . Groups [ REGEX_INDEX_ACTION_TYPE ] . Value . StartsWith ( ObjectActionEnum . Create . ToString ( ) , StringComparison . OrdinalIgnoreCase )
You can’t perform that action at this time.
0 commit comments