-- V001: 비-timestamp 숫자/boolean 컬럼 → VARCHAR 변환 마이그레이션
-- Generated: 2026-03-28T07:19:42.049Z
-- 총 변환 컬럼 수: 608 (뷰 제외)
-- FK 제약 DROP/RECREATE 대상: 17개
-- 제외된 뷰: v_authority_group_summary, v_cascading_as_hierarchy, v_menu_permission_summary, v_dashboard_summary, inbound_detail_view, ongoing_transports, v_hierarchy_column_mapping, v_category_value_cascading

-- =====================================================
-- STEP 1: FK 제약 조건 DROP
-- =====================================================
ALTER TABLE approval_line_template_steps DROP CONSTRAINT IF EXISTS approval_line_template_steps_template_id_fkey;
ALTER TABLE approval_line_templates DROP CONSTRAINT IF EXISTS approval_line_templates_definition_id_fkey;
ALTER TABLE approval_lines DROP CONSTRAINT IF EXISTS approval_lines_request_id_fkey;
ALTER TABLE approval_requests DROP CONSTRAINT IF EXISTS approval_requests_definition_id_fkey;
ALTER TABLE board_attachments DROP CONSTRAINT IF EXISTS board_attachments_post_id_fkey;
ALTER TABLE board_replies DROP CONSTRAINT IF EXISTS board_replies_parent_id_fkey;
ALTER TABLE board_replies DROP CONSTRAINT IF EXISTS board_replies_post_id_fkey;
ALTER TABLE category_values_test DROP CONSTRAINT IF EXISTS category_values_test_parent_value_id_fkey;
ALTER TABLE file_access_control DROP CONSTRAINT IF EXISTS fk_file_access_file;
ALTER TABLE hierarchy_column_mapping DROP CONSTRAINT IF EXISTS hierarchy_column_mapping_group_id_fkey;
ALTER TABLE production_plan_mng DROP CONSTRAINT IF EXISTS fk_parent_plan;
ALTER TABLE production_plan_mng DROP CONSTRAINT IF EXISTS fk_equipment;
ALTER TABLE production_plan_order_rel DROP CONSTRAINT IF EXISTS fk_plan;
ALTER TABLE schedule_source_mapping DROP CONSTRAINT IF EXISTS fk_mapping_schedule;
ALTER TABLE screen_conditional_zones DROP CONSTRAINT IF EXISTS screen_conditional_zones_screen_id_fkey;
ALTER TABLE shipment_instruction_detail DROP CONSTRAINT IF EXISTS shipment_instruction_detail_instruction_id_fkey;
ALTER TABLE shipment_instruction_detail DROP CONSTRAINT IF EXISTS shipment_instruction_detail_shipment_plan_id_fkey;

-- =====================================================
-- STEP 2: 컬럼 타입 변환 (숫자/boolean → VARCHAR)
-- =====================================================
-- Table: approval_definitions
ALTER TABLE approval_definitions ALTER COLUMN default_template_id TYPE VARCHAR USING default_template_id::VARCHAR;
ALTER TABLE approval_definitions ALTER COLUMN max_steps DROP DEFAULT;
ALTER TABLE approval_definitions ALTER COLUMN max_steps TYPE VARCHAR USING max_steps::VARCHAR;
ALTER TABLE approval_definitions ALTER COLUMN allow_self_approval DROP DEFAULT;
ALTER TABLE approval_definitions ALTER COLUMN allow_self_approval TYPE VARCHAR USING allow_self_approval::VARCHAR;
ALTER TABLE approval_definitions ALTER COLUMN allow_cancel DROP DEFAULT;
ALTER TABLE approval_definitions ALTER COLUMN allow_cancel TYPE VARCHAR USING allow_cancel::VARCHAR;
ALTER TABLE approval_definitions ALTER COLUMN after_approval_flow_id TYPE VARCHAR USING after_approval_flow_id::VARCHAR;

-- Table: approval_line_template_steps
ALTER TABLE approval_line_template_steps ALTER COLUMN template_id TYPE VARCHAR USING template_id::VARCHAR;
ALTER TABLE approval_line_template_steps ALTER COLUMN step_order TYPE VARCHAR USING step_order::VARCHAR;

-- Table: approval_line_templates
ALTER TABLE approval_line_templates ALTER COLUMN definition_id TYPE VARCHAR USING definition_id::VARCHAR;
ALTER TABLE approval_line_templates ALTER COLUMN after_approval_flow_id TYPE VARCHAR USING after_approval_flow_id::VARCHAR;

-- Table: approval_lines
ALTER TABLE approval_lines ALTER COLUMN request_id TYPE VARCHAR USING request_id::VARCHAR;
ALTER TABLE approval_lines ALTER COLUMN step_order TYPE VARCHAR USING step_order::VARCHAR;
ALTER TABLE approval_lines ALTER COLUMN is_required DROP DEFAULT;
ALTER TABLE approval_lines ALTER COLUMN is_required TYPE VARCHAR USING is_required::VARCHAR;

-- Table: approval_proxy_settings

-- Table: approval_requests
ALTER TABLE approval_requests ALTER COLUMN definition_id TYPE VARCHAR USING definition_id::VARCHAR;
ALTER TABLE approval_requests ALTER COLUMN current_step DROP DEFAULT;
ALTER TABLE approval_requests ALTER COLUMN current_step TYPE VARCHAR USING current_step::VARCHAR;
ALTER TABLE approval_requests ALTER COLUMN total_steps TYPE VARCHAR USING total_steps::VARCHAR;
ALTER TABLE approval_requests ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;
ALTER TABLE approval_requests ALTER COLUMN is_post_approved DROP DEFAULT;
ALTER TABLE approval_requests ALTER COLUMN is_post_approved TYPE VARCHAR USING is_post_approved::VARCHAR;
ALTER TABLE approval_requests ALTER COLUMN after_approval_flow_id TYPE VARCHAR USING after_approval_flow_id::VARCHAR;
ALTER TABLE approval_requests ALTER COLUMN template_id TYPE VARCHAR USING template_id::VARCHAR;

-- Table: attach_file_info
ALTER TABLE attach_file_info ALTER COLUMN objid DROP DEFAULT;
ALTER TABLE attach_file_info ALTER COLUMN objid TYPE VARCHAR USING objid::VARCHAR;
ALTER TABLE attach_file_info ALTER COLUMN file_size TYPE VARCHAR USING file_size::VARCHAR;
ALTER TABLE attach_file_info ALTER COLUMN is_representative DROP DEFAULT;
ALTER TABLE attach_file_info ALTER COLUMN is_representative TYPE VARCHAR USING is_representative::VARCHAR;
ALTER TABLE attach_file_info ALTER COLUMN is_encrypted DROP DEFAULT;
ALTER TABLE attach_file_info ALTER COLUMN is_encrypted TYPE VARCHAR USING is_encrypted::VARCHAR;

-- Table: authority_master
ALTER TABLE authority_master ALTER COLUMN objid DROP DEFAULT;
ALTER TABLE authority_master ALTER COLUMN objid TYPE VARCHAR USING objid::VARCHAR;

-- Table: authority_master_history
ALTER TABLE authority_master_history ALTER COLUMN objid TYPE VARCHAR USING objid::VARCHAR;
ALTER TABLE authority_master_history ALTER COLUMN parent_objid TYPE VARCHAR USING parent_objid::VARCHAR;

-- Table: authority_sub_user
ALTER TABLE authority_sub_user ALTER COLUMN objid DROP DEFAULT;
ALTER TABLE authority_sub_user ALTER COLUMN objid TYPE VARCHAR USING objid::VARCHAR;
ALTER TABLE authority_sub_user ALTER COLUMN master_objid TYPE VARCHAR USING master_objid::VARCHAR;

-- Table: barcode_label_templates
ALTER TABLE barcode_label_templates ALTER COLUMN width_mm DROP DEFAULT;
ALTER TABLE barcode_label_templates ALTER COLUMN width_mm TYPE VARCHAR USING width_mm::VARCHAR;
ALTER TABLE barcode_label_templates ALTER COLUMN height_mm DROP DEFAULT;
ALTER TABLE barcode_label_templates ALTER COLUMN height_mm TYPE VARCHAR USING height_mm::VARCHAR;
ALTER TABLE barcode_label_templates ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE barcode_label_templates ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: barcode_labels
ALTER TABLE barcode_labels ALTER COLUMN width_mm DROP DEFAULT;
ALTER TABLE barcode_labels ALTER COLUMN width_mm TYPE VARCHAR USING width_mm::VARCHAR;
ALTER TABLE barcode_labels ALTER COLUMN height_mm DROP DEFAULT;
ALTER TABLE barcode_labels ALTER COLUMN height_mm TYPE VARCHAR USING height_mm::VARCHAR;

-- Table: batch_configs
ALTER TABLE batch_configs ALTER COLUMN node_flow_id TYPE VARCHAR USING node_flow_id::VARCHAR;

-- Table: batch_execution_logs
ALTER TABLE batch_execution_logs ALTER COLUMN batch_config_id TYPE VARCHAR USING batch_config_id::VARCHAR;
ALTER TABLE batch_execution_logs ALTER COLUMN duration_ms TYPE VARCHAR USING duration_ms::VARCHAR;
ALTER TABLE batch_execution_logs ALTER COLUMN total_records DROP DEFAULT;
ALTER TABLE batch_execution_logs ALTER COLUMN total_records TYPE VARCHAR USING total_records::VARCHAR;
ALTER TABLE batch_execution_logs ALTER COLUMN success_records DROP DEFAULT;
ALTER TABLE batch_execution_logs ALTER COLUMN success_records TYPE VARCHAR USING success_records::VARCHAR;
ALTER TABLE batch_execution_logs ALTER COLUMN failed_records DROP DEFAULT;
ALTER TABLE batch_execution_logs ALTER COLUMN failed_records TYPE VARCHAR USING failed_records::VARCHAR;

-- Table: batch_mappings
ALTER TABLE batch_mappings ALTER COLUMN batch_config_id TYPE VARCHAR USING batch_config_id::VARCHAR;
ALTER TABLE batch_mappings ALTER COLUMN from_connection_id TYPE VARCHAR USING from_connection_id::VARCHAR;
ALTER TABLE batch_mappings ALTER COLUMN to_connection_id TYPE VARCHAR USING to_connection_id::VARCHAR;
ALTER TABLE batch_mappings ALTER COLUMN mapping_order DROP DEFAULT;
ALTER TABLE batch_mappings ALTER COLUMN mapping_order TYPE VARCHAR USING mapping_order::VARCHAR;

-- Table: board_attachments
ALTER TABLE board_attachments ALTER COLUMN post_id TYPE VARCHAR USING post_id::VARCHAR;
ALTER TABLE board_attachments ALTER COLUMN file_size TYPE VARCHAR USING file_size::VARCHAR;

