sqlmig: corriger la lecture des paramètres
This commit is contained in:
parent
d197fc0420
commit
0891e89278
91
sqlmig
91
sqlmig
|
@ -1191,10 +1191,7 @@ grant all privileges on $dbname.* to '$dbname';"
|
|||
default-character-set=utf8
|
||||
|
||||
[sqlmig]
|
||||
#suffix=
|
||||
#csv2sql=0
|
||||
csv_null=
|
||||
#load-data=default"
|
||||
#suffix="
|
||||
fi
|
||||
|
||||
if [ ! -f "$dbdir/my-${dbname}.cnf" ]; then
|
||||
|
@ -1203,7 +1200,12 @@ csv_null=
|
|||
# Paramètres de connexion pour $dbname
|
||||
[client]
|
||||
#user=
|
||||
#password="
|
||||
#password=
|
||||
|
||||
[sqlmig]
|
||||
#csv2sql=0
|
||||
csv_null=
|
||||
#load-data=default"
|
||||
fi
|
||||
|
||||
elif [ "$type" == oracle ]; then
|
||||
|
@ -1482,13 +1484,12 @@ for dbdir in "${dbdirs[@]}"; do
|
|||
ensure_dbtype "$dbdir" "$type"
|
||||
ensure_dbmode "$dbtype" "$mode"
|
||||
|
||||
############################################################################
|
||||
if [ "$dbtype" == mysql ]; then
|
||||
setx defaults=mysql_get_defaults "$dbdir"
|
||||
set_csv2sql=1
|
||||
set_csv_null=1
|
||||
mysql__mconf_get "$defaults"
|
||||
fix_csv2sql
|
||||
fix_csv_null
|
||||
# construire les paramètres pour mysql
|
||||
mysql_set_adminargs "$dbdir"
|
||||
mysql_set_userargs "$dbdir" "$dbname"
|
||||
mysql_set_mysqlargs
|
||||
|
||||
if is_yes "$csv2sql" && [ -n "$data_csv" ]; then
|
||||
# Conversion csv --> sql
|
||||
|
@ -1514,36 +1515,28 @@ for dbdir in "${dbdirs[@]}"; do
|
|||
done
|
||||
eend; eclearp
|
||||
fi
|
||||
fi
|
||||
|
||||
# lister les mises à jour disponibles
|
||||
drops=()
|
||||
creates=()
|
||||
updates=()
|
||||
have_csv=
|
||||
array_lsfiles files "$dbdir" "*.sql" "*.csv"
|
||||
for file in "${files[@]}"; do
|
||||
if [[ "$file" == *.sql ]]; then
|
||||
if have_tag drop "$file"; then
|
||||
array_add drops "$file"
|
||||
elif have_tag create "$file"; then
|
||||
array_add creates "$file"
|
||||
else
|
||||
# lister les mises à jour disponibles
|
||||
drops=()
|
||||
creates=()
|
||||
updates=()
|
||||
have_csv=
|
||||
array_lsfiles files "$dbdir" "*.sql" "*.csv"
|
||||
for file in "${files[@]}"; do
|
||||
if [[ "$file" == *.sql ]]; then
|
||||
if have_tag drop "$file"; then
|
||||
array_add drops "$file"
|
||||
elif have_tag create "$file"; then
|
||||
array_add creates "$file"
|
||||
else
|
||||
array_add updates "$file"
|
||||
fi
|
||||
elif [ ! -f "${file%.csv}.sql" ]; then
|
||||
# n'ajouter le CSV que si le fichier SQL correspondant n'existe pas
|
||||
array_add updates "$file"
|
||||
have_csv=1
|
||||
fi
|
||||
elif [ ! -f "${file%.csv}.sql" ]; then
|
||||
# n'ajouter le CSV que si le fichier SQL correspondant n'existe pas
|
||||
array_add updates "$file"
|
||||
have_csv=1
|
||||
fi
|
||||
done
|
||||
|
||||
############################################################################
|
||||
if [ "$dbtype" == mysql ]; then
|
||||
# construire les paramètres pour mysql
|
||||
mysql_set_adminargs "$dbdir"
|
||||
mysql_set_userargs "$dbdir" "$dbname"
|
||||
mysql_set_mysqlargs
|
||||
done
|
||||
|
||||
if [ -n "$suffix" ]; then
|
||||
estepi "Suffixe: $dbname --> $dbname$suffix"
|
||||
|
@ -1616,6 +1609,28 @@ for dbdir in "${dbdirs[@]}"; do
|
|||
oracle_source_userconf "$dbdir" "$dbname"
|
||||
oracle_ensure_opdir
|
||||
|
||||
# lister les mises à jour disponibles
|
||||
drops=()
|
||||
creates=()
|
||||
updates=()
|
||||
have_csv=
|
||||
array_lsfiles files "$dbdir" "*.sql" "*.csv"
|
||||
for file in "${files[@]}"; do
|
||||
if [[ "$file" == *.sql ]]; then
|
||||
if have_tag drop "$file"; then
|
||||
array_add drops "$file"
|
||||
elif have_tag create "$file"; then
|
||||
array_add creates "$file"
|
||||
else
|
||||
array_add updates "$file"
|
||||
fi
|
||||
elif [ ! -f "${file%.csv}.sql" ]; then
|
||||
# n'ajouter le CSV que si le fichier SQL correspondant n'existe pas
|
||||
array_add updates "$file"
|
||||
have_csv=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$suffix" ]; then
|
||||
estepi "Suffixe: $dbname --> $dbname$suffix"
|
||||
dbname="$dbname$suffix"
|
||||
|
|
Loading…
Reference in New Issue