Change the parent table of a table

German Alvarez2
Tera Expert

Hi experts,

 

Custumer asks about changing the structure of the [cmdb_ci] under a new schema, and it implies to change the tables that extends from other, creating in-between new "Abstract" and structures.

 

1/ It is possible to change the tables inheritance structure to create intermediate tables from Admin console without the need of recreating the current tables?

2/ Do we need to contact SNOW to do that? Do they support this kind of operations?

3/ How much could it impact to the instance performance or automation after the change?

 

Best regards

1 ACCEPTED SOLUTION

Subhajit1
Giga Guru

Hi German,


You will get all the information here:-


The Wrong Parent...


This have been a life saver



Thanks,


Subhajit


View solution in original post

4 REPLIES 4

Subhajit1
Giga Guru

Hi German,


You will get all the information here:-


The Wrong Parent...


This have been a life saver



Thanks,


Subhajit


Warning with using this solution. It is not supported by ServiceNow, thus why no WIKI documentation publicly exists. I did my DEV work and everything seemed to go fine but upon moving to upper environments many problems followed and ServiceNow reps couldn't really help as I had used the unsupported feature. This is especially true of extending the Task table as it has been flattened thus you will be affecting the base task table.



Again, the solution may work fine but if something goes wrong you may be stuck.




Hopefully ServiceNow will create a way to capture a table, extend a table after the fact at some point as table recreation is not always a great option.



Good luck folks,


AA


hash3
Kilo Contributor

Hey Guys,



I had a similar problem. I created a table which extends from Asset table and when I moved the update set to TEST, it changed the extends table from Asset table to Hardware table. Instead of trying the background script, I tried exporting the table and importing the table in test. Guess what...It worked!


It changed extends from hardware table to Asset table.


Niclas
Giga Guru

The "TheWrongParent" article is really old, from 2011



I took a look at the API Documentation and find a new Method reParentTable in the CMDBUtil Class that might be helpfull for reparenting CI tables. However I have never used it. But as this method is officially documented i would expect it to work. I guess it might have come with Genevas reparenting of cmdb_ci to cmdb. If someone tried it and can confirm that it will work it would be great (Also, will the change be covered in an update set?)



Here is the link:



https://developer.servicenow.com/app.do#!/api_doc?v=helsinki&id=c_CMDBUtilAPI



reParentTable(String table, String oldParent, String newParent)

Changes the parent of the given table to the new parent.


This is a static method.