Tables not being created when importing solution

Questions and Answers on installation, deployment, management, locking, tranasactions of Servoy Application Server

Tables not being created when importing solution

Postby jasantana » Sun Sep 13, 2015 10:30 am

Hi all.

I've created a new table in my solution and after doing the import on the server I've noticed that the table was not created.

The only way I've been able to create that table when importing the solution has been creating a dummy form based on that new table.

Is that the expected behaviour?

I'm using Servoy 7.4.3 in both developer and server.

Thanks in advance.
Best regards,
Juan Antonio Santana Medina
jasantana@nephos-solutions.co.uk
Servoy MVP 2015
Servoy 6.x - Servoy 7.x - Servoy 8.x - MySQL - PostgreSQL - Visual Foxpro 9
User avatar
jasantana
 
Posts: 555
Joined: Tue Aug 10, 2010 11:40 am
Location: Leeds - West Yorkshire - United Kingdom

Re: Tables not being created when importing solution

Postby patrick » Sun Sep 13, 2015 1:45 pm

If your solution has no reference to that table (a form, relation, value list, ...) then that table is only created if you chose to include all tables from server in the export settings. If you don't like that for other reasons, you have to create "something" based on that table. Expected behavior, yes.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Tables not being created when importing solution

Postby jasantana » Mon Sep 14, 2015 9:37 am

Thanks Patrick.

I thought that a simple databaseManager.getFoundset() was enough to make Servoy think that there is a reference to the table.

Cheers,
Best regards,
Juan Antonio Santana Medina
jasantana@nephos-solutions.co.uk
Servoy MVP 2015
Servoy 6.x - Servoy 7.x - Servoy 8.x - MySQL - PostgreSQL - Visual Foxpro 9
User avatar
jasantana
 
Posts: 555
Joined: Tue Aug 10, 2010 11:40 am
Location: Leeds - West Yorkshire - United Kingdom

Re: Tables not being created when importing solution

Postby patrick » Mon Sep 14, 2015 9:51 am

No, as far as I know we don't check code...
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Tables not being created when importing solution

Postby swingman » Mon Sep 14, 2015 2:05 pm

I have also been bitten by this in the past. You create a table, add some code in global scope to manipulate the data using databaseManager.createFoundSet(server, table name).
Everything works fine, you test, then you import on the liver server and your solution fails because the table is missing....

There should at least be a warning to create a form...
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Tables not being created when importing solution

Postby patrick » Mon Sep 14, 2015 2:08 pm

I have customers with databases with 5000 tables. They don't want to have them all included and I'm sure they don't want any warnings like that...
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Tables not being created when importing solution

Postby ROCLASI » Mon Sep 14, 2015 2:59 pm

There are a few scenarios for creating tables in your database:

  • Let Servoy do it automatically. This requires that it knows about it by referencing it on any of the following objects:
    • form
    • relation
    • valuelist
    Essentially any Servoy object other than javascript code.
    However Servoy will never change schema objects or remove them. It will only add new ones.
  • Tell Servoy to export the solution including ALL tables of the used connections.
    I believe this requires that there are dbi files of these tables (and the connection is used somewhere other than in code).
    And I don't think Servoy will change/remove schema objects here either. Only add new ones.
  • Create/change/remove them manually using any SQL query tool before you import the solution.
    This requires that you restart the server or else it doesn't see your schema changes.
    Or set the import setting to not allow schema changes and let the import fail a couple times until it doesn't find any new schema changes.
  • Use the pre- and post hooks in your solution and write code to do all your schema changes. This will run before/after your solution gets imported.
    This is essentially the automated form of doing it manually since you decide what to add/remove/change.

Did I mis a scenario?

Hope this helps.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Tables not being created when importing solution

Postby swingman » Mon Sep 14, 2015 8:04 pm

I have customers with databases with 5000 tables. They don't want to have them all included and I'm sure they don't want any warnings like that...


Neither would I, but I have written code referencing one of those 5,000 and Servoy is not going to create that one table for me, I'd like to know.

As Servoy is progressing, we have been moving from a FileMaker-style form-based environment to something a lot more advanced. If I place code in the table scope I expect the table to be created, not to have to create a form.
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Tables not being created when importing solution

Postby Andrei Costescu » Fri Sep 18, 2015 1:59 pm

You could make a feature request for that (code in table scope should also consider the table notable for export).
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm


Return to Servoy Server

Who is online

Users browsing this forum: No registered users and 5 guests