# Copyright (c) 2022, InfluxFramework and Contributors
# License: MIT. See LICENSE


import influxframework
from influxframework.model import data_field_options


def execute():
	custom_field = influxframework.qb.DocType("Custom Field")
	(
		influxframework.qb.update(custom_field)
		.set(custom_field.options, None)
		.where((custom_field.fieldtype == "Data") & (custom_field.options.notin(data_field_options)))
	).run()
