In this part we will start changing our solution to make it better.
As you can remember we created the user_managers table in the database using a Postgres database manager. This is a bad solution because:
How could we create our database table in a better way?
You can find the
entitymodel.xml file. This file contains the description of tables in the Jira database. Here is an example:
We can add our own table via this file. We could also define the primary key of our table, indexes but for the sake of simplicity we will use just this definition:
<entity entity-name="user_managers" table-name="user_manager" package-name=""> <field name="user" col-name="user" type="long-varchar"/> <field name="manager" col-name="manager" type="long-varchar"/> </entity>
Also we need also to add information for our table into
<entity-group group="default" entity="user_managers"/>
Now we need to restart our Jira server. After it you can find the user_managers table in the Jira database.
Why is this way to create a table in the Jira database better than the first one?
Because right now you can take a backup of your Jira and restore your Jira without loosing the user_managers table. But what are the drawbacks?
As you can see we still have many things to handle. I would not recommend this solution. We will talk later what would be a better solution.