Add SQL query for migrating branch data from prm_cabang table

- Created a new SQL file `query_mig_branches.sql` to select and format branch data.
- The query retrieves various fields including branch code, name, status, and contact information.
- Data is trimmed to remove any leading or trailing whitespace.
- Results are ordered by branch code for consistency.
This commit is contained in:
Daeng Deni Mardaeni
2025-04-16 21:54:10 +07:00
parent 2e52155eda
commit ce62493344
6 changed files with 1013 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
SELECT 1 AS `is_mig`
, TRIM(branches.KD_CABANG) AS `code`
, TRIM(branches.`NAMA_CABANG`) AS `name`
, TRIM(branches.`FLAG_DATA`) AS `status`
, TRIM(branches.`TGL_UPDATE`) AS `updated_at`
, TRIM(branches.`ALAMAT`) AS `mig_alamat`
, TRIM(branches.`FAX`) AS `mig_fax`
, TRIM(branches.`FLAG_DATA`) AS `mig_flag_data`
, TRIM(branches.`FLAG_OTO`) AS `mig_flag_oto`
, TRIM(branches.`KODE_LEVEL`) AS `mig_kode_level`
, TRIM(branches.`KODE_STATUS`) AS `mig_kode_status`
, TRIM(branches.`KODEPOS`) AS `mig_kodepos`
, TRIM(branches.`KOTA`) AS `mig_kota`
, TRIM(branches.`TELEPON`) AS `mig_telepon`
, TRIM(branches.`TGL_OTO`) AS `mig_tgl_oto`
, TRIM(branches.`TGL_UPDATE`) AS `mig_tgl_update`
, TRIM(branches.`USER_OTO`) AS `mig_user_oto`
, TRIM(branches.`USER_UPDATE`) AS `mig_user_update`
FROM `prm_cabang` branches
ORDER BY branches.KD_CABANG