{
	"name": "table/common/preference.json",
	"table_name": "preference",
	"table_prefix": "prf",
	"record_type": ["", "external", "ksef", "4d", "4dchange", "4dmanual", "4dmethod", "4dreport"],
	"table_name_language": {
		"": "Preference",
		"external": "External preference",
		"4d": "• 4D Preference",
		"4dchange": "• 4D Change",
		"4dmanual": "• 4D Manual",
		"4dmethod": "• 4D Method history",
		"4dreport": "• 4D Report"
	},
	"default_field": "table/prf/default_field.json",
	"default_order": [
		{
			"field": "name_id",
			"order": ">"
		}
	],
	"trigger-": ["organization_id", "name_id", "preference_state"],
	"field": [
		{
			"field_name": "name_id",
			"constraint": ["primary key"],
			"field_type": "text"
		},
		{
			"field_name": "preference_state",
			"field_type": "varchar",
			"field_length": 20
		},
		{
			"field_name": "organization_id",
			"field_type": "varchar",
			"field_length": 40
		},
		{
			"field_name": "info",
			"field_type": "text"
		}
	],
	"extra_field": [
		{
			"info": "for some reason automatic extra field creation does not work with moloni external preference -table",
			"field_name": "json_data.country_id",
			"field_type": "integer"
		},
		{
			"field_name": "json_data.iso_3166_1",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.languages",
			"field_type": "json"
		},
		{
			"field_name": "json_data.reference_number",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.description",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.author_nip",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.context_nip",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.status",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.date_created",
			"field_type": "timestamp"
		},
		{
			"field_name": "json_data.last_use_date",
			"field_type": "timestamp"
		},
		{
			"field_name": "json_data.requested_permissions",
			"field_type": "json"
		},
		{
			"field_name": "json_data.session_status",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.processing_status",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.session_token",
			"field_type": "varchar"
		},
		{
			"field_name": "json_data.open_timestamp",
			"field_type": "timestamp"
		},
		{
			"field_name": "json_data.expiry_timestamp",
			"field_type": "timestamp"
		}
	],
	"field_change": [
		{
			"name": "name_id",
			"old_name": ["name_id"]
		},
		{
			"name": "preference_state",
			"old_name": ["state"]
		}
	]
}