-- Table: board_posts
ALTER TABLE board_posts ALTER COLUMN view_count DROP DEFAULT;
ALTER TABLE board_posts ALTER COLUMN view_count TYPE VARCHAR USING view_count::VARCHAR;
ALTER TABLE board_posts ALTER COLUMN is_pinned DROP DEFAULT;
ALTER TABLE board_posts ALTER COLUMN is_pinned TYPE VARCHAR USING is_pinned::VARCHAR;

-- Table: board_replies
ALTER TABLE board_replies ALTER COLUMN post_id TYPE VARCHAR USING post_id::VARCHAR;
ALTER TABLE board_replies ALTER COLUMN parent_id TYPE VARCHAR USING parent_id::VARCHAR;

-- Table: bom_version
ALTER TABLE bom_version ALTER COLUMN revision DROP DEFAULT;
ALTER TABLE bom_version ALTER COLUMN revision TYPE VARCHAR USING revision::VARCHAR;

-- Table: button_action_standards
ALTER TABLE button_action_standards ALTER COLUMN confirmation_required DROP DEFAULT;
ALTER TABLE button_action_standards ALTER COLUMN confirmation_required TYPE VARCHAR USING confirmation_required::VARCHAR;
ALTER TABLE button_action_standards ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE button_action_standards ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: carrier_contract_mng_log

-- Table: carrier_mng_log

-- Table: carrier_vehicle_mng_log

-- Table: cascading_auto_fill_group

-- Table: cascading_auto_fill_mapping
ALTER TABLE cascading_auto_fill_mapping ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE cascading_auto_fill_mapping ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: cascading_condition
ALTER TABLE cascading_condition ALTER COLUMN priority DROP DEFAULT;
ALTER TABLE cascading_condition ALTER COLUMN priority TYPE VARCHAR USING priority::VARCHAR;

-- Table: cascading_hierarchy_group
ALTER TABLE cascading_hierarchy_group ALTER COLUMN max_levels TYPE VARCHAR USING max_levels::VARCHAR;

-- Table: cascading_hierarchy_level
ALTER TABLE cascading_hierarchy_level ALTER COLUMN level_order TYPE VARCHAR USING level_order::VARCHAR;

-- Table: cascading_mutual_exclusion

-- Table: cascading_relation

-- Table: category_column_mapping

-- Table: category_column_mapping_old
ALTER TABLE category_column_mapping_old ALTER COLUMN menu_objid TYPE VARCHAR USING menu_objid::VARCHAR;

-- Table: category_column_mapping_test

-- Table: category_value_cascading_group
ALTER TABLE category_value_cascading_group ALTER COLUMN parent_menu_objid TYPE VARCHAR USING parent_menu_objid::VARCHAR;
ALTER TABLE category_value_cascading_group ALTER COLUMN child_menu_objid TYPE VARCHAR USING child_menu_objid::VARCHAR;

-- Table: category_value_cascading_mapping
ALTER TABLE category_value_cascading_mapping ALTER COLUMN group_id TYPE VARCHAR USING group_id::VARCHAR;
ALTER TABLE category_value_cascading_mapping ALTER COLUMN display_order DROP DEFAULT;
ALTER TABLE category_value_cascading_mapping ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;

-- Table: category_values
ALTER TABLE category_values ALTER COLUMN value_order TYPE VARCHAR USING value_order::VARCHAR;
ALTER TABLE category_values ALTER COLUMN parent_value_id TYPE VARCHAR USING parent_value_id::VARCHAR;
ALTER TABLE category_values ALTER COLUMN depth TYPE VARCHAR USING depth::VARCHAR;
ALTER TABLE category_values ALTER COLUMN is_active DROP DEFAULT;
ALTER TABLE category_values ALTER COLUMN is_active TYPE VARCHAR USING is_active::VARCHAR;
ALTER TABLE category_values ALTER COLUMN is_default DROP DEFAULT;
ALTER TABLE category_values ALTER COLUMN is_default TYPE VARCHAR USING is_default::VARCHAR;
ALTER TABLE category_values ALTER COLUMN menu_objid TYPE VARCHAR USING menu_objid::VARCHAR;

-- Table: category_values_test
ALTER TABLE category_values_test ALTER COLUMN value_order DROP DEFAULT;
ALTER TABLE category_values_test ALTER COLUMN value_order TYPE VARCHAR USING value_order::VARCHAR;
ALTER TABLE category_values_test ALTER COLUMN parent_value_id TYPE VARCHAR USING parent_value_id::VARCHAR;
ALTER TABLE category_values_test ALTER COLUMN depth DROP DEFAULT;
ALTER TABLE category_values_test ALTER COLUMN depth TYPE VARCHAR USING depth::VARCHAR;
ALTER TABLE category_values_test ALTER COLUMN is_active DROP DEFAULT;
ALTER TABLE category_values_test ALTER COLUMN is_active TYPE VARCHAR USING is_active::VARCHAR;
ALTER TABLE category_values_test ALTER COLUMN is_default DROP DEFAULT;
ALTER TABLE category_values_test ALTER COLUMN is_default TYPE VARCHAR USING is_default::VARCHAR;

-- Table: claim_mng

-- Table: code_category
ALTER TABLE code_category ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE code_category ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;
ALTER TABLE code_category ALTER COLUMN menu_objid TYPE VARCHAR USING menu_objid::VARCHAR;

-- Table: code_info
ALTER TABLE code_info ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE code_info ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;
ALTER TABLE code_info ALTER COLUMN menu_objid TYPE VARCHAR USING menu_objid::VARCHAR;
ALTER TABLE code_info ALTER COLUMN depth DROP DEFAULT;
ALTER TABLE code_info ALTER COLUMN depth TYPE VARCHAR USING depth::VARCHAR;

-- Table: column_labels
ALTER TABLE column_labels ALTER COLUMN display_order DROP DEFAULT;
ALTER TABLE column_labels ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;
ALTER TABLE column_labels ALTER COLUMN is_visible DROP DEFAULT;
ALTER TABLE column_labels ALTER COLUMN is_visible TYPE VARCHAR USING is_visible::VARCHAR;

-- Table: column_labels_backup_20260126
ALTER TABLE column_labels_backup_20260126 ALTER COLUMN id TYPE VARCHAR USING id::VARCHAR;
ALTER TABLE column_labels_backup_20260126 ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;
ALTER TABLE column_labels_backup_20260126 ALTER COLUMN is_visible TYPE VARCHAR USING is_visible::VARCHAR;

-- Table: component_standards
ALTER TABLE component_standards ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE component_standards ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: crawl_execution_logs
ALTER TABLE crawl_execution_logs ALTER COLUMN rows_collected DROP DEFAULT;
ALTER TABLE crawl_execution_logs ALTER COLUMN rows_collected TYPE VARCHAR USING rows_collected::VARCHAR;
ALTER TABLE crawl_execution_logs ALTER COLUMN rows_saved DROP DEFAULT;
ALTER TABLE crawl_execution_logs ALTER COLUMN rows_saved TYPE VARCHAR USING rows_saved::VARCHAR;

-- Table: customer_item_mapping
ALTER TABLE customer_item_mapping ALTER COLUMN discount_value TYPE VARCHAR USING discount_value::VARCHAR;
ALTER TABLE customer_item_mapping ALTER COLUMN calculated_price TYPE VARCHAR USING calculated_price::VARCHAR;
ALTER TABLE customer_item_mapping ALTER COLUMN base_price TYPE VARCHAR USING base_price::VARCHAR;

-- Table: customer_item_prices
ALTER TABLE customer_item_prices ALTER COLUMN unit_price DROP DEFAULT;
ALTER TABLE customer_item_prices ALTER COLUMN unit_price TYPE VARCHAR USING unit_price::VARCHAR;
ALTER TABLE customer_item_prices ALTER COLUMN supply_price DROP DEFAULT;
ALTER TABLE customer_item_prices ALTER COLUMN supply_price TYPE VARCHAR USING supply_price::VARCHAR;
ALTER TABLE customer_item_prices ALTER COLUMN vat_included_price DROP DEFAULT;
ALTER TABLE customer_item_prices ALTER COLUMN vat_included_price TYPE VARCHAR USING vat_included_price::VARCHAR;
ALTER TABLE customer_item_prices ALTER COLUMN base_price DROP DEFAULT;
ALTER TABLE customer_item_prices ALTER COLUMN base_price TYPE VARCHAR USING base_price::VARCHAR;
ALTER TABLE customer_item_prices ALTER COLUMN discount_value DROP DEFAULT;
ALTER TABLE customer_item_prices ALTER COLUMN discount_value TYPE VARCHAR USING discount_value::VARCHAR;
ALTER TABLE customer_item_prices ALTER COLUMN calculated_price DROP DEFAULT;
ALTER TABLE customer_item_prices ALTER COLUMN calculated_price TYPE VARCHAR USING calculated_price::VARCHAR;

-- Table: customer_mng

-- Table: dashboard_elements
ALTER TABLE dashboard_elements ALTER COLUMN position_x TYPE VARCHAR USING position_x::VARCHAR;
ALTER TABLE dashboard_elements ALTER COLUMN position_y TYPE VARCHAR USING position_y::VARCHAR;
ALTER TABLE dashboard_elements ALTER COLUMN width TYPE VARCHAR USING width::VARCHAR;
ALTER TABLE dashboard_elements ALTER COLUMN height TYPE VARCHAR USING height::VARCHAR;
ALTER TABLE dashboard_elements ALTER COLUMN display_order DROP DEFAULT;
ALTER TABLE dashboard_elements ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;
ALTER TABLE dashboard_elements ALTER COLUMN show_header DROP DEFAULT;
ALTER TABLE dashboard_elements ALTER COLUMN show_header TYPE VARCHAR USING show_header::VARCHAR;

-- Table: dashboards
ALTER TABLE dashboards ALTER COLUMN is_public DROP DEFAULT;
ALTER TABLE dashboards ALTER COLUMN is_public TYPE VARCHAR USING is_public::VARCHAR;
ALTER TABLE dashboards ALTER COLUMN view_count DROP DEFAULT;
ALTER TABLE dashboards ALTER COLUMN view_count TYPE VARCHAR USING view_count::VARCHAR;

-- Table: data_collection_configs
ALTER TABLE data_collection_configs ALTER COLUMN source_connection_id TYPE VARCHAR USING source_connection_id::VARCHAR;

-- Table: data_collection_history
ALTER TABLE data_collection_history ALTER COLUMN config_id TYPE VARCHAR USING config_id::VARCHAR;
ALTER TABLE data_collection_history ALTER COLUMN records_collected DROP DEFAULT;
ALTER TABLE data_collection_history ALTER COLUMN records_collected TYPE VARCHAR USING records_collected::VARCHAR;
ALTER TABLE data_collection_history ALTER COLUMN execution_time_ms DROP DEFAULT;
ALTER TABLE data_collection_history ALTER COLUMN execution_time_ms TYPE VARCHAR USING execution_time_ms::VARCHAR;

