Details

    • Branch Version/s:
      7.0.x
    • Backported to Branch:
      Committed
    • Story Points:
      4
    • Fix Priority:
      3

      Description

      Description
      The gradlew cleanServiceBuilder task attempts to drop all tables in your database in your module's service.xml. The way it does this is by running a DROP TABLE IF EXISTS SQL command directly on the database. However, the "IF EXISTS" syntax is not supported on all of our supported databases, such as SQL Server versions before 2016.

      Steps to Reproduce
      1. Set up a sample module in blade.
      2. In your service's jdbc.properties, set jdbc properties to connect it to a SQL Server database.
      3. From your service folder, attempt to run the gradlew cleanServiceBuilder task.

      Expected Result: The task completes successfully without errors.
      Actual Result: The task fails with the following error:

      :example-service:cleanServiceBuilderException in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'IF'.
              at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
              at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
              at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:792)
              at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:689)
              at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
              at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
              at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
              at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
              at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeUpdate(SQLServerStatement.java:642)
              at com.liferay.portal.tools.db.support.commands.CleanServiceBuilderCommand._dropTable(CleanServiceBuilderCommand.java:159)
              at com.liferay.portal.tools.db.support.commands.CleanServiceBuilderCommand.execute(CleanServiceBuilderCommand.java:117)
              at com.liferay.portal.tools.db.support.commands.BaseCommand.execute(BaseCommand.java:38)
              at com.liferay.portal.tools.db.support.DBSupport.main(DBSupport.java:75)
       FAILED
      
      FAILURE: Build failed with an exception.
      
      * What went wrong:
      Execution failed for task ':example-service:cleanServiceBuilder'.
      > Process 'command 'C:\Program Files\Java\jdk1.8.0_131\bin\java.exe'' finished with non-zero exit value 1
      
      * Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
      
      BUILD FAILED
      

        Attachments

          Activity

            People

            • Assignee:
              sharry.shi Sharry Shi
              Reporter:
              michael.bowerman Michael Bowerman
              Participants of an Issue:
              Recent user:
              Michael Saechang
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                18 weeks, 3 days ago