# Prevent Historical Database connection creation or script to disable it

**URL:** <https://forum.inductiveautomation.com/t/prevent-historical-database-connection-creation-or-script-to-disable-it/74922>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [June 12, 2023, 7:18pm UTC](https://forum.inductiveautomation.com/t/prevent-historical-database-connection-creation-or-script-to-disable-it/74922 "2023-06-12T19:18:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [June 12, 2023, 7:18pm UTC](https://forum.inductiveautomation.com/t/prevent-historical-database-connection-creation-or-script-to-disable-it/74922/1 "2023-06-12T19:18:45Z")

</div>

Hi all,  
We have windows created for gateway management and one of those is the scripted creation of Database connections. This works great except that every database connection that gets created also created the associated Historical Tag Source.  
Is there anyway to NOT have it created automatically when using system.db.addDataSource?  
Or is there a way through scripting to disable the Historical Source after creation of the DB connection?

I know it sounds trivial to have to go to the web config and disable the history, but when you are dealing with 45+ gateways with new ones being added it seems weekly sometimes, this can be a time sink.

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [June 12, 2023, 7:32pm UTC](https://forum.inductiveautomation.com/t/prevent-historical-database-connection-creation-or-script-to-disable-it/74922/2 "2023-06-12T19:32:17Z")

</div>

Perhaps you can disable it by writing a SQL update on the SQLite ignition internal database