-- Table: data_collection_jobs
ALTER TABLE data_collection_jobs ALTER COLUMN config_id TYPE VARCHAR USING config_id::VARCHAR;
ALTER TABLE data_collection_jobs ALTER COLUMN records_processed DROP DEFAULT;
ALTER TABLE data_collection_jobs ALTER COLUMN records_processed TYPE VARCHAR USING records_processed::VARCHAR;

-- Table: data_relationship_bridge
ALTER TABLE data_relationship_bridge ALTER COLUMN relationship_id TYPE VARCHAR USING relationship_id::VARCHAR;

-- Table: dataflow_diagrams

-- Table: db_type_categories
ALTER TABLE db_type_categories ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE db_type_categories ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;
ALTER TABLE db_type_categories ALTER COLUMN is_active DROP DEFAULT;
ALTER TABLE db_type_categories ALTER COLUMN is_active TYPE VARCHAR USING is_active::VARCHAR;

-- Table: ddl_execution_log
ALTER TABLE ddl_execution_log ALTER COLUMN success TYPE VARCHAR USING success::VARCHAR;

-- Table: delivery_route_mng_log

-- Table: delivery_status
ALTER TABLE delivery_status ALTER COLUMN cargo_weight DROP DEFAULT;
ALTER TABLE delivery_status ALTER COLUMN cargo_weight TYPE VARCHAR USING cargo_weight::VARCHAR;
ALTER TABLE delivery_status ALTER COLUMN distance DROP DEFAULT;
ALTER TABLE delivery_status ALTER COLUMN distance TYPE VARCHAR USING distance::VARCHAR;
ALTER TABLE delivery_status ALTER COLUMN is_on_time TYPE VARCHAR USING is_on_time::VARCHAR;
ALTER TABLE delivery_status ALTER COLUMN vehicle_id TYPE VARCHAR USING vehicle_id::VARCHAR;

-- Table: digital_twin_layout
ALTER TABLE digital_twin_layout ALTER COLUMN external_db_connection_id TYPE VARCHAR USING external_db_connection_id::VARCHAR;
ALTER TABLE digital_twin_layout ALTER COLUMN is_active DROP DEFAULT;
ALTER TABLE digital_twin_layout ALTER COLUMN is_active TYPE VARCHAR USING is_active::VARCHAR;

-- Table: digital_twin_layout_template
ALTER TABLE digital_twin_layout_template ALTER COLUMN external_db_connection_id TYPE VARCHAR USING external_db_connection_id::VARCHAR;

-- Table: digital_twin_objects
ALTER TABLE digital_twin_objects ALTER COLUMN layout_id TYPE VARCHAR USING layout_id::VARCHAR;
ALTER TABLE digital_twin_objects ALTER COLUMN position_x TYPE VARCHAR USING position_x::VARCHAR;
ALTER TABLE digital_twin_objects ALTER COLUMN position_y TYPE VARCHAR USING position_y::VARCHAR;
ALTER TABLE digital_twin_objects ALTER COLUMN position_z TYPE VARCHAR USING position_z::VARCHAR;
ALTER TABLE digital_twin_objects ALTER COLUMN size_x TYPE VARCHAR USING size_x::VARCHAR;
ALTER TABLE digital_twin_objects ALTER COLUMN size_y TYPE VARCHAR USING size_y::VARCHAR;
ALTER TABLE digital_twin_objects ALTER COLUMN size_z TYPE VARCHAR USING size_z::VARCHAR;
ALTER TABLE digital_twin_objects ALTER COLUMN rotation DROP DEFAULT;
ALTER TABLE digital_twin_objects ALTER COLUMN rotation TYPE VARCHAR USING rotation::VARCHAR;
ALTER TABLE digital_twin_objects ALTER COLUMN material_count DROP DEFAULT;
ALTER TABLE digital_twin_objects ALTER COLUMN material_count TYPE VARCHAR USING material_count::VARCHAR;
ALTER TABLE digital_twin_objects ALTER COLUMN material_preview_height TYPE VARCHAR USING material_preview_height::VARCHAR;
ALTER TABLE digital_twin_objects ALTER COLUMN parent_id TYPE VARCHAR USING parent_id::VARCHAR;
ALTER TABLE digital_twin_objects ALTER COLUMN display_order DROP DEFAULT;
ALTER TABLE digital_twin_objects ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;
ALTER TABLE digital_twin_objects ALTER COLUMN locked DROP DEFAULT;
ALTER TABLE digital_twin_objects ALTER COLUMN locked TYPE VARCHAR USING locked::VARCHAR;
ALTER TABLE digital_twin_objects ALTER COLUMN visible DROP DEFAULT;
ALTER TABLE digital_twin_objects ALTER COLUMN visible TYPE VARCHAR USING visible::VARCHAR;
ALTER TABLE digital_twin_objects ALTER COLUMN hierarchy_level DROP DEFAULT;
ALTER TABLE digital_twin_objects ALTER COLUMN hierarchy_level TYPE VARCHAR USING hierarchy_level::VARCHAR;

-- Table: dtg_maintenance_history
ALTER TABLE dtg_maintenance_history ALTER COLUMN id TYPE VARCHAR USING id::VARCHAR;

-- Table: dtg_management_log

-- Table: dynamic_form_data
ALTER TABLE dynamic_form_data ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;

-- Table: equipment_consumable_log

-- Table: equipment_info
ALTER TABLE equipment_info ALTER COLUMN capacity_per_hour TYPE VARCHAR USING capacity_per_hour::VARCHAR;
ALTER TABLE equipment_info ALTER COLUMN capacity_per_day TYPE VARCHAR USING capacity_per_day::VARCHAR;
ALTER TABLE equipment_info ALTER COLUMN max_capacity_per_run TYPE VARCHAR USING max_capacity_per_run::VARCHAR;
ALTER TABLE equipment_info ALTER COLUMN is_active DROP DEFAULT;
ALTER TABLE equipment_info ALTER COLUMN is_active TYPE VARCHAR USING is_active::VARCHAR;

-- Table: equipment_inspection_item_log

-- Table: equipment_mng_log

-- Table: equipment_plc_data_type
ALTER TABLE equipment_plc_data_type ALTER COLUMN collection_interval DROP DEFAULT;
ALTER TABLE equipment_plc_data_type ALTER COLUMN collection_interval TYPE VARCHAR USING collection_interval::VARCHAR;
ALTER TABLE equipment_plc_data_type ALTER COLUMN lower_limit TYPE VARCHAR USING lower_limit::VARCHAR;
ALTER TABLE equipment_plc_data_type ALTER COLUMN upper_limit TYPE VARCHAR USING upper_limit::VARCHAR;
ALTER TABLE equipment_plc_data_type ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE equipment_plc_data_type ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: excel_mapping_template

-- Table: external_call_configs

-- Table: external_db_connections
ALTER TABLE external_db_connections ALTER COLUMN port TYPE VARCHAR USING port::VARCHAR;
ALTER TABLE external_db_connections ALTER COLUMN connection_timeout DROP DEFAULT;
ALTER TABLE external_db_connections ALTER COLUMN connection_timeout TYPE VARCHAR USING connection_timeout::VARCHAR;
ALTER TABLE external_db_connections ALTER COLUMN query_timeout DROP DEFAULT;
ALTER TABLE external_db_connections ALTER COLUMN query_timeout TYPE VARCHAR USING query_timeout::VARCHAR;
ALTER TABLE external_db_connections ALTER COLUMN max_connections DROP DEFAULT;
ALTER TABLE external_db_connections ALTER COLUMN max_connections TYPE VARCHAR USING max_connections::VARCHAR;

-- Table: external_rest_api_connections
ALTER TABLE external_rest_api_connections ALTER COLUMN timeout DROP DEFAULT;
ALTER TABLE external_rest_api_connections ALTER COLUMN timeout TYPE VARCHAR USING timeout::VARCHAR;
ALTER TABLE external_rest_api_connections ALTER COLUMN retry_count DROP DEFAULT;
ALTER TABLE external_rest_api_connections ALTER COLUMN retry_count TYPE VARCHAR USING retry_count::VARCHAR;
ALTER TABLE external_rest_api_connections ALTER COLUMN retry_delay DROP DEFAULT;
ALTER TABLE external_rest_api_connections ALTER COLUMN retry_delay TYPE VARCHAR USING retry_delay::VARCHAR;

-- Table: file_access_control
ALTER TABLE file_access_control ALTER COLUMN file_objid TYPE VARCHAR USING file_objid::VARCHAR;

-- Table: flow_audit_log
ALTER TABLE flow_audit_log ALTER COLUMN flow_definition_id TYPE VARCHAR USING flow_definition_id::VARCHAR;
ALTER TABLE flow_audit_log ALTER COLUMN from_step_id TYPE VARCHAR USING from_step_id::VARCHAR;
ALTER TABLE flow_audit_log ALTER COLUMN to_step_id TYPE VARCHAR USING to_step_id::VARCHAR;
ALTER TABLE flow_audit_log ALTER COLUMN mapping_id TYPE VARCHAR USING mapping_id::VARCHAR;
ALTER TABLE flow_audit_log ALTER COLUMN db_connection_id TYPE VARCHAR USING db_connection_id::VARCHAR;

-- Table: flow_data_mapping
ALTER TABLE flow_data_mapping ALTER COLUMN flow_definition_id TYPE VARCHAR USING flow_definition_id::VARCHAR;
ALTER TABLE flow_data_mapping ALTER COLUMN current_step_id TYPE VARCHAR USING current_step_id::VARCHAR;

-- Table: flow_data_status
ALTER TABLE flow_data_status ALTER COLUMN flow_definition_id TYPE VARCHAR USING flow_definition_id::VARCHAR;
ALTER TABLE flow_data_status ALTER COLUMN current_step_id TYPE VARCHAR USING current_step_id::VARCHAR;

-- Table: flow_definition
ALTER TABLE flow_definition ALTER COLUMN is_active DROP DEFAULT;
ALTER TABLE flow_definition ALTER COLUMN is_active TYPE VARCHAR USING is_active::VARCHAR;
ALTER TABLE flow_definition ALTER COLUMN db_connection_id TYPE VARCHAR USING db_connection_id::VARCHAR;
ALTER TABLE flow_definition ALTER COLUMN rest_api_connection_id TYPE VARCHAR USING rest_api_connection_id::VARCHAR;

