Hi community,

I need to have the physical table names equal to logical names. How I can change this configuration in Platform Server 10?

Best regards,

Nuno Fernandes

Hi Nuno,

As far as I know, you can't change that.

And why exactly do you need to have that? Maybe there's a workaround.

Quoting this topic:

  Edited by OutSystems on March 21, 2014
  The feature described in this topic is not formally supported by OutSystems.
  OutSystems advises against using this feature, as it may lead to unexpected results.
  Customers should not expect any official support from use of this feature.

So, the issue is that:

  • If you edit an Entity enough, a new table must be created. And if you want to roll back, the old table/data needs to be available. If they both have the same name, rollback is impossible.
  • If you publish different modules with similar entities, they will clash and data will be truncated, mixed or the table simply dropped.

You are saying "I won't need to rollback" and "I won't publish repeated names". And I'm laughing because every developer said that a few times before and 95% of the times he/she was completely wrong.

OS is designed to prevent errors and to allows changes. Naming tables with a user-friendly name is not a good practice in the long run.

Have you considered connecting to an external DB and having your names and an isolated database where the chance of errors is lower (not 0)?

Let me explain a little better.

when I create the Entity (Name) OS creates the table OSUSR_DNQ_Name and I don't want this because I need to have a match between login name and physical name. I don't want to change old tables because it may generates errors, but new tables I want that they have the same name.

I really don't see why do you need that, what is the exact use case, but that being said, you can follow the link to the topic in the reply from Nuno Reis. But as you will notice that's not OutSystems supported so you will be on your own.

You can get the table name (here).

If you want to read the data from OS you can create a view Name and edit it when OSUSR_XXX_NAME. is renamed,

If you want to write data you can have a trigger that sends from NAME to OSUSR_XXX_NAME.

But renaming the table will turn your system into mayhem for everyone.

That's why I suggested having a standalone database for those entities and OS simply connects there adapting to the local rules, not compromising the main system.

Hi Nuno Fernandes,

Although you never got to explain why you have such requirement. Be careful that Attribute names may also suffer from this "issue", as they won't necessarily map to column names. There is also another issue, related to knowing what columns are currently being used by the entity (when you change the definition of an Entity, by adding, modifying or deleting attributes you may end up with unused columns): that OutSystems is aware of it, but your other systems that directly access the database aren't.

There's a forge component that helps, by generating the SQL script for you (all you need afterwards is to pass it on to your DBA to run it on the database engine). Be aware that you need to update the generated views whenever you change any of the entities you want "exposed" with meaningful names.