I've created a jira plugin in my own postgres database. For so, I needed to create a table in the jira database to save some informations (I called it environments). Now I'm trying to integrate it in another Jira software that uses mysql database.
What's really gonna be ideal is to write some script that make my table (environments) to be created automatically. I mean, is there an alternative to not create the table manually? Most of plugins do this but I have no idea how they do it. can anyone suggest me a tutorial or give me some good informations about this?
Use active objects - the plugins you've seen creating their own tables do it with tables named AO_<plugin key>_name.
Actually i saw someone who created the table this way:
In entitymodel.xml he adds:
<entity entity-name="EnvTest" table-name="EnvTest" packagename="">
<field name="id" type="numeric"/>
<field name="name" type="long-varchar"/>
<field name="address" col-name="empaddress" type="long-varchar"/>
<field name="company" type="long-varchar"/>
and in entitygroup.xml:
<entity-group group="default" entity="EnvTest"/>
I tried this but unfortunately this didn't work for me. Can you please tell me the reason why?
That it a really bad way to do it. This file is used when creating an empty JIRA database and for defining what to read out into an xml backup. For an existing JIRA, you would need to manually create the table.
You'd then have to implement all the code required to read and write the table, and you would be unsopported by Atlassian.
Use the AO tables, they're not ideal for some uses, but they are the recommended approach.
So I have followed this tutorial you gave me: https://developer.atlassian.com/docs/atlassian-platform-common-components/active-objects/getting-started-with-active-objects
the plugin has been built succesfully and i downloaded it in my jira software but I didn't see any table created
When I run some script to list all the tables in my database (this script: SELECT table_schema,table_name FROM information_schema.tables ORDER BY table_schema,table_name;) I do see some tables names starting with AO, one of them is AO_5EFAF5_TODO. But when i run this script for exemple : select * from AO_5EFAF5_TODO; I get this error : relation "ao_5efaf5_todo" does not exist.
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs