130
Views
4
Comments
Solved
Change Physical Table name
Question
Platform Version
11.23.0 (Build 40636)

Hey all,

My DEV environment has a table with a physical name different from the PRD environment. I want them to match. This is because I want to do regular PRD database backups and restore that on top of the DEV environment database (both environments have the platform catalog separated from the apps catalog, so the apps catalog is the only one being restored).

In the past I used to be able to change the physical name in the ossys_entity and then publish the module and that was it. But now after I publish the module, the old name is becoming active (attribute Is_Active = 1 in ossys_entity).

Is there another aditional step I have to execute?


regards

2018-11-09 09-14-06
Gonçalo Almeida
Solution

Well, I was able to make it work after all.

First step, export to an Excel file the content of the entity because you're gonna have to delete it.

Next, I had 2 rows in the ossys_entity, so I deleted the one that was inative and changed the physical table name on the one that was active to the correct name.
Next, I deleted both tables from the database itself and republished the module who owns the entity. After that, I republished all the modules that consume the entity.

All of these steps created an empty table with the correct name. I filled that table with values that I previously saved in the Excel file.

2023-01-27 00-38-49
Luciano Albano

I would also like to do this, but it didn't work for me with the instructions you gave. It continues creating the new table with the suffix 1. In addition to the record in the [OSSYS_Entity] table, I also changed the entity name in the OSSYS_ENTITY_CONFIG table. I've tried recreating it several times, but I think there must be some other configuration that stores the table name. Any ideas? 

Updates:

 UPDATE [dbo].[ossys_Entity] SET Physical_Table_Name = 'OSUSR_yw2_Client', Event_Table_Name = 'OSEVT_yw2_Client' WHERE Id = 1234

UPDATE [dbo].[OSSYS_ENTITY_CONFIG] SET [DEFAULT_TABLE_NAME] = 'OSUSR_yw2_Client', EFFECTIVE_TABLE_NAME = 'OSUSR_yw2_Client' WHERE ID = 4321



2023-10-13 15-08-35
Ryan Surjadi

As far as I know, you cannot change the name of an entity that has been automatically generated by Outsystems, but again it depends on where your server is located.

If there is a need that requires DB access, it is better to use a self-manage server, but if you are using OnCloud Outsystems, it is better to have your database installed outside Outsystems so that you can manage it more easily

2018-11-09 09-14-06
Gonçalo Almeida

My system isn't cloud. It's on premises, so I have full control of the database.

2018-11-09 09-14-06
Gonçalo Almeida
Solution

Well, I was able to make it work after all.

First step, export to an Excel file the content of the entity because you're gonna have to delete it.

Next, I had 2 rows in the ossys_entity, so I deleted the one that was inative and changed the physical table name on the one that was active to the correct name.
Next, I deleted both tables from the database itself and republished the module who owns the entity. After that, I republished all the modules that consume the entity.

All of these steps created an empty table with the correct name. I filled that table with values that I previously saved in the Excel file.

2023-01-27 00-38-49
Luciano Albano

I would also like to do this, but it didn't work for me with the instructions you gave. It continues creating the new table with the suffix 1. In addition to the record in the [OSSYS_Entity] table, I also changed the entity name in the OSSYS_ENTITY_CONFIG table. I've tried recreating it several times, but I think there must be some other configuration that stores the table name. Any ideas? 

Updates:

 UPDATE [dbo].[ossys_Entity] SET Physical_Table_Name = 'OSUSR_yw2_Client', Event_Table_Name = 'OSEVT_yw2_Client' WHERE Id = 1234

UPDATE [dbo].[OSSYS_ENTITY_CONFIG] SET [DEFAULT_TABLE_NAME] = 'OSUSR_yw2_Client', EFFECTIVE_TABLE_NAME = 'OSUSR_yw2_Client' WHERE ID = 4321



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.