-- Table: flow_external_db_connection
ALTER TABLE flow_external_db_connection ALTER COLUMN port TYPE VARCHAR USING port::VARCHAR;
ALTER TABLE flow_external_db_connection ALTER COLUMN ssl_enabled DROP DEFAULT;
ALTER TABLE flow_external_db_connection ALTER COLUMN ssl_enabled TYPE VARCHAR USING ssl_enabled::VARCHAR;
ALTER TABLE flow_external_db_connection ALTER COLUMN is_active DROP DEFAULT;
ALTER TABLE flow_external_db_connection ALTER COLUMN is_active TYPE VARCHAR USING is_active::VARCHAR;

-- Table: flow_integration_log
ALTER TABLE flow_integration_log ALTER COLUMN flow_definition_id TYPE VARCHAR USING flow_definition_id::VARCHAR;
ALTER TABLE flow_integration_log ALTER COLUMN step_id TYPE VARCHAR USING step_id::VARCHAR;
ALTER TABLE flow_integration_log ALTER COLUMN connection_id TYPE VARCHAR USING connection_id::VARCHAR;
ALTER TABLE flow_integration_log ALTER COLUMN execution_time_ms TYPE VARCHAR USING execution_time_ms::VARCHAR;

-- Table: flow_step
ALTER TABLE flow_step ALTER COLUMN flow_definition_id TYPE VARCHAR USING flow_definition_id::VARCHAR;
ALTER TABLE flow_step ALTER COLUMN step_order TYPE VARCHAR USING step_order::VARCHAR;
ALTER TABLE flow_step ALTER COLUMN position_x DROP DEFAULT;
ALTER TABLE flow_step ALTER COLUMN position_x TYPE VARCHAR USING position_x::VARCHAR;
ALTER TABLE flow_step ALTER COLUMN position_y DROP DEFAULT;
ALTER TABLE flow_step ALTER COLUMN position_y TYPE VARCHAR USING position_y::VARCHAR;

-- Table: flow_step_connection
ALTER TABLE flow_step_connection ALTER COLUMN flow_definition_id TYPE VARCHAR USING flow_definition_id::VARCHAR;
ALTER TABLE flow_step_connection ALTER COLUMN from_step_id TYPE VARCHAR USING from_step_id::VARCHAR;
ALTER TABLE flow_step_connection ALTER COLUMN to_step_id TYPE VARCHAR USING to_step_id::VARCHAR;

-- Table: grid_standards
ALTER TABLE grid_standards ALTER COLUMN grid_size TYPE VARCHAR USING grid_size::VARCHAR;
ALTER TABLE grid_standards ALTER COLUMN grid_opacity DROP DEFAULT;
ALTER TABLE grid_standards ALTER COLUMN grid_opacity TYPE VARCHAR USING grid_opacity::VARCHAR;
ALTER TABLE grid_standards ALTER COLUMN snap_enabled DROP DEFAULT;
ALTER TABLE grid_standards ALTER COLUMN snap_enabled TYPE VARCHAR USING snap_enabled::VARCHAR;
ALTER TABLE grid_standards ALTER COLUMN snap_threshold DROP DEFAULT;
ALTER TABLE grid_standards ALTER COLUMN snap_threshold TYPE VARCHAR USING snap_threshold::VARCHAR;
ALTER TABLE grid_standards ALTER COLUMN is_default DROP DEFAULT;
ALTER TABLE grid_standards ALTER COLUMN is_default TYPE VARCHAR USING is_default::VARCHAR;
ALTER TABLE grid_standards ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE grid_standards ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: hierarchy_column_group
ALTER TABLE hierarchy_column_group ALTER COLUMN max_depth DROP DEFAULT;
ALTER TABLE hierarchy_column_group ALTER COLUMN max_depth TYPE VARCHAR USING max_depth::VARCHAR;

-- Table: hierarchy_column_mapping
ALTER TABLE hierarchy_column_mapping ALTER COLUMN group_id TYPE VARCHAR USING group_id::VARCHAR;
ALTER TABLE hierarchy_column_mapping ALTER COLUMN depth TYPE VARCHAR USING depth::VARCHAR;
ALTER TABLE hierarchy_column_mapping ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE hierarchy_column_mapping ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: inbound_detail
ALTER TABLE inbound_detail ALTER COLUMN seq_no TYPE VARCHAR USING seq_no::VARCHAR;
ALTER TABLE inbound_detail ALTER COLUMN inbound_qty DROP DEFAULT;
ALTER TABLE inbound_detail ALTER COLUMN inbound_qty TYPE VARCHAR USING inbound_qty::VARCHAR;
ALTER TABLE inbound_detail ALTER COLUMN unit_price DROP DEFAULT;
ALTER TABLE inbound_detail ALTER COLUMN unit_price TYPE VARCHAR USING unit_price::VARCHAR;
ALTER TABLE inbound_detail ALTER COLUMN total_amount DROP DEFAULT;
ALTER TABLE inbound_detail ALTER COLUMN total_amount TYPE VARCHAR USING total_amount::VARCHAR;

-- Table: inbound_mng
ALTER TABLE inbound_mng ALTER COLUMN inbound_qty TYPE VARCHAR USING inbound_qty::VARCHAR;
ALTER TABLE inbound_mng ALTER COLUMN unit_price TYPE VARCHAR USING unit_price::VARCHAR;
ALTER TABLE inbound_mng ALTER COLUMN total_amount TYPE VARCHAR USING total_amount::VARCHAR;
ALTER TABLE inbound_mng ALTER COLUMN prev_inbound_qty DROP DEFAULT;
ALTER TABLE inbound_mng ALTER COLUMN prev_inbound_qty TYPE VARCHAR USING prev_inbound_qty::VARCHAR;

-- Table: inspection_equipment_mng
ALTER TABLE inspection_equipment_mng ALTER COLUMN calibration_period DROP DEFAULT;
ALTER TABLE inspection_equipment_mng ALTER COLUMN calibration_period TYPE VARCHAR USING calibration_period::VARCHAR;

-- Table: item_routing_version
ALTER TABLE item_routing_version ALTER COLUMN is_default DROP DEFAULT;
ALTER TABLE item_routing_version ALTER COLUMN is_default TYPE VARCHAR USING is_default::VARCHAR;

-- Table: language_master
ALTER TABLE language_master ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE language_master ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: layout_standards
ALTER TABLE layout_standards ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE layout_standards ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: logistics_cost_mng_log

-- Table: maintenance_schedules
ALTER TABLE maintenance_schedules ALTER COLUMN estimated_cost TYPE VARCHAR USING estimated_cost::VARCHAR;
ALTER TABLE maintenance_schedules ALTER COLUMN actual_cost TYPE VARCHAR USING actual_cost::VARCHAR;

-- Table: menu_info
ALTER TABLE menu_info ALTER COLUMN objid DROP DEFAULT;
ALTER TABLE menu_info ALTER COLUMN objid TYPE VARCHAR USING objid::VARCHAR;
ALTER TABLE menu_info ALTER COLUMN menu_type TYPE VARCHAR USING menu_type::VARCHAR;
ALTER TABLE menu_info ALTER COLUMN parent_obj_id TYPE VARCHAR USING parent_obj_id::VARCHAR;
ALTER TABLE menu_info ALTER COLUMN seq TYPE VARCHAR USING seq::VARCHAR;
ALTER TABLE menu_info ALTER COLUMN source_menu_objid TYPE VARCHAR USING source_menu_objid::VARCHAR;
ALTER TABLE menu_info ALTER COLUMN screen_group_id TYPE VARCHAR USING screen_group_id::VARCHAR;

-- Table: menu_screen_group_items
ALTER TABLE menu_screen_group_items ALTER COLUMN group_id TYPE VARCHAR USING group_id::VARCHAR;
ALTER TABLE menu_screen_group_items ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;
ALTER TABLE menu_screen_group_items ALTER COLUMN display_order DROP DEFAULT;
ALTER TABLE menu_screen_group_items ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;

-- Table: menu_screen_groups
ALTER TABLE menu_screen_groups ALTER COLUMN menu_type DROP DEFAULT;
ALTER TABLE menu_screen_groups ALTER COLUMN menu_type TYPE VARCHAR USING menu_type::VARCHAR;
ALTER TABLE menu_screen_groups ALTER COLUMN parent_id TYPE VARCHAR USING parent_id::VARCHAR;
ALTER TABLE menu_screen_groups ALTER COLUMN group_level DROP DEFAULT;
ALTER TABLE menu_screen_groups ALTER COLUMN group_level TYPE VARCHAR USING group_level::VARCHAR;
ALTER TABLE menu_screen_groups ALTER COLUMN display_order DROP DEFAULT;
ALTER TABLE menu_screen_groups ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;
ALTER TABLE menu_screen_groups ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;

-- Table: mold_inspection_item_log

-- Table: mold_mng
ALTER TABLE mold_mng ALTER COLUMN cavity_count DROP DEFAULT;
ALTER TABLE mold_mng ALTER COLUMN cavity_count TYPE VARCHAR USING cavity_count::VARCHAR;
ALTER TABLE mold_mng ALTER COLUMN shot_count DROP DEFAULT;
ALTER TABLE mold_mng ALTER COLUMN shot_count TYPE VARCHAR USING shot_count::VARCHAR;
ALTER TABLE mold_mng ALTER COLUMN mold_quantity DROP DEFAULT;
ALTER TABLE mold_mng ALTER COLUMN mold_quantity TYPE VARCHAR USING mold_quantity::VARCHAR;
ALTER TABLE mold_mng ALTER COLUMN base_input_qty DROP DEFAULT;
ALTER TABLE mold_mng ALTER COLUMN base_input_qty TYPE VARCHAR USING base_input_qty::VARCHAR;
ALTER TABLE mold_mng ALTER COLUMN warranty_shot_count DROP DEFAULT;
ALTER TABLE mold_mng ALTER COLUMN warranty_shot_count TYPE VARCHAR USING warranty_shot_count::VARCHAR;

-- Table: mold_mng_log
ALTER TABLE mold_mng_log ALTER COLUMN warranty_shot_count DROP DEFAULT;
ALTER TABLE mold_mng_log ALTER COLUMN warranty_shot_count TYPE VARCHAR USING warranty_shot_count::VARCHAR;

-- Table: mold_part_log

-- Table: mold_serial
ALTER TABLE mold_serial ALTER COLUMN progress DROP DEFAULT;
ALTER TABLE mold_serial ALTER COLUMN progress TYPE VARCHAR USING progress::VARCHAR;
ALTER TABLE mold_serial ALTER COLUMN current_shot_count DROP DEFAULT;
ALTER TABLE mold_serial ALTER COLUMN current_shot_count TYPE VARCHAR USING current_shot_count::VARCHAR;

-- Table: mold_serial_log
ALTER TABLE mold_serial_log ALTER COLUMN current_shot_count DROP DEFAULT;
ALTER TABLE mold_serial_log ALTER COLUMN current_shot_count TYPE VARCHAR USING current_shot_count::VARCHAR;

