Skip to main content
1-Visitor
March 1, 2019
Solved

Operator Advisor: adding properties on the _AP table

  • March 1, 2019
  • 1 reply
  • 2494 views

Hi, 

 

I'm learning how Operator Advisor works and how we can use it in our future projects. 

I understand when I add properties in the _AP table before I run the service 'CreateTables', the properties are added in de database table.

 

But let's say the project is live, already containing data, and I want to upgrade the data model. How do we do this? Do we add a field in the datashape and add a column in the database manual? Or are there services to update all _AP tables? Because 'CreateTables' goes in error if I try a second time.

 

Jasper

Best answer by fmok

Yes, can add the field to the datashap and manually update the database.

Alternatively, you could leverage the AddColumn service used during upgrades.

Search for AddColumn in the user guide to find an example of this service.

https://www.ptc.com/support/-/media/4FA487F6B4244A70B82F0A42120551CC.pdf?sc_lang=en

1 reply

fmok12-AmethystAnswer
12-Amethyst
March 1, 2019

Yes, can add the field to the datashap and manually update the database.

Alternatively, you could leverage the AddColumn service used during upgrades.

Search for AddColumn in the user guide to find an example of this service.

https://www.ptc.com/support/-/media/4FA487F6B4244A70B82F0A42120551CC.pdf?sc_lang=en

jasperlg1-VisitorAuthor
1-Visitor
March 4, 2019

@fmok

 

Thanks for your answer. It does not sound very practically though. This way, when we change our projects from a Dev environment to Test or Production, we can't automatically 'do an upload' of all our datashapes to the database and this way add columns dat have been added in the meantime.

We also can't see in de database if the column already exists,  right? So I think we can't program this ourselves if I see it correctly? Please correct me if you see a solution to this problem. 

 

Kind regards, 

Jasper

 

 

12-Amethyst
March 4, 2019

Hi Jasper,

 

I agree that tihs is not so practical. We have been looking at adding improvements to the process. In the meantime, it is ok to run the AddColumn service on each system(Test, dev, etc..). If the column already exists it will simply fail