# Copyright (c) 2019, Xhive LLC
# License: GNU General Public License v3. See license.txt


import xhiveframework


def execute():
	xhiveframework.reload_doc("hr", "doctype", "shift_assignment")
	if xhiveframework.db.has_column("Shift Assignment", "date"):
		xhiveframework.db.sql(
			"""update `tabShift Assignment`
            set end_date=date, start_date=date
            where date IS NOT NULL and start_date IS NULL and end_date IS NULL;"""
		)
