Hi,
Is there a special method to delete schemas via javascript?
The following generates an error:
xtk.session.Write(<schema _operation="delete" xtkschema="xtk:sourceSchema" _key="@name" id={schemaName} />)
The error:
11/20/2025 12:29:20 PM XFR-180000 The file '/usr/local/neolane/nl6/datakit/xtk/eng/schema/sourceSchema.xml' does not exist on the server. Unable to load the document of identifier 'xtk:sourceSchema' and type 'xtk:schema'.
Thanks,
Skyler
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @SkylerQu2 ,
You can use SQL code activity and execute DROP TABLE customTable
or in JS, var sql = "DROP TABLE customTable"; xtk.session.executeQuery(sql);
But by both methods only tables will get deleted, but schema will still remain in the instance.
So, the best practice is instead of deleting using a script, navigate to Administration > Configuration > Data schemas and delete it and update the database structure.
Views
Replies
Total Likes
Hi @ParthaSarathy thank you, yes, we are executing the DROP TABLE sql, but is there any way to remove the schema automatically?
Views
Replies
Total Likes
You can only manually delete from Administration > Configuration > Data schemas, thus you can also ensure there is no schema deleted by mistake and also can check if there is any relationship between other schema will get impacted.
Views
Replies
Total Likes
Hi,
I think xtk:sourceSchema is a typo. Should probably be xtk:srcSchema.
Regards,
Jonas
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies