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

Bundles installed via command line never run upgrades

    Details

    • Fix Priority:
      4

      Description

      When loading a module via the gogo shell, the indexes.sql, tables.sql, and sequences.sql is always empty.

      this is because in com.liferay.portal.spring.extender.internal.context.ModuleApplicationContextRegistrator we initialize the services with

      _serviceConfigurator.initServices(
      new ModuleResourceLoader(_extendeeBundle),
      _extendeeClassLoader);

      the ModuleResourceLoader does not implement the three methods used to fetch the sql input streams. It is always an empty byte array.

      @Override
      public InputStream getSQLIndexesInputStream()

      { return new ByteArrayInputStream(new byte[0]); }

      @Override
      public InputStream getSQLSequencesInputStream() { return new ByteArrayInputStream(new byte[0]); }

      @Override
      public InputStream getSQLTablesInputStream()

      { return new ByteArrayInputStream(new byte[0]); }

      the other methods have a default location which is read correctly

      @Override
      public InputStream getHibernateInputStream()

      { return getInputStream("/META-INF/module-hbm.xml"); }

      @Override
      public InputStream getModelHintsExtInputStream()

      { return getInputStream("/META-INF/portlet-model-hints-ext.xml"); }

      @Override
      public InputStream getModelHintsInputStream()

      { return getInputStream("/META-INF/portlet-model-hints.xml"); }

      we should finish the class and implement the remaining methods with getInputStream("/META-INF/sql/tables.sql);

      when testing this issue.

      steps to reproduce
      1) create service builder module using blade
      2) deploy the module using liferay workspace
      3) update the sql file to add a new column
      4) deploy the module AND check the table in the database. the new column will not exist

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 39 weeks, 1 day ago

                Packages

                Version Package