Undocumented: Table Extension APIs
There are many undocumented ServiceNow APIs that have existed since the beginning. These are a couple that you may come across needing either as a system administrator or developer.
The first is the GlideTableParentChange if you need to move a table to be extended from another table. An example use case is that you may have accidently created it under the wrong table, like the wrong CI or task table.
var table = ''; //table you want to extend var old_parent = ''; var new_parent = ''; //the table you want to extend to, like cmdb_ci or task var changer = new GlideTableParentChange(table); changer.change(old_parent, new_parent);
The second is GlideDBUtil.promoteColumn which is a single one line script that lets you move a column up to the parent level table. This also might be useful in CMDB management, where you may have created a column under a table, but it really need to be moved to the parent so more CIs can use the field.
GlideDBUtil.promoteColumn('table_to_move_from', 'table_to_move_to', 'field_to_move', true);
Finally there is a documented TableUtils API that also offers some useful functions around dropping tables.