Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show the last failed script filename when migration failed #121

Closed
rdagumampan opened this issue Jun 8, 2020 · 1 comment
Closed

Show the last failed script filename when migration failed #121

rdagumampan opened this issue Jun 8, 2020 · 1 comment
Labels
enhancement New feature or request first-timer-friendly Light and easy start help wanted You're welcome to work on it right away

Comments

@rdagumampan
Copy link
Owner

rdagumampan commented Jun 8, 2020

When migration failed due to maybe erroneous script files, yuniql must show the file name where the issue is present. Right now, it only shows the error message like the case below.

INF   2020-06-08T14:34:55.4200544Z   Found the 4 script files on /app/db/v0.00/05-views
INF   2020-06-08T14:34:55.4201147Z   001-assets.country_list.sql\r\n\t002-rawbased.service_flow_status_view.sql\r\n\t003-rawbased.uk_windfarms_view.sql\r\n\t004-rawbased.vol_cev_view.sql
INF   2020-06-08T14:34:55.4256065Z   Executed script file /app/db/v0.00/05-views/001-assets.country_list.sql.
INF   2020-06-08T14:34:55.4315773Z   Executed script file /app/db/v0.00/05-views/002-rawbased.service_flow_status_view.sql.
ERR   2020-06-08T14:34:55.4951396Z   Failed to execute run function. 
System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near 'GO'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite, String methodName)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Yuniql.Core.ConnectionExtensions.ExecuteNonQuery(IDbConnection connection, String commandText, Nullable`1 commandTimeout, IDbTransaction transaction, ITraceService traceService) in C:\projects\yuniql\yuniql-core\ConnectionExtensions.cs:line 68
@rdagumampan rdagumampan added enhancement New feature or request help wanted You're welcome to work on it right away first-timer-friendly Light and easy start labels Jun 8, 2020
@rdagumampan rdagumampan added this to the v1.0-06.27.2020 milestone Jun 8, 2020
@rdagumampan
Copy link
Owner Author

Closed. This enhancement will be part of v1.0 release.
Errors will be displayed with better color coding and shows the last failed script file.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request first-timer-friendly Light and easy start help wanted You're welcome to work on it right away
Projects
None yet
Development

No branches or pull requests

1 participant