import xhiveframework


def execute():
	if xhiveframework.db.exists("DocType", "Member"):
		xhiveframework.reload_doc("Non Profit", "doctype", "Member")

		if xhiveframework.db.has_column("Member", "subscription_activated"):
			xhiveframework.db.sql(
				'UPDATE `tabMember` SET subscription_status = "Active" WHERE subscription_activated = 1'
			)
			xhiveframework.db.sql_ddl("ALTER table `tabMember` DROP COLUMN subscription_activated")
