export DB_OPERATOR_PASSWORD=QzfXQhd3bQ

alias db-operator='docker run --rm -it \
  --network host \
  --user $(id -u):$(id -g) \
  -v $(pwd):/data \
  -e DB_OPERATOR_PASSWORD \
  harbor.wdd.io:8033/rmdc/db-operator:v1.4.0'

## MySQL数据库导入
# mysql -uk8s_admin -p'fP#UaH6qQ3)8' -h127.0.0.1 -P3306 <
db-operator import-structure \
  -H 127.0.0.1 -P 33306 -u root \
  --input ./2.3.0-all.sql

## DORIS数据库导入
# doris初始化
# kubectl exec -i helm-mysql-0 -c mysql -n cq-uas-260427 mysql -uroot -hdoris-cluster-fe-internal -P9030 < 1node_table_init.sql
# kubectl exec -it helm-mysql-0 -n cq-uas-260427  --
db-operator import-structure \
  -H 192.168.3.31 -P 31622  -u root \
  --input ./1node_table_init_v2.3.sql


kubectl exec -i helm-mysql-0 -n bj-sh-uas-260511 -c mysql -- \
mysql -uk8s_admin -p'fP#UaH6qQ3)8' -h192.168.3.31 -P33306 \
< 2.3.4-b-upgrade.sql

kubectl exec -i helm-mysql-0 -n bj-sh-uas-260511 -c mysql -- \
mysql -uroot -hdoris-cluster-fe-internal -P9030 \
< 1node_table_init_v2.3.sql

db-operator export-structure \
  -H 144.7.97.167 -P 31622  -u root  \
  --databases cmii_sky_converge,cmii_fly_center,cmii_sky_integration \
  --output-dir ./xa/


db-operator reset-database \
  -H 192.168.40.93 -P 38136 -u root -d cmii_sky_converge \
  --baseline ./xa/001_cmii_sky_converge_structure_20260417_112901.sql --yes


db-operator export-structure \
  -H 36.133.232.218 -P 33306  -u root  \
  --databases cmii_sky_converge,cmii_fly_center \
  --output-dir ./shanxi_erji_test/

db-operator import-structure \
  -H 192.168.40.93 -P 37136 -u root \
  --input ./shanxi_erji/


db-operator run-upgrade \
  -H 36.133.232.218 -P 33306 -u root -d cmii_sky_converge \
  --migration-file ./shanxi_erji_test/001_cmii-sky-converge_20260422_094554_rmdc-baseline-structure.sql

db-operator export-data \
  -H 36.133.232.218 -P 33306 -u root \
  --databases cmii_sky_converge,cmii_fly_center \
  --output-dir ./shanxi_erji_test/


docker image save harbor.wdd.io:8033/rmdc/db-operator:v1.4.0 | gzip > /root/rmdc-db-operator-v1.4.0.tar.gz