Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Change auto increment ID number

Mario Donaire June 27, 2022

The data has been moved from one table to another. In this table the field ID is auto incremental, so the problem comes because the start number of this field ID is different from the previous table. When the new table does an insert, this table is trying to create a new row with an existing ID. Is there any way to change this auto incremental field ID without directly changing this table in our database?

1 answer

1 accepted

0 votes
Answer accepted
Fabio Racobaldo _Herzum_
Community Champion
June 27, 2022

Hi @Mario Donaire ,

welcome to the Atlassian community!

That table field can be updated in order to track the last project key number based on the project key. Unfortunately that behaviour is based on the field on DB and you have no chance to manage it in other way.

Hope this helps,

Fabio

Mario Donaire June 27, 2022

Hi @Fabio Racobaldo _Herzum_ 

I am sorry but when you talk about the project key number I do not know what you mean or what I should do.

Fabio Racobaldo _Herzum_
Community Champion
June 27, 2022

Hi @Mario Donaire ,

there is a table "project" containing a field "pcounter" with the last number of the issue created for that project.

You should update that field, per project basis, with the last key number created.

Here an how to guide for reset https://confluence.atlassian.com/jirakb/how-to-reset-the-project-counter-after-moving-issues-776643590.html but in your case you should update that field with the correct value.

Hope this helps,

Fabio

Mario Donaire June 27, 2022

Hi @Fabio Racobaldo _Herzum_

This table is not related to the "project" table. This table is from a plugin we are developing. I have also looked in the schemas of the tables but there is no information related to the ID field. Is there any way to modify this table? I 

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 27, 2022

No, you must not modify the database directly, it will, quite simply, break your system.  You shouldn't even be looking at the database frankly.

What problem are you actually trying to solve?  And why are you looking at the database?

Suggest an answer

Log in or Sign up to answer