ALTER TABLE `dbr_user_menu` CHANGE `menu_lang_0` `menu_lang0` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL;
ALTER TABLE `dbr_user_menu` CHANGE `menu_lang_1` `menu_lang1` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL;
ALTER TABLE `dbr_user_menu` CHANGE `menu_lang_2` `menu_lang2` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL;
ALTER TABLE `dbr_user_menu` CHANGE `menu_lang_3` `menu_lang3` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL;

ALTER TABLE `pro_member_menu` CHANGE `menu_lang_0` `menu_lang0` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL;
ALTER TABLE `pro_member_menu` CHANGE `menu_lang_1` `menu_lang1` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL;
ALTER TABLE `pro_member_menu` CHANGE `menu_lang_2` `menu_lang2` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL;
ALTER TABLE `pro_member_menu` CHANGE `menu_lang_3` `menu_lang3` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL;


select
	bal.id as id,
	dbr_company.id as code_id,
	company_name as name,
	ifnull(bal_amt,0) as balance2
from
	dbr_company
	left outer join
	( 
	select
		id, buyer_id, bal_amt
	from dbr_bal_buyer
	where yyyy_mm = '202201' and branch_id = 1
	) 
as bal
	ON dbr_company.id = bal.buyer_id

where company_class = '' or company_class = 'AB'
order by company_name asc

UPDATE `pro_member` SET reset_code= 'Ef63EYPjqzOIWl3G'


DROP TABLE zzz_dbr_statis;
ALTER TABLE zzz_log RENAME TO zsp_test_log;


ALTER TABLE `dbt_list_type1` ADD `c21` VARCHAR(64) NULL DEFAULT NULL AFTER `c20`;
ALTER TABLE `dbt_list_type1` ADD `c22` VARCHAR(64) NULL DEFAULT NULL AFTER `c21`;
ALTER TABLE `dbt_list_type1` ADD `c23` VARCHAR(64) NULL DEFAULT NULL AFTER `c22`;
ALTER TABLE `dbt_list_type1` ADD `c24` VARCHAR(64) NULL DEFAULT NULL AFTER `c23`;
ALTER TABLE `dbt_list_type1` ADD `c25` VARCHAR(64) NULL DEFAULT NULL AFTER `c24`;
ALTER TABLE `dbt_list_type1` ADD `c26` VARCHAR(64) NULL DEFAULT NULL AFTER `c25`;
ALTER TABLE `dbt_list_type1` ADD `c27` VARCHAR(64) NULL DEFAULT NULL AFTER `c26`;
ALTER TABLE `dbt_list_type1` ADD `c28` VARCHAR(64) NULL DEFAULT NULL AFTER `c27`;
ALTER TABLE `dbt_list_type1` ADD `c29` VARCHAR(64) NULL DEFAULT NULL AFTER `c28`;
ALTER TABLE `dbt_list_type1` ADD `c20` VARCHAR(64) NULL DEFAULT NULL AFTER `c29`;

ALTER TABLE `bcm_contract` CHANGE `token_name` `token_name` VARCHAR(128) COMMENT 'token name';

ALTER TABLE `dbr_company` CHANGE `company_name` `company_name` VARCHAR(64)  COMMENT '고객명: POS의 경우 고객코드로 사용';
ALTER TABLE `dbr_company` CHANGE `main_contact` `main_contact` VARCHAR(21)  COMMENT '주담당자: POS의 경우 고객이름(동명이인 사용가능)으로 사용';

UPDATE `dbr_setup` SET component = 'popup-setup.form-a.passwd-policy-form' where setup_code = 'user-dabory';
UPDATE `dbr_setup` SET setup_code = 'sso-client',   brand_code = 'user-dabory' where setup_code = 'user-dabory';

UPDATE `dbr_setup` SET is_on_use = '0' where setup_code = 'sso-client';

UPDATE `dbr_setup` SET setup_name = 'SSO 관리자 로그인', brand_code = 'user-dabory' where setup_code = 'sso-client' and brand_code = 'user-dabory';

UPDATE `dbr_setup` SET brand_code = 'user-dabory' where setup_code = 'sso-client' and brand_code = 'user-dabory';

UPDATE `dbr_setup` SET brand_code = 'member-dabory' where setup_code = 'sso-client' and brand_code = 'dabory';
UPDATE `dbr_setup` SET brand_code = 'member-google' where setup_code = 'sso-client' and brand_code = 'google';
UPDATE `dbr_setup` SET brand_code = 'member-kakao' where setup_code = 'sso-client' and brand_code = 'kakao';
UPDATE `dbr_setup` SET brand_code = 'member-facebook' where setup_code = 'sso-client' and brand_code = 'facebook';
UPDATE `dbr_setup` SET brand_code = 'member-naver' where setup_code = 'sso-client' and brand_code = 'naver';

delete from dbr_setup where setup_code = 'member-policy';


INSERT INTO dbr_setup (branch_id, setup_code, brand_code, setup_name, component, parameter, is_on_use, is_brand_select, setup_json )
VALUES (0, 'cdn-aws-s3', '', 'Media-AWS-S3 설정', 'popup-setup.form-a.cdn.aws-s3-form', 'popup-setup/form-a/cdn/aws-s3', '1', '0', '{\"AccessKeyId\":\"AKIA2DK3AOJ3HTHQRO3N\",\"SecretAccessKey\":\"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\",\"DefaultRegion\":\"ap-northeast-2\",\"Bucket\":\"dbr02-s3\"}');

delete from dbr_setup where setup_code = 'login-info';
INSERT INTO dbr_setup (branch_id, setup_code, brand_code, setup_name, component, parameter, is_on_use, is_brand_select, setup_json )
VALUES (0, 'login-info', '', '로그인 정보', 'popup-setup.form-a.login-info-form', '/popup-setup/form-a/login-info', '1', '0', '{\"IsMemberSsoOnly\":true,\"MemberEmail\":\"kimhi65@naver.com\",\"MemberPasswd\":\"China13579\",\"IsUserSsoOnly\":false,\"UserEmail\":\"kimhi65@naver.com\",\"UserPasswd\":\"China13579\"}');

UPDATE `dbr_etc` SET select_name = 'pay_terms' where etc_type = 'domestic' and select_name = 'pay_terms';
UPDATE `dbr_etc` SET select_name = 'pay_period' where etc_type = 'domestic' and select_name = 'pay_period';
UPDATE `dbr_etc` SET select_name = 'destination' where etc_type = 'domestic' and select_name = 'destination';
UPDATE `dbr_etc` SET select_name = 'delivery' where etc_type = 'domestic' and select_name = 'destination';
UPDATE `dbr_etc` SET select_name = 'column1' where etc_type = 'domestic' and select_name = 'column1';
UPDATE `dbr_etc` SET select_name = 'column2' where etc_type = 'domestic' and select_name = 'column2';

UPDATE `dbr_etc` SET select_name = 'our_contact' where etc_type = 'domestic' and select_name = '담당자';
