# Copyright (c) 2021, Jingrow Technologies Pvt. Ltd. and Contributors
# For license information, please see license.txt


import jingrow


def execute():
	jingrow.reload_pg("jcloude", "doctype", "cluster")
	cluster = jingrow.get_pg({"doctype": "Cluster", "name": "Default", "default": True})
	cluster.insert()
	doctypes = ["Server", "Proxy Server", "Database Server", "Bench", "Site"]
	for doctype in doctypes:
		jingrow.reload_pg("jcloude", "doctype", jingrow.scrub(doctype))
		jingrow.db.set_value(doctype, {"name": ("like", "%")}, "cluster", "Default")