-- Table: multi_lang_category
ALTER TABLE multi_lang_category ALTER COLUMN parent_id TYPE VARCHAR USING parent_id::VARCHAR;
ALTER TABLE multi_lang_category ALTER COLUMN level DROP DEFAULT;
ALTER TABLE multi_lang_category ALTER COLUMN level TYPE VARCHAR USING level::VARCHAR;
ALTER TABLE multi_lang_category ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE multi_lang_category ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: multi_lang_key_master
ALTER TABLE multi_lang_key_master ALTER COLUMN category_id TYPE VARCHAR USING category_id::VARCHAR;
ALTER TABLE multi_lang_key_master ALTER COLUMN base_key_id TYPE VARCHAR USING base_key_id::VARCHAR;

-- Table: multi_lang_text
ALTER TABLE multi_lang_text ALTER COLUMN key_id TYPE VARCHAR USING key_id::VARCHAR;

-- Table: multi_table_excel_config
ALTER TABLE multi_table_excel_config ALTER COLUMN is_active DROP DEFAULT;
ALTER TABLE multi_table_excel_config ALTER COLUMN is_active TYPE VARCHAR USING is_active::VARCHAR;

-- Table: node_flows

-- Table: notices
ALTER TABLE notices ALTER COLUMN is_pinned DROP DEFAULT;
ALTER TABLE notices ALTER COLUMN is_pinned TYPE VARCHAR USING is_pinned::VARCHAR;

-- Table: numbering_audit_log
ALTER TABLE numbering_audit_log ALTER COLUMN transaction_id TYPE VARCHAR USING transaction_id::VARCHAR;

-- Table: numbering_rule_parts
ALTER TABLE numbering_rule_parts ALTER COLUMN id TYPE VARCHAR USING id::VARCHAR;
ALTER TABLE numbering_rule_parts ALTER COLUMN part_order TYPE VARCHAR USING part_order::VARCHAR;

-- Table: numbering_rule_parts_old
ALTER TABLE numbering_rule_parts_old ALTER COLUMN part_order TYPE VARCHAR USING part_order::VARCHAR;

-- Table: numbering_rule_sequences
ALTER TABLE numbering_rule_sequences ALTER COLUMN current_sequence DROP DEFAULT;
ALTER TABLE numbering_rule_sequences ALTER COLUMN current_sequence TYPE VARCHAR USING current_sequence::VARCHAR;

-- Table: numbering_rules
ALTER TABLE numbering_rules ALTER COLUMN current_sequence TYPE VARCHAR USING current_sequence::VARCHAR;
ALTER TABLE numbering_rules ALTER COLUMN category_value_id TYPE VARCHAR USING category_value_id::VARCHAR;

-- Table: numbering_rules_old
ALTER TABLE numbering_rules_old ALTER COLUMN current_sequence DROP DEFAULT;
ALTER TABLE numbering_rules_old ALTER COLUMN current_sequence TYPE VARCHAR USING current_sequence::VARCHAR;
ALTER TABLE numbering_rules_old ALTER COLUMN menu_objid TYPE VARCHAR USING menu_objid::VARCHAR;

-- Table: outbound_detail
ALTER TABLE outbound_detail ALTER COLUMN seq_no TYPE VARCHAR USING seq_no::VARCHAR;
ALTER TABLE outbound_detail ALTER COLUMN outbound_qty DROP DEFAULT;
ALTER TABLE outbound_detail ALTER COLUMN outbound_qty TYPE VARCHAR USING outbound_qty::VARCHAR;
ALTER TABLE outbound_detail ALTER COLUMN unit_price DROP DEFAULT;
ALTER TABLE outbound_detail ALTER COLUMN unit_price TYPE VARCHAR USING unit_price::VARCHAR;
ALTER TABLE outbound_detail ALTER COLUMN total_amount DROP DEFAULT;
ALTER TABLE outbound_detail ALTER COLUMN total_amount TYPE VARCHAR USING total_amount::VARCHAR;

-- Table: procedure_test

-- Table: procedure_test_log
ALTER TABLE procedure_test_log ALTER COLUMN name_length TYPE VARCHAR USING name_length::VARCHAR;

-- Table: process_work_item
ALTER TABLE process_work_item ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE process_work_item ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: process_work_item_detail
ALTER TABLE process_work_item_detail ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE process_work_item_detail ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;
ALTER TABLE process_work_item_detail ALTER COLUMN duration_minutes TYPE VARCHAR USING duration_minutes::VARCHAR;

-- Table: production_plan_mng
ALTER TABLE production_plan_mng ALTER COLUMN plan_qty TYPE VARCHAR USING plan_qty::VARCHAR;
ALTER TABLE production_plan_mng ALTER COLUMN completed_qty DROP DEFAULT;
ALTER TABLE production_plan_mng ALTER COLUMN completed_qty TYPE VARCHAR USING completed_qty::VARCHAR;
ALTER TABLE production_plan_mng ALTER COLUMN progress_rate DROP DEFAULT;
ALTER TABLE production_plan_mng ALTER COLUMN progress_rate TYPE VARCHAR USING progress_rate::VARCHAR;
ALTER TABLE production_plan_mng ALTER COLUMN equipment_id TYPE VARCHAR USING equipment_id::VARCHAR;
ALTER TABLE production_plan_mng ALTER COLUMN hourly_capacity TYPE VARCHAR USING hourly_capacity::VARCHAR;
ALTER TABLE production_plan_mng ALTER COLUMN daily_capacity TYPE VARCHAR USING daily_capacity::VARCHAR;
ALTER TABLE production_plan_mng ALTER COLUMN lead_time DROP DEFAULT;
ALTER TABLE production_plan_mng ALTER COLUMN lead_time TYPE VARCHAR USING lead_time::VARCHAR;
ALTER TABLE production_plan_mng ALTER COLUMN parent_plan_id TYPE VARCHAR USING parent_plan_id::VARCHAR;

-- Table: production_plan_order_rel
ALTER TABLE production_plan_order_rel ALTER COLUMN plan_id TYPE VARCHAR USING plan_id::VARCHAR;
ALTER TABLE production_plan_order_rel ALTER COLUMN order_qty TYPE VARCHAR USING order_qty::VARCHAR;

-- Table: purchase_order_mng
ALTER TABLE purchase_order_mng ALTER COLUMN allow_price_edit DROP DEFAULT;
ALTER TABLE purchase_order_mng ALTER COLUMN allow_price_edit TYPE VARCHAR USING allow_price_edit::VARCHAR;

-- Table: rel_menu_auth
ALTER TABLE rel_menu_auth ALTER COLUMN objid TYPE VARCHAR USING objid::VARCHAR;
ALTER TABLE rel_menu_auth ALTER COLUMN menu_objid TYPE VARCHAR USING menu_objid::VARCHAR;
ALTER TABLE rel_menu_auth ALTER COLUMN auth_objid TYPE VARCHAR USING auth_objid::VARCHAR;

-- Table: report_layout
ALTER TABLE report_layout ALTER COLUMN canvas_width DROP DEFAULT;
ALTER TABLE report_layout ALTER COLUMN canvas_width TYPE VARCHAR USING canvas_width::VARCHAR;
ALTER TABLE report_layout ALTER COLUMN canvas_height DROP DEFAULT;
ALTER TABLE report_layout ALTER COLUMN canvas_height TYPE VARCHAR USING canvas_height::VARCHAR;
ALTER TABLE report_layout ALTER COLUMN margin_top DROP DEFAULT;
ALTER TABLE report_layout ALTER COLUMN margin_top TYPE VARCHAR USING margin_top::VARCHAR;
ALTER TABLE report_layout ALTER COLUMN margin_bottom DROP DEFAULT;
ALTER TABLE report_layout ALTER COLUMN margin_bottom TYPE VARCHAR USING margin_bottom::VARCHAR;
ALTER TABLE report_layout ALTER COLUMN margin_left DROP DEFAULT;
ALTER TABLE report_layout ALTER COLUMN margin_left TYPE VARCHAR USING margin_left::VARCHAR;
ALTER TABLE report_layout ALTER COLUMN margin_right DROP DEFAULT;
ALTER TABLE report_layout ALTER COLUMN margin_right TYPE VARCHAR USING margin_right::VARCHAR;

-- Table: report_menu_mapping
ALTER TABLE report_menu_mapping ALTER COLUMN menu_objid TYPE VARCHAR USING menu_objid::VARCHAR;

-- Table: report_query
ALTER TABLE report_query ALTER COLUMN display_order DROP DEFAULT;
ALTER TABLE report_query ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;
ALTER TABLE report_query ALTER COLUMN external_connection_id TYPE VARCHAR USING external_connection_id::VARCHAR;

-- Table: report_template
ALTER TABLE report_template ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE report_template ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: safety_budget_execution
ALTER TABLE safety_budget_execution ALTER COLUMN approved_budget TYPE VARCHAR USING approved_budget::VARCHAR;
ALTER TABLE safety_budget_execution ALTER COLUMN executed_amount TYPE VARCHAR USING executed_amount::VARCHAR;
ALTER TABLE safety_budget_execution ALTER COLUMN execution_rate TYPE VARCHAR USING execution_rate::VARCHAR;
ALTER TABLE safety_budget_execution ALTER COLUMN remaining_budget TYPE VARCHAR USING remaining_budget::VARCHAR;

-- Table: safety_incidents
ALTER TABLE safety_incidents ALTER COLUMN casualties DROP DEFAULT;
ALTER TABLE safety_incidents ALTER COLUMN casualties TYPE VARCHAR USING casualties::VARCHAR;
ALTER TABLE safety_incidents ALTER COLUMN property_damage DROP DEFAULT;
ALTER TABLE safety_incidents ALTER COLUMN property_damage TYPE VARCHAR USING property_damage::VARCHAR;

-- Table: safety_inspections_log

-- Table: sales_order_mng
ALTER TABLE sales_order_mng ALTER COLUMN order_qty DROP DEFAULT;
ALTER TABLE sales_order_mng ALTER COLUMN order_qty TYPE VARCHAR USING order_qty::VARCHAR;
ALTER TABLE sales_order_mng ALTER COLUMN ship_qty DROP DEFAULT;
ALTER TABLE sales_order_mng ALTER COLUMN ship_qty TYPE VARCHAR USING ship_qty::VARCHAR;
ALTER TABLE sales_order_mng ALTER COLUMN balance_qty DROP DEFAULT;
ALTER TABLE sales_order_mng ALTER COLUMN balance_qty TYPE VARCHAR USING balance_qty::VARCHAR;
ALTER TABLE sales_order_mng ALTER COLUMN inventory_qty DROP DEFAULT;
ALTER TABLE sales_order_mng ALTER COLUMN inventory_qty TYPE VARCHAR USING inventory_qty::VARCHAR;
ALTER TABLE sales_order_mng ALTER COLUMN plan_ship_qty DROP DEFAULT;
ALTER TABLE sales_order_mng ALTER COLUMN plan_ship_qty TYPE VARCHAR USING plan_ship_qty::VARCHAR;
ALTER TABLE sales_order_mng ALTER COLUMN unit_price DROP DEFAULT;
ALTER TABLE sales_order_mng ALTER COLUMN unit_price TYPE VARCHAR USING unit_price::VARCHAR;
ALTER TABLE sales_order_mng ALTER COLUMN total_amount DROP DEFAULT;
ALTER TABLE sales_order_mng ALTER COLUMN total_amount TYPE VARCHAR USING total_amount::VARCHAR;

