X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Fexport_sql.bash;h=51417c845168ef9a0986643ad797a8ed916a5482;hb=07e02fe3af9db38b14225e5bf0ed937147acb37d;hp=ceefc73fa7a60b2be00d3adcf3b5821a92d9b2b7;hpb=12ddbc2037b16496dfb9d91c4f7091850146fcde;p=platal.git diff --git a/bin/export_sql.bash b/bin/export_sql.bash index ceefc73..51417c8 100755 --- a/bin/export_sql.bash +++ b/bin/export_sql.bash @@ -5,37 +5,31 @@ # Developers: list 'public' tables here. -SHARED_TABLES="account_types -forums -geoloc_administrative_areas -geoloc_countries -geoloc_localities -geoloc_subadministrativeareas -log_actions -newsletter_cat -profile_binet_enum -profile_corps_enum -profile_corps_rank_enum -profile_education_degree_enum -profile_education_enum -profile_education_field_enum -profile_job_alternate -profile_job_entreprise_term -profile_job_enum -profile_job_sector_enum -profile_job_subsector_enum -profile_job_subsubsector_enum -profile_job_term_enum -profile_job_term_relation -profile_langskills_enum -profile_medal_enum -profile_medal_grade_enum -profile_name_enum -profile_networking_enum -profile_section_enum -profile_skill_enum -reminder_type -skin" +SHARED_TABLES="account_types \ +forums \ +geoloc_countries \ +geoloc_languages \ +log_actions \ +newsletter_cat \ +profile_binet_enum \ +profile_corps_enum \ +profile_corps_rank_enum \ +profile_education_degree \ +profile_education_degree_enum \ +profile_education_enum \ +profile_education_field_enum \ +profile_job_entreprise_term \ +profile_job_enum \ +profile_job_term_enum \ +profile_job_term_relation \ +profile_langskill_enum \ +profile_medal_enum \ +profile_medal_grade_enum \ +profile_networking_enum \ +profile_section_enum \ +profile_skill_enum \ +reminder_type \ +skins" usage() { @@ -102,7 +96,7 @@ do esac done - +FILTER="sed -r s/AUTO_INCREMENT=[1-9]+/AUTO_INCREMENT=1/" DUMPER="mysqldump --add-drop-table --default-character-set=utf8 --force" if [ -n "$USER" ]; then @@ -135,15 +129,15 @@ dump () { if [ $DRY_RUN -eq 1 ]; then if [ -n "$FILE" ]; then - echo "$command >> $FILE" + echo "$command | $FILTER >> $FILE" else - echo $command + echo "$command | $FILTER" fi else if [ -n "$FILE" ]; then - $command >> $FILE + $command | $FILTER >> $FILE else - $command + $command | $FILTER fi fi }