# Copied internal user tables over, now primary key constraint failling when adding new user

**URL:** <https://forum.inductiveautomation.com/t/copied-internal-user-tables-over-now-primary-key-constraint-failling-when-adding-new-user/72345>\
**Category:** Ignition\
**Tags:** perspective, ignition81, database\
**Created:** [April 12, 2023, 9:35am UTC](https://forum.inductiveautomation.com/t/copied-internal-user-tables-over-now-primary-key-constraint-failling-when-adding-new-user/72345 "2023-04-12T09:35:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffrey.boey](https://avatars.discourse-cdn.com/v4/letter/j/6a8cbe/32.png) [@jeffrey.boey](https://forum.inductiveautomation.com/u/jeffrey.boey)\
**Post date:** [April 12, 2023, 9:35am UTC](https://forum.inductiveautomation.com/t/copied-internal-user-tables-over-now-primary-key-constraint-failling-when-adding-new-user/72345/1 "2023-04-12T09:35:49Z")

</div>

Hi guys, bit of a curious problem.

I've copied the following tables over during a migration, everything worked out, roles where preserved, users could log in etc.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f709a2d18dc12539f3ca8b064c3a9fb14302dfe5.png)

However, when I want to create a new user, I'm getting this error:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/0/10a8a67a3c4c6ac86a3391e8d6c2e35fa654a7e6.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/62f5bae24546300f8c0e4cd5521fee9e4e4194f8.jpeg)

After some digging, I realized the ID is not an autoincrement field, although I think it should be 🙂

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/2/12a6df28d10e0112ed35d4d36d7ace8238db0f8a.png)

Any idea where is ignition getting the user ID from? Is there some table that I'm missing? or does the AI need to be reset?

Thanks!!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 12, 2023, 12:32pm UTC](https://forum.inductiveautomation.com/t/copied-internal-user-tables-over-now-primary-key-constraint-failling-when-adding-new-user/72345/2 "2023-04-12T12:32:08Z")

</div>

Look at and update the correct row in the `SEQUENCES` table. Ignition doesn't use the autoincrement column type, probably because the SQLite docs suggest to not.

---

<div class="post-metadata">

**Author:** ![jeffrey.boey](https://avatars.discourse-cdn.com/v4/letter/j/6a8cbe/32.png) [@jeffrey.boey](https://forum.inductiveautomation.com/u/jeffrey.boey)\
**Post date:** [April 26, 2023, 8:31am UTC](https://forum.inductiveautomation.com/t/copied-internal-user-tables-over-now-primary-key-constraint-failling-when-adding-new-user/72345/3 "2023-04-26T08:31:23Z")

</div>

Thanks! I missed that, didn't know SQLite don't recommend autoincrements, learned something new!
