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

Migrating to Liferay 5.2 sp3 fails on SQL Server 2000

    Details

      Description

      getindexes() in SQLServerDB returns null if SQL Server 2000 is detected.
      I used the following code to fix this issue

      StringBuilder sb = new StringBuilder();

      if (metaData.getDatabaseMajorVersion() <= _SQL_SERVER_2000) {
      sb.append("select table_name = OBJECT_NAME(i.id), ");
      sb.append("i.name as index_name, ");
      sb.append("INDEXPROPERTY(i.id, i.name, 'IsUnique') as is_unique ");
      sb.append("from sysindexes i where ");
      sb.append("i.name like 'LIFERAY_%' OR i.name like 'IX_%' ");
      } else {
      sb.append("select sys.tables.name as table_name, ");
      sb.append("sys.indexes.name as index_name, is_unique from ");
      sb.append("sys.indexes inner join sys.tables on ");
      sb.append("sys.tables.object_id = sys.indexes.object_id where ");
      sb.append("sys.indexes.name like 'LIFERAY_%' or sys.indexes.name ");
      sb.append("like 'IX_%'");
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michael.saechang Michael Saechang
              Reporter:
              frank.lautenschlaeger Frank Lautenschlaeger (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                9 years, 25 weeks, 2 days ago

                  Packages

                  Version Package
                  6.0.X EE
                  6.1.1 CE GA2
                  6.1.20 EE GA2
                  6.2.0 CE M2