jhipster / jhipster-core

JHipster Domain Language, used by JHipster UML and JDL-Studio to generate entities
Apache License 2.0
345 stars 116 forks source link

Not require [dev|prod]DatabaseType no when databaseType is no #333

Closed jsm174 closed 5 years ago

jsm174 commented 5 years ago
Overview of the feature request

Now that databaseType logic has been updated in https://github.com/jhipster/jhipster-core/commit/a9223765a888b8a7746c6222eddb3255b22c163c, if a user has the following JDL:

application {
   config {
      baseName gateway,
      applicationType gateway,
      authenticationType oauth2,
      packageName com.example.gateway,
      databaseType no
      languages [en],
      buildTool gradle
   }
   entities *
}

It will error out with:

INFO! The JDL is being parsed.
Error: Having 'no' as databaseType requires that devDatabaseTypes and prodDatabaseTypes values are also 'no'.
Error while parsing applications and entities from the JDL Error: Having 'no' as databaseType requires that devDatabaseTypes and prodDatabaseTypes values are also 'no'.
Error: Having 'no' as databaseType requires that devDatabaseTypes and prodDatabaseTypes values are also 'no'.
    at checkForInvalidDatabaseCombinations (/usr/local/lib/node_modules/jhipster-core/lib/exceptions/application_validator.js:141:11)
Motivation for or Use Case

Unless I'm missing something, it seems like having to put devDatabaseType no and prodDatabaseType no is redundant.

Related issues or PR
MathieuAA commented 5 years ago

Yep, you're right! thanks for taking the time to propose this :)