Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-67688

Implement autoupgrade SQL for ServiceBuilder when developing

    Details

    • Type: Feature Request
    • Status: Closed
    • Resolution: Implemented in Platform
    • Affects Version/s: 7.0.0 CE GA1, 7.0.1 CE GA2
    • Fix Version/s: None
    • Labels:
      None

      Description

      The first time you run the deployment of a module that uses the service builder, running the SQL code is successful (tables, indexes, sequence, etc ...).

      10:00:31,774 INFO  [Refresh Thread: Equinox Container: 50e75200-6064-0016-15e9-9805fef927f8][ServiceComponentLocalServiceImpl:317] Running LRBO_HORSE SQL scripts
      

      For example, when I add a new column (service.xml) and re-run the deployment after running the buildservice, the SQL code is not executed and therefore the new column is not added to the table.

      Although upgrade had changed in Liferay 7 as stated in Developer Network (Upgrade Process in Liferay 7link title), developers from previous versions can find this unefficient, mostly in development phases.

      Only during the development phase. If you want to apply the new changes then you should perform the following SQL operations on the database:

      • drop table relating to the service;
      • delete record on the release_ table which are related to the service;
      • delete record on the servicecomponent table which are related to the service;

      Following an example of SQL statements to be executed for a custom service:

      DROP TABLE LRBO_HORSE_HORSE;
      DELETE FROM SERVICECOMPONENT WHERE BUILDNAMESPACE = 'LRBO_HORSE';
      DELETE FROM RELEASE_ WHERE SERVLETCONTEXTNAME = 'horse-service';
      

      Once executed SQL statements deploy the service again. You'll notice again on Liferay log the entry "Running SQL scripts $SERVICENAMESPACE"

      It would be great to implement a "developer" mode so at least those new columns are added automatically.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                support-lep@liferay.com SE Support
                Reporter:
                amusarra Antonio Musarra
              • Votes:
                6 Vote for this issue
                Watchers:
                14 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package