How can i configure the database?

How can i configure the database to see the relationships and all the properties of the system

Configuring the database is quite different from seeing the relationships of the system.

Moqui has built in configuration in MoquiDefaultConf.xml. This configuration can be overridden for development in MoquiDevConf.xml and MoquiProductionConf.xml for production. Whenever you run just java -jar moqui.war you are running in development mode with the DevConf configuration. If you want to configure the database for either development or production, then you edit the respective file. If you want to use a postgres database instead of the default built in h2 database, you can put this in the <entity-facade> element in a configuration file:

        <datasource group-name="transactional" database-conf-name="postgres" schema-name="public" startup-add-missing="true" runtime-add-missing="false">
            <inline-jdbc><xa-properties user="moqui" password="moqui" serverName="127.0.0.1" portNumber="5432"
                    databaseName="moqui"/></inline-jdbc>
        </datasource>

If you want to see all the relationships of the database, you can go to the Auto Screens app in Tools. This lists all the different entities in a searchable way with all the relationships of an entity in the actual database.

If you want to see all the code that configures the entities and the relationships then I suggest looking at the entity folder in mantle-udm. This is where the majority of the universal data model of Moqui belongs, and is a good resource for getting used to the structure of the entities and how they are added to the database.

If you want to see relationships and structure of the database in a seperate gui, you can always use a program like table plus, built in intellij database tool, or DBeaver.

Does that answer your question?

Thank you very much for the above answer that solved my question!

1 Like

Great! Glad it helped

Sorry I’m a newbie, I’m having some problems trying to view the Diagrams, I don’t know how to do it step by step. (I tried using intelliJ IDEA’s database tool)

Do you still need help? If so, can you elaborate a bit on what you mean by Diagrams?

I want to see an overview of the links and relationships between tables, like diagrams in Microsoft SQL Server, But I don’t know how to watch it !

Try https://schemaspy.org, it may help you.

My comment above goes over the ways you can view the entity relationships it in Moqui. This suites me just fine. If the Moqui tools don’t meet your needs to view your database relationships, you can either build what you need in Moqui (could use mermaid-js like this) or use an external tool like what @zhangwei mentioned.