# DB column modification causes import issue

**URL:** <https://forum.servoy.com/t/db-column-modification-causes-import-issue/14577>\
**Category:** Classic Servoy\
**Created:** [September 3, 2011, 3:43pm UTC](https://forum.servoy.com/t/db-column-modification-causes-import-issue/14577 "2011-09-03T15:43:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tokajac](https://avatars.discourse-cdn.com/v4/letter/t/838e76/32.png) [@Tokajac](https://forum.servoy.com/u/Tokajac)\
**Post date:** [September 3, 2011, 3:43pm UTC](https://forum.servoy.com/t/db-column-modification-causes-import-issue/14577/1 "2011-09-03T15:43:07Z")

</div>

Hello,

Have an issue when importing new version of the solution, I check following options on {servoy\_server}/servoy-admin/solutions/import:  
_Override existing sequence type definitions (in repository) with the sequence types contained in the import file._  
_Allow data model (database) changes_  
_Display data model (database) changes_  
_Import internationalization (i18n) data_

Anyway I get warning:  
**_The server version of the column ‘x’ of table ‘y’ in server ‘z’ has pk constraint while in the import version it has constraint_**

Solution doesn’t work as it still uses the ‘server version’'?! Tried to restart the application\_server (couple of times) already.  
How to update the existing DB on the server to match the real MySQL DB model (maintained by MySQL Administrator) and allow correct import of the solution?

Regards

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [September 3, 2011, 4:01pm UTC](https://forum.servoy.com/t/db-column-modification-causes-import-issue/14577/2 "2011-09-03T16:01:19Z")

</div>

Hi Imre,

Are you sure that is the whole error message ? It seems garbled/cut off.  
You say you maintain the schema outside of Servoy (which is not an issue). Is this (updated) schema exactly the same as your development environment ?  
It seems Servoy is complaining about that it sees a PK constraint on a column while it isn’t there in the solution you want to import.

Perhaps you can export your solution again from Developer (if you make schema changes outside Developer you also need to restart Developer to make it see the schema changes just like Server) and try importing it again.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Tokajac](https://avatars.discourse-cdn.com/v4/letter/t/838e76/32.png) [@Tokajac](https://forum.servoy.com/u/Tokajac)\
**Post date:** [September 3, 2011, 4:56pm UTC](https://forum.servoy.com/t/db-column-modification-causes-import-issue/14577/3 "2011-09-03T16:56:13Z")

</div>

Thank you for your fast response Robert,

Changes:  
-have a table y that had 2 columns as PK, 1 of them was x;  
-removed the PK feature for x column outside Servoy (MySQL Administrator), so only the other column remains as PK; Did the Synchronize with DB server information and Quick Fixed the difference so that Developer sees only 1 column as PK and works with that table as expected;  
Exported the solution and tried to import to the server but mentioned warning occurs and on the server solution uses the old version of DB?!

Current Status: solution works with latest DB model when started from developer but not with the latest when run via application server?

[warning]The server version of the column x of table y in server z has pk constraint while in the import version it has constraint.  
[info] Import successful…

Any idea what am I doing wrong? Is there a work-around? Tried to delete and recreate the Database Server already  
How to make application\_serve to use the latest DB?

Regards

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [September 3, 2011, 7:53pm UTC](https://forum.servoy.com/t/db-column-modification-causes-import-issue/14577/4 "2011-09-03T19:53:35Z")

</div>

Hi Imre,

That is indeed weird. A restart of Server should always result in a fresh view on the actual database schema. Can you re-check if the database that the server uses has indeed those changes ?

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [September 5, 2011, 9:00am UTC](https://forum.servoy.com/t/db-column-modification-causes-import-issue/14577/5 "2011-09-05T09:00:02Z")

</div>

Tokajac,

I could reproduce this using the same scenario.

Please file a case in our support system.

Rob

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [September 6, 2011, 11:37am UTC](https://forum.servoy.com/t/db-column-modification-causes-import-issue/14577/6 "2011-09-06T11:37:28Z")

</div>

Imre,

This is fixed in Servoy 6.0.1.

Rob

---

<div class="post-metadata">

**Author:** ![michel](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@michel](https://forum.servoy.com/u/michel)\
**Post date:** [November 10, 2011, 7:13am UTC](https://forum.servoy.com/t/db-column-modification-causes-import-issue/14577/7 "2011-11-10T07:13:03Z")

</div>

Hi Rob,

Has this also been fixed in the 5.2.x version (if yes, what version)? We are experiencing this same problem using foxpro tables.

---

<div class="post-metadata">

**Author:** ![Tokajac](https://avatars.discourse-cdn.com/v4/letter/t/838e76/32.png) [@Tokajac](https://forum.servoy.com/u/Tokajac)\
**Post date:** [November 10, 2011, 10:24am UTC](https://forum.servoy.com/t/db-column-modification-causes-import-issue/14577/8 "2011-11-10T10:24:50Z")

</div>

Hi michel,

Rob’s guidelines:  
As a workaround you can delete some stuff from the repository tables.  
When you do this, MAKE SURE TO MAKE A BACKUP FIRST!

1. backup the servoy\_repository tables  
2.using a db tool:  
delete from servoy\_columninfo where tablename = ‘y’ and connection\_name = ‘x’
2. restart ApplicationServer
3. re-import the solution

Regards

---

<div class="post-metadata">

**Author:** ![michel](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@michel](https://forum.servoy.com/u/michel)\
**Post date:** [November 10, 2011, 11:08am UTC](https://forum.servoy.com/t/db-column-modification-causes-import-issue/14577/9 "2011-11-10T11:08:04Z")

</div>

Even that did not work for my foxpro tables, I chose the more destructive path…

1. backup
2. stop server
3. delete all tables in servoy\_repository
4. start server with -updateRepository argument
5. start server
6. import solution

---

<div class="post-metadata">

**Author:** ![Tokajac](https://avatars.discourse-cdn.com/v4/letter/t/838e76/32.png) [@Tokajac](https://forum.servoy.com/u/Tokajac)\
**Post date:** [December 21, 2011, 11:56pm UTC](https://forum.servoy.com/t/db-column-modification-causes-import-issue/14577/10 "2011-12-21T23:56:46Z")

</div>

Hello michel,

check with some DB maintenance tool that your real DB hasn’t been harmed by previous import which caused warnings;  
If it’s harmed, restore it from healthy SQL and than do the work-around procedure again;

Regards