-- Table: schedule_history
ALTER TABLE schedule_history ALTER COLUMN schedule_id TYPE VARCHAR USING schedule_id::VARCHAR;

-- Table: schedule_mng
ALTER TABLE schedule_mng ALTER COLUMN plan_qty TYPE VARCHAR USING plan_qty::VARCHAR;
ALTER TABLE schedule_mng ALTER COLUMN actual_qty TYPE VARCHAR USING actual_qty::VARCHAR;
ALTER TABLE schedule_mng ALTER COLUMN auto_generated DROP DEFAULT;
ALTER TABLE schedule_mng ALTER COLUMN auto_generated TYPE VARCHAR USING auto_generated::VARCHAR;

-- Table: schedule_source_mapping
ALTER TABLE schedule_source_mapping ALTER COLUMN schedule_id TYPE VARCHAR USING schedule_id::VARCHAR;
ALTER TABLE schedule_source_mapping ALTER COLUMN source_qty TYPE VARCHAR USING source_qty::VARCHAR;

-- Table: screen_conditional_zones
ALTER TABLE screen_conditional_zones ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;
ALTER TABLE screen_conditional_zones ALTER COLUMN x DROP DEFAULT;
ALTER TABLE screen_conditional_zones ALTER COLUMN x TYPE VARCHAR USING x::VARCHAR;
ALTER TABLE screen_conditional_zones ALTER COLUMN y DROP DEFAULT;
ALTER TABLE screen_conditional_zones ALTER COLUMN y TYPE VARCHAR USING y::VARCHAR;
ALTER TABLE screen_conditional_zones ALTER COLUMN width DROP DEFAULT;
ALTER TABLE screen_conditional_zones ALTER COLUMN width TYPE VARCHAR USING width::VARCHAR;
ALTER TABLE screen_conditional_zones ALTER COLUMN height DROP DEFAULT;
ALTER TABLE screen_conditional_zones ALTER COLUMN height TYPE VARCHAR USING height::VARCHAR;

-- Table: screen_data_flows
ALTER TABLE screen_data_flows ALTER COLUMN group_id TYPE VARCHAR USING group_id::VARCHAR;
ALTER TABLE screen_data_flows ALTER COLUMN source_screen_id TYPE VARCHAR USING source_screen_id::VARCHAR;
ALTER TABLE screen_data_flows ALTER COLUMN target_screen_id TYPE VARCHAR USING target_screen_id::VARCHAR;

-- Table: screen_data_transfer
ALTER TABLE screen_data_transfer ALTER COLUMN source_screen_id TYPE VARCHAR USING source_screen_id::VARCHAR;
ALTER TABLE screen_data_transfer ALTER COLUMN target_screen_id TYPE VARCHAR USING target_screen_id::VARCHAR;

-- Table: screen_definitions
ALTER TABLE screen_definitions ALTER COLUMN db_connection_id TYPE VARCHAR USING db_connection_id::VARCHAR;
ALTER TABLE screen_definitions ALTER COLUMN rest_api_connection_id TYPE VARCHAR USING rest_api_connection_id::VARCHAR;
ALTER TABLE screen_definitions ALTER COLUMN source_screen_id TYPE VARCHAR USING source_screen_id::VARCHAR;

-- Table: screen_embedding
ALTER TABLE screen_embedding ALTER COLUMN parent_screen_id TYPE VARCHAR USING parent_screen_id::VARCHAR;
ALTER TABLE screen_embedding ALTER COLUMN child_screen_id TYPE VARCHAR USING child_screen_id::VARCHAR;

-- Table: screen_field_joins
ALTER TABLE screen_field_joins ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;
ALTER TABLE screen_field_joins ALTER COLUMN layout_id TYPE VARCHAR USING layout_id::VARCHAR;

-- Table: screen_group_screens
ALTER TABLE screen_group_screens ALTER COLUMN group_id TYPE VARCHAR USING group_id::VARCHAR;
ALTER TABLE screen_group_screens ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;
ALTER TABLE screen_group_screens ALTER COLUMN display_order DROP DEFAULT;
ALTER TABLE screen_group_screens ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;

-- Table: screen_group_screens_backup_20260202
ALTER TABLE screen_group_screens_backup_20260202 ALTER COLUMN id TYPE VARCHAR USING id::VARCHAR;
ALTER TABLE screen_group_screens_backup_20260202 ALTER COLUMN group_id TYPE VARCHAR USING group_id::VARCHAR;
ALTER TABLE screen_group_screens_backup_20260202 ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;
ALTER TABLE screen_group_screens_backup_20260202 ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;

-- Table: screen_groups
ALTER TABLE screen_groups ALTER COLUMN display_order DROP DEFAULT;
ALTER TABLE screen_groups ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;
ALTER TABLE screen_groups ALTER COLUMN parent_group_id TYPE VARCHAR USING parent_group_id::VARCHAR;
ALTER TABLE screen_groups ALTER COLUMN group_level DROP DEFAULT;
ALTER TABLE screen_groups ALTER COLUMN group_level TYPE VARCHAR USING group_level::VARCHAR;
ALTER TABLE screen_groups ALTER COLUMN menu_objid TYPE VARCHAR USING menu_objid::VARCHAR;

-- Table: screen_groups_backup_20260202
ALTER TABLE screen_groups_backup_20260202 ALTER COLUMN id TYPE VARCHAR USING id::VARCHAR;
ALTER TABLE screen_groups_backup_20260202 ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;
ALTER TABLE screen_groups_backup_20260202 ALTER COLUMN parent_group_id TYPE VARCHAR USING parent_group_id::VARCHAR;
ALTER TABLE screen_groups_backup_20260202 ALTER COLUMN group_level TYPE VARCHAR USING group_level::VARCHAR;
ALTER TABLE screen_groups_backup_20260202 ALTER COLUMN menu_objid TYPE VARCHAR USING menu_objid::VARCHAR;

-- Table: screen_layouts
ALTER TABLE screen_layouts ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;
ALTER TABLE screen_layouts ALTER COLUMN position_x TYPE VARCHAR USING position_x::VARCHAR;
ALTER TABLE screen_layouts ALTER COLUMN position_y TYPE VARCHAR USING position_y::VARCHAR;
ALTER TABLE screen_layouts ALTER COLUMN width TYPE VARCHAR USING width::VARCHAR;
ALTER TABLE screen_layouts ALTER COLUMN height TYPE VARCHAR USING height::VARCHAR;
ALTER TABLE screen_layouts ALTER COLUMN display_order DROP DEFAULT;
ALTER TABLE screen_layouts ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;

-- Table: screen_layouts_backup_20260127
ALTER TABLE screen_layouts_backup_20260127 ALTER COLUMN layout_id TYPE VARCHAR USING layout_id::VARCHAR;
ALTER TABLE screen_layouts_backup_20260127 ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;
ALTER TABLE screen_layouts_backup_20260127 ALTER COLUMN position_x TYPE VARCHAR USING position_x::VARCHAR;
ALTER TABLE screen_layouts_backup_20260127 ALTER COLUMN position_y TYPE VARCHAR USING position_y::VARCHAR;
ALTER TABLE screen_layouts_backup_20260127 ALTER COLUMN width TYPE VARCHAR USING width::VARCHAR;
ALTER TABLE screen_layouts_backup_20260127 ALTER COLUMN height TYPE VARCHAR USING height::VARCHAR;
ALTER TABLE screen_layouts_backup_20260127 ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;

-- Table: screen_layouts_pop
ALTER TABLE screen_layouts_pop ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;

-- Table: screen_layouts_v1
ALTER TABLE screen_layouts_v1 ALTER COLUMN position_x DROP DEFAULT;
ALTER TABLE screen_layouts_v1 ALTER COLUMN position_x TYPE VARCHAR USING position_x::VARCHAR;
ALTER TABLE screen_layouts_v1 ALTER COLUMN position_y DROP DEFAULT;
ALTER TABLE screen_layouts_v1 ALTER COLUMN position_y TYPE VARCHAR USING position_y::VARCHAR;
ALTER TABLE screen_layouts_v1 ALTER COLUMN width DROP DEFAULT;
ALTER TABLE screen_layouts_v1 ALTER COLUMN width TYPE VARCHAR USING width::VARCHAR;
ALTER TABLE screen_layouts_v1 ALTER COLUMN height DROP DEFAULT;
ALTER TABLE screen_layouts_v1 ALTER COLUMN height TYPE VARCHAR USING height::VARCHAR;
ALTER TABLE screen_layouts_v1 ALTER COLUMN display_order DROP DEFAULT;
ALTER TABLE screen_layouts_v1 ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;

-- Table: screen_layouts_v2
ALTER TABLE screen_layouts_v2 ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;
ALTER TABLE screen_layouts_v2 ALTER COLUMN layer_id DROP DEFAULT;
ALTER TABLE screen_layouts_v2 ALTER COLUMN layer_id TYPE VARCHAR USING layer_id::VARCHAR;

-- Table: screen_layouts_v2_backup
ALTER TABLE screen_layouts_v2_backup ALTER COLUMN layout_id TYPE VARCHAR USING layout_id::VARCHAR;
ALTER TABLE screen_layouts_v2_backup ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;

-- Table: screen_layouts_v3
ALTER TABLE screen_layouts_v3 ALTER COLUMN layout_id TYPE VARCHAR USING layout_id::VARCHAR;
ALTER TABLE screen_layouts_v3 ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;

-- Table: screen_menu_assignments
ALTER TABLE screen_menu_assignments ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;
ALTER TABLE screen_menu_assignments ALTER COLUMN menu_objid TYPE VARCHAR USING menu_objid::VARCHAR;
ALTER TABLE screen_menu_assignments ALTER COLUMN display_order DROP DEFAULT;
ALTER TABLE screen_menu_assignments ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;

-- Table: screen_split_panel
ALTER TABLE screen_split_panel ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;
ALTER TABLE screen_split_panel ALTER COLUMN left_embedding_id TYPE VARCHAR USING left_embedding_id::VARCHAR;
ALTER TABLE screen_split_panel ALTER COLUMN right_embedding_id TYPE VARCHAR USING right_embedding_id::VARCHAR;
ALTER TABLE screen_split_panel ALTER COLUMN data_transfer_id TYPE VARCHAR USING data_transfer_id::VARCHAR;

-- Table: screen_table_relations
ALTER TABLE screen_table_relations ALTER COLUMN group_id TYPE VARCHAR USING group_id::VARCHAR;
ALTER TABLE screen_table_relations ALTER COLUMN screen_id TYPE VARCHAR USING screen_id::VARCHAR;

-- Table: screen_templates
ALTER TABLE screen_templates ALTER COLUMN is_public DROP DEFAULT;
ALTER TABLE screen_templates ALTER COLUMN is_public TYPE VARCHAR USING is_public::VARCHAR;

-- Table: shipment_instruction

-- Table: shipment_instruction_detail
ALTER TABLE shipment_instruction_detail ALTER COLUMN instruction_id TYPE VARCHAR USING instruction_id::VARCHAR;
ALTER TABLE shipment_instruction_detail ALTER COLUMN shipment_plan_id TYPE VARCHAR USING shipment_plan_id::VARCHAR;
ALTER TABLE shipment_instruction_detail ALTER COLUMN sales_order_id TYPE VARCHAR USING sales_order_id::VARCHAR;
ALTER TABLE shipment_instruction_detail ALTER COLUMN order_qty DROP DEFAULT;
ALTER TABLE shipment_instruction_detail ALTER COLUMN order_qty TYPE VARCHAR USING order_qty::VARCHAR;
ALTER TABLE shipment_instruction_detail ALTER COLUMN plan_qty DROP DEFAULT;
ALTER TABLE shipment_instruction_detail ALTER COLUMN plan_qty TYPE VARCHAR USING plan_qty::VARCHAR;
ALTER TABLE shipment_instruction_detail ALTER COLUMN ship_qty DROP DEFAULT;
ALTER TABLE shipment_instruction_detail ALTER COLUMN ship_qty TYPE VARCHAR USING ship_qty::VARCHAR;

-- Table: shipment_plan
ALTER TABLE shipment_plan ALTER COLUMN sales_order_id TYPE VARCHAR USING sales_order_id::VARCHAR;
ALTER TABLE shipment_plan ALTER COLUMN plan_qty DROP DEFAULT;
ALTER TABLE shipment_plan ALTER COLUMN plan_qty TYPE VARCHAR USING plan_qty::VARCHAR;

-- Table: style_templates
ALTER TABLE style_templates ALTER COLUMN is_default DROP DEFAULT;
ALTER TABLE style_templates ALTER COLUMN is_default TYPE VARCHAR USING is_default::VARCHAR;
ALTER TABLE style_templates ALTER COLUMN is_public DROP DEFAULT;
ALTER TABLE style_templates ALTER COLUMN is_public TYPE VARCHAR USING is_public::VARCHAR;
ALTER TABLE style_templates ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE style_templates ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: subcontractor_item_mapping
ALTER TABLE subcontractor_item_mapping ALTER COLUMN base_price TYPE VARCHAR USING base_price::VARCHAR;
ALTER TABLE subcontractor_item_mapping ALTER COLUMN calculated_price TYPE VARCHAR USING calculated_price::VARCHAR;
ALTER TABLE subcontractor_item_mapping ALTER COLUMN discount_value TYPE VARCHAR USING discount_value::VARCHAR;

-- Table: subcontractor_item_prices
ALTER TABLE subcontractor_item_prices ALTER COLUMN unit_price DROP DEFAULT;
ALTER TABLE subcontractor_item_prices ALTER COLUMN unit_price TYPE VARCHAR USING unit_price::VARCHAR;
ALTER TABLE subcontractor_item_prices ALTER COLUMN supply_price DROP DEFAULT;
ALTER TABLE subcontractor_item_prices ALTER COLUMN supply_price TYPE VARCHAR USING supply_price::VARCHAR;
ALTER TABLE subcontractor_item_prices ALTER COLUMN vat_included_price DROP DEFAULT;
ALTER TABLE subcontractor_item_prices ALTER COLUMN vat_included_price TYPE VARCHAR USING vat_included_price::VARCHAR;
ALTER TABLE subcontractor_item_prices ALTER COLUMN base_price DROP DEFAULT;
ALTER TABLE subcontractor_item_prices ALTER COLUMN base_price TYPE VARCHAR USING base_price::VARCHAR;
ALTER TABLE subcontractor_item_prices ALTER COLUMN discount_value DROP DEFAULT;
ALTER TABLE subcontractor_item_prices ALTER COLUMN discount_value TYPE VARCHAR USING discount_value::VARCHAR;
ALTER TABLE subcontractor_item_prices ALTER COLUMN calculated_price DROP DEFAULT;
ALTER TABLE subcontractor_item_prices ALTER COLUMN calculated_price TYPE VARCHAR USING calculated_price::VARCHAR;

-- Table: subcontractor_mng_log

-- Table: supplier_item_mapping
ALTER TABLE supplier_item_mapping ALTER COLUMN base_price TYPE VARCHAR USING base_price::VARCHAR;
ALTER TABLE supplier_item_mapping ALTER COLUMN calculated_price TYPE VARCHAR USING calculated_price::VARCHAR;
ALTER TABLE supplier_item_mapping ALTER COLUMN discount_value TYPE VARCHAR USING discount_value::VARCHAR;

-- Table: supplier_item_prices
ALTER TABLE supplier_item_prices ALTER COLUMN unit_price TYPE VARCHAR USING unit_price::VARCHAR;
ALTER TABLE supplier_item_prices ALTER COLUMN supply_price TYPE VARCHAR USING supply_price::VARCHAR;
ALTER TABLE supplier_item_prices ALTER COLUMN vat_included_price TYPE VARCHAR USING vat_included_price::VARCHAR;
ALTER TABLE supplier_item_prices ALTER COLUMN base_price TYPE VARCHAR USING base_price::VARCHAR;
ALTER TABLE supplier_item_prices ALTER COLUMN discount_value TYPE VARCHAR USING discount_value::VARCHAR;
ALTER TABLE supplier_item_prices ALTER COLUMN calculated_price TYPE VARCHAR USING calculated_price::VARCHAR;

-- Table: supplier_mng_log

-- Table: system_audit_log

-- Table: system_health_log
ALTER TABLE system_health_log ALTER COLUMN response_time_ms TYPE VARCHAR USING response_time_ms::VARCHAR;
ALTER TABLE system_health_log ALTER COLUMN cpu_usage TYPE VARCHAR USING cpu_usage::VARCHAR;
ALTER TABLE system_health_log ALTER COLUMN memory_usage TYPE VARCHAR USING memory_usage::VARCHAR;
ALTER TABLE system_health_log ALTER COLUMN disk_usage TYPE VARCHAR USING disk_usage::VARCHAR;

-- Table: system_notice
ALTER TABLE system_notice ALTER COLUMN is_active DROP DEFAULT;
ALTER TABLE system_notice ALTER COLUMN is_active TYPE VARCHAR USING is_active::VARCHAR;
ALTER TABLE system_notice ALTER COLUMN priority DROP DEFAULT;
ALTER TABLE system_notice ALTER COLUMN priority TYPE VARCHAR USING priority::VARCHAR;

-- Table: table_column_category_values
ALTER TABLE table_column_category_values ALTER COLUMN value_order DROP DEFAULT;
ALTER TABLE table_column_category_values ALTER COLUMN value_order TYPE VARCHAR USING value_order::VARCHAR;
ALTER TABLE table_column_category_values ALTER COLUMN parent_value_id TYPE VARCHAR USING parent_value_id::VARCHAR;
ALTER TABLE table_column_category_values ALTER COLUMN depth DROP DEFAULT;
ALTER TABLE table_column_category_values ALTER COLUMN depth TYPE VARCHAR USING depth::VARCHAR;
ALTER TABLE table_column_category_values ALTER COLUMN is_active DROP DEFAULT;
ALTER TABLE table_column_category_values ALTER COLUMN is_active TYPE VARCHAR USING is_active::VARCHAR;
ALTER TABLE table_column_category_values ALTER COLUMN is_default DROP DEFAULT;
ALTER TABLE table_column_category_values ALTER COLUMN is_default TYPE VARCHAR USING is_default::VARCHAR;
ALTER TABLE table_column_category_values ALTER COLUMN menu_objid TYPE VARCHAR USING menu_objid::VARCHAR;

-- Table: table_log_config

-- Table: table_relationships
ALTER TABLE table_relationships ALTER COLUMN diagram_id TYPE VARCHAR USING diagram_id::VARCHAR;

-- Table: table_type_columns
ALTER TABLE table_type_columns ALTER COLUMN display_order DROP DEFAULT;
ALTER TABLE table_type_columns ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;
ALTER TABLE table_type_columns ALTER COLUMN is_visible DROP DEFAULT;
ALTER TABLE table_type_columns ALTER COLUMN is_visible TYPE VARCHAR USING is_visible::VARCHAR;

-- Table: table_type_columns_backup
ALTER TABLE table_type_columns_backup ALTER COLUMN id TYPE VARCHAR USING id::VARCHAR;
ALTER TABLE table_type_columns_backup ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;
ALTER TABLE table_type_columns_backup ALTER COLUMN is_visible TYPE VARCHAR USING is_visible::VARCHAR;

-- Table: table_type_columns_backup_20260126
ALTER TABLE table_type_columns_backup_20260126 ALTER COLUMN id TYPE VARCHAR USING id::VARCHAR;
ALTER TABLE table_type_columns_backup_20260126 ALTER COLUMN display_order TYPE VARCHAR USING display_order::VARCHAR;

-- Table: table_type_columns_log

-- Table: tax_invoice
ALTER TABLE tax_invoice ALTER COLUMN supply_amount DROP DEFAULT;
ALTER TABLE tax_invoice ALTER COLUMN supply_amount TYPE VARCHAR USING supply_amount::VARCHAR;
ALTER TABLE tax_invoice ALTER COLUMN tax_amount DROP DEFAULT;
ALTER TABLE tax_invoice ALTER COLUMN tax_amount TYPE VARCHAR USING tax_amount::VARCHAR;
ALTER TABLE tax_invoice ALTER COLUMN total_amount DROP DEFAULT;
ALTER TABLE tax_invoice ALTER COLUMN total_amount TYPE VARCHAR USING total_amount::VARCHAR;
ALTER TABLE tax_invoice ALTER COLUMN quantity DROP DEFAULT;
ALTER TABLE tax_invoice ALTER COLUMN quantity TYPE VARCHAR USING quantity::VARCHAR;
ALTER TABLE tax_invoice ALTER COLUMN unit_price DROP DEFAULT;
ALTER TABLE tax_invoice ALTER COLUMN unit_price TYPE VARCHAR USING unit_price::VARCHAR;

