Uploaded image for project: 'EJBCA'
  1. EJBCA
  2. ECA-7771

DB CLI schema generation generates all schemas using the configured database type

    Details

    • Type: Bug
    • Status: Open
    • Priority: Cosmetic
    • Resolution: Unresolved
    • Affects Version/s: EJBCA 6.10.1.1, EJBCA 7.0.0, EJBCA 6.15.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Issue discovered during:
      Review

      Description

      The ejbca-db-cli command has a "gen" subcommand that generates create and drop SQL scripts. This subcommand has a parameter to specify the database type, it can be a specific database type or "all".

      Unfortunately, the persistence.xml file includes a hardcoded reference to the mapping-file, so it always points to whatever database type was specified at build time (the "database.name" property in database.properties). So the schema definitions are have incorrect types for all schemas except the configured one.

      For example, if "database.name" is set to mysql), you will have TINYINT(4) column types instead of BIT in MSSQL for example, when TINYINT(4) is for MySQL/MariaDB.

      The solution might be to avoid the hardcoded reference in the XML (perhaps one can use a ${} variable that is not set at build time), or to somehow set the mapping file programmatically.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              samuel Samuel Lidén Borell
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 days
                  2d
                  Remaining:
                  Remaining Estimate - 2 days
                  2d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified