f80005f545cb4d3d42d3ea25309cdcd004870def
3 # This script is used to export the MySQL structure of the plat/al MySQL
7 # Developers: list 'public' tables here.
8 SHARED_TABLES
="account_types
10 geoloc_administrativeareas
13 geoloc_subadministrativeareas
18 profile_corps_rank_enum
19 profile_education_degree_enum
20 profile_education_enum
21 profile_education_field_enum
22 profile_job_entreprise_term
25 profile_job_term_relation
26 profile_langskill_enum
28 profile_medal_grade_enum
30 profile_networking_enum
41 Will dump the necessary data from MySQL.
42 Note that all options should have sane defaults if you have correctly configured
47 -H HOST MySQL host to connect to (default: none)
48 -P PORT MySQL port to connect to (default: none)
49 -u USER User for MySQL (default: none)
50 -p PASS MySQL password to use (default: none)
51 -d SQL_DB Database to read from (default: x5dat)
52 -n Dry run, don't actually write anything
53 -o FILE Write to file instead of stdout (- for stdout as well)
66 while getopts "hns:u:p:o:" OPTION
102 DUMPER
="mysqldump --add-drop-table --default-character-set=utf8 --force"
104 if [ -n
"$USER" ]; then
105 DUMPER
="$DUMPER --user=$USER"
108 if [ -n
"$PASS" ]; then
109 DUMPER
="$DUMPER --password=$PASS"
112 if [ -n
"$HOST" ]; then
113 DUMPER
="$DUMPER --host=$HOST"
116 if [ -n
"$PORT" ]; then
117 DUMPER
="$DUMPER --port=$PORT"
120 if [ "$FILE" == "-" ]; then
123 if [ $DRY_RUN -ne
1 ]; then
132 if [ $DRY_RUN -eq
1 ]; then
133 if [ -n
"$FILE" ]; then
134 echo "$command >> $FILE"
139 if [ -n
"$FILE" ]; then
148 STRUCT_DUMPER
="$DUMPER --no-data $SQL_DB"
149 dump
"$STRUCT_DUMPER"
151 SHARED_DUMPER
="$DUMPER $SQL_DB $SHARED_TABLES"
152 dump
"$SHARED_DUMPER"