-- Table: tax_invoice_item
ALTER TABLE tax_invoice_item ALTER COLUMN tax_invoice_id TYPE VARCHAR USING tax_invoice_id::VARCHAR;
ALTER TABLE tax_invoice_item ALTER COLUMN item_seq DROP DEFAULT;
ALTER TABLE tax_invoice_item ALTER COLUMN item_seq TYPE VARCHAR USING item_seq::VARCHAR;
ALTER TABLE tax_invoice_item ALTER COLUMN quantity DROP DEFAULT;
ALTER TABLE tax_invoice_item ALTER COLUMN quantity TYPE VARCHAR USING quantity::VARCHAR;
ALTER TABLE tax_invoice_item ALTER COLUMN unit_price DROP DEFAULT;
ALTER TABLE tax_invoice_item ALTER COLUMN unit_price TYPE VARCHAR USING unit_price::VARCHAR;
ALTER TABLE tax_invoice_item ALTER COLUMN supply_amount DROP DEFAULT;
ALTER TABLE tax_invoice_item ALTER COLUMN supply_amount TYPE VARCHAR USING supply_amount::VARCHAR;
ALTER TABLE tax_invoice_item ALTER COLUMN tax_amount DROP DEFAULT;
ALTER TABLE tax_invoice_item ALTER COLUMN tax_amount TYPE VARCHAR USING tax_amount::VARCHAR;

-- Table: transport_logs
ALTER TABLE transport_logs ALTER COLUMN vehicle_id TYPE VARCHAR USING vehicle_id::VARCHAR;
ALTER TABLE transport_logs ALTER COLUMN start_lat TYPE VARCHAR USING start_lat::VARCHAR;
ALTER TABLE transport_logs ALTER COLUMN start_lng TYPE VARCHAR USING start_lng::VARCHAR;
ALTER TABLE transport_logs ALTER COLUMN end_lat TYPE VARCHAR USING end_lat::VARCHAR;
ALTER TABLE transport_logs ALTER COLUMN end_lng TYPE VARCHAR USING end_lng::VARCHAR;
ALTER TABLE transport_logs ALTER COLUMN distance_km TYPE VARCHAR USING distance_km::VARCHAR;
ALTER TABLE transport_logs ALTER COLUMN duration_minutes TYPE VARCHAR USING duration_minutes::VARCHAR;

-- Table: transport_statistics
ALTER TABLE transport_statistics ALTER COLUMN vehicle_id TYPE VARCHAR USING vehicle_id::VARCHAR;
ALTER TABLE transport_statistics ALTER COLUMN empty_count DROP DEFAULT;
ALTER TABLE transport_statistics ALTER COLUMN empty_count TYPE VARCHAR USING empty_count::VARCHAR;
ALTER TABLE transport_statistics ALTER COLUMN loaded_count DROP DEFAULT;
ALTER TABLE transport_statistics ALTER COLUMN loaded_count TYPE VARCHAR USING loaded_count::VARCHAR;
ALTER TABLE transport_statistics ALTER COLUMN empty_duration_minutes DROP DEFAULT;
ALTER TABLE transport_statistics ALTER COLUMN empty_duration_minutes TYPE VARCHAR USING empty_duration_minutes::VARCHAR;
ALTER TABLE transport_statistics ALTER COLUMN loaded_duration_minutes DROP DEFAULT;
ALTER TABLE transport_statistics ALTER COLUMN loaded_duration_minutes TYPE VARCHAR USING loaded_duration_minutes::VARCHAR;
ALTER TABLE transport_statistics ALTER COLUMN total_distance_km DROP DEFAULT;
ALTER TABLE transport_statistics ALTER COLUMN total_distance_km TYPE VARCHAR USING total_distance_km::VARCHAR;
ALTER TABLE transport_statistics ALTER COLUMN empty_distance_km DROP DEFAULT;
ALTER TABLE transport_statistics ALTER COLUMN empty_distance_km TYPE VARCHAR USING empty_distance_km::VARCHAR;
ALTER TABLE transport_statistics ALTER COLUMN loaded_distance_km DROP DEFAULT;
ALTER TABLE transport_statistics ALTER COLUMN loaded_distance_km TYPE VARCHAR USING loaded_distance_km::VARCHAR;

-- Table: user_dept
ALTER TABLE user_dept ALTER COLUMN is_primary DROP DEFAULT;
ALTER TABLE user_dept ALTER COLUMN is_primary TYPE VARCHAR USING is_primary::VARCHAR;

-- Table: user_info
ALTER TABLE user_info ALTER COLUMN token_version DROP DEFAULT;
ALTER TABLE user_info ALTER COLUMN token_version TYPE VARCHAR USING token_version::VARCHAR;

-- Table: user_mail_accounts
ALTER TABLE user_mail_accounts ALTER COLUMN port TYPE VARCHAR USING port::VARCHAR;
ALTER TABLE user_mail_accounts ALTER COLUMN use_tls DROP DEFAULT;
ALTER TABLE user_mail_accounts ALTER COLUMN use_tls TYPE VARCHAR USING use_tls::VARCHAR;

-- Table: vehicle_location_history
ALTER TABLE vehicle_location_history ALTER COLUMN vehicle_id TYPE VARCHAR USING vehicle_id::VARCHAR;
ALTER TABLE vehicle_location_history ALTER COLUMN latitude TYPE VARCHAR USING latitude::VARCHAR;
ALTER TABLE vehicle_location_history ALTER COLUMN longitude TYPE VARCHAR USING longitude::VARCHAR;
ALTER TABLE vehicle_location_history ALTER COLUMN accuracy TYPE VARCHAR USING accuracy::VARCHAR;
ALTER TABLE vehicle_location_history ALTER COLUMN altitude TYPE VARCHAR USING altitude::VARCHAR;
ALTER TABLE vehicle_location_history ALTER COLUMN speed TYPE VARCHAR USING speed::VARCHAR;
ALTER TABLE vehicle_location_history ALTER COLUMN heading TYPE VARCHAR USING heading::VARCHAR;
ALTER TABLE vehicle_location_history ALTER COLUMN distance_from_prev TYPE VARCHAR USING distance_from_prev::VARCHAR;
ALTER TABLE vehicle_location_history ALTER COLUMN trip_distance TYPE VARCHAR USING trip_distance::VARCHAR;
ALTER TABLE vehicle_location_history ALTER COLUMN trip_time TYPE VARCHAR USING trip_time::VARCHAR;

-- Table: vehicle_locations
ALTER TABLE vehicle_locations ALTER COLUMN latitude TYPE VARCHAR USING latitude::VARCHAR;
ALTER TABLE vehicle_locations ALTER COLUMN longitude TYPE VARCHAR USING longitude::VARCHAR;
ALTER TABLE vehicle_locations ALTER COLUMN speed TYPE VARCHAR USING speed::VARCHAR;
ALTER TABLE vehicle_locations ALTER COLUMN vehicle_id TYPE VARCHAR USING vehicle_id::VARCHAR;

-- Table: vehicle_trip_summary
ALTER TABLE vehicle_trip_summary ALTER COLUMN vehicle_id TYPE VARCHAR USING vehicle_id::VARCHAR;
ALTER TABLE vehicle_trip_summary ALTER COLUMN total_distance DROP DEFAULT;
ALTER TABLE vehicle_trip_summary ALTER COLUMN total_distance TYPE VARCHAR USING total_distance::VARCHAR;
ALTER TABLE vehicle_trip_summary ALTER COLUMN duration_minutes TYPE VARCHAR USING duration_minutes::VARCHAR;
ALTER TABLE vehicle_trip_summary ALTER COLUMN location_count DROP DEFAULT;
ALTER TABLE vehicle_trip_summary ALTER COLUMN location_count TYPE VARCHAR USING location_count::VARCHAR;

-- Table: vehicles
ALTER TABLE vehicles ALTER COLUMN last_trip_distance TYPE VARCHAR USING last_trip_distance::VARCHAR;
ALTER TABLE vehicles ALTER COLUMN last_trip_time TYPE VARCHAR USING last_trip_time::VARCHAR;
ALTER TABLE vehicles ALTER COLUMN last_empty_distance TYPE VARCHAR USING last_empty_distance::VARCHAR;
ALTER TABLE vehicles ALTER COLUMN last_empty_time TYPE VARCHAR USING last_empty_time::VARCHAR;

-- Table: web_type_standards
ALTER TABLE web_type_standards ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE web_type_standards ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: wi_process_work_item
ALTER TABLE wi_process_work_item ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE wi_process_work_item ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;

-- Table: wi_process_work_item_detail
ALTER TABLE wi_process_work_item_detail ALTER COLUMN sort_order DROP DEFAULT;
ALTER TABLE wi_process_work_item_detail ALTER COLUMN sort_order TYPE VARCHAR USING sort_order::VARCHAR;
ALTER TABLE wi_process_work_item_detail ALTER COLUMN duration_minutes TYPE VARCHAR USING duration_minutes::VARCHAR;

-- Table: work_order_process_log

-- Table: yard_layout

-- Table: yard_material_placement
ALTER TABLE yard_material_placement ALTER COLUMN yard_layout_id TYPE VARCHAR USING yard_layout_id::VARCHAR;
ALTER TABLE yard_material_placement ALTER COLUMN quantity DROP DEFAULT;
ALTER TABLE yard_material_placement ALTER COLUMN quantity TYPE VARCHAR USING quantity::VARCHAR;
ALTER TABLE yard_material_placement ALTER COLUMN position_x DROP DEFAULT;
ALTER TABLE yard_material_placement ALTER COLUMN position_x TYPE VARCHAR USING position_x::VARCHAR;
ALTER TABLE yard_material_placement ALTER COLUMN position_y DROP DEFAULT;
ALTER TABLE yard_material_placement ALTER COLUMN position_y TYPE VARCHAR USING position_y::VARCHAR;
ALTER TABLE yard_material_placement ALTER COLUMN position_z DROP DEFAULT;
ALTER TABLE yard_material_placement ALTER COLUMN position_z TYPE VARCHAR USING position_z::VARCHAR;
ALTER TABLE yard_material_placement ALTER COLUMN size_x DROP DEFAULT;
ALTER TABLE yard_material_placement ALTER COLUMN size_x TYPE VARCHAR USING size_x::VARCHAR;
ALTER TABLE yard_material_placement ALTER COLUMN size_y DROP DEFAULT;
ALTER TABLE yard_material_placement ALTER COLUMN size_y TYPE VARCHAR USING size_y::VARCHAR;
ALTER TABLE yard_material_placement ALTER COLUMN size_z DROP DEFAULT;
ALTER TABLE yard_material_placement ALTER COLUMN size_z TYPE VARCHAR USING size_z::VARCHAR;

-- =====================================================
-- STEP 3: FK 제약 조건 재생성 — 생략 (MES/공장 운영 시 FK 제약이 걸리므로 안 거는 것이 원칙)
-- =====================================================
