import influxframework
from influxframework.model.rename_doc import rename_doc


def execute():
	if influxframework.db.table_exists("Email Alert Recipient") and not influxframework.db.table_exists(
		"Notification Recipient"
	):
		rename_doc("DocType", "Email Alert Recipient", "Notification Recipient")
		influxframework.reload_doc("email", "doctype", "notification_recipient")

	if influxframework.db.table_exists("Email Alert") and not influxframework.db.table_exists("Notification"):
		rename_doc("DocType", "Email Alert", "Notification")
		influxframework.reload_doc("email", "doctype", "notification")
