Replace copy_tables.php by a shell script (database alteration require admin privileges)
[platal.git] / upgrade / account / copy_tables.sh
CommitLineData
aa1f260a
FB
1#!/usr/bin/env bash
2
3copyTable() {
4 echo "CREATE TABLE $2 LIKE $1;"
5 if [ -z "$3" ] ; then
6 echo "ALTER TABLE $2 ENGINE = InnoDB;"
7 fi
8 echo "INSERT INTO $2 SELECT * FROM $1;"
9}
10
11
12copyTable '#forums#.list' 'forums'
13copyTable '#forums#.abos' 'forum_subs'
14copyTable '#forums#.innd' 'forum_innd'
15copyTable '#forums#.profils' 'forum_profiles'
16
17copyTable '#logger#.actions' 'log_actions'
18copyTable '#logger#.events' 'log_events'
19copyTable '#logger#.last_sessions' 'log_last_sessions'
20copyTable '#logger#.sessions' 'log_sessions'
21
22copyTable '#paiement#.paiements' 'payments'
23copyTable '#paiement#.codeC' 'payment_codeC'
24copyTable '#paiement#.codeRCB' 'payment_codeRCB'
25copyTable '#paiement#.methodes' 'payment_methods'
26copyTable '#paiement#.transactions' 'payment_transactions'
27
28copyTable '#groupex#.announces' 'group_announces'
29copyTable '#groupex#.announces_photo' 'group_announces_photo'
30copyTable '#groupex#.announces_read' 'group_announces_read'
31copyTable '#groupex#.asso' 'groups'
32copyTable '#groupex#.dom' 'group_dom'
33copyTable '#groupex#.evenements' 'group_events'
34copyTable '#groupex#.evenements_items' 'group_event_items'
35copyTable '#groupex#.evenements_participants' 'group_event_participants'
36copyTable '#groupex#.membres' 'group_members'
37copyTable '#groupex#.membres_sub_requests' 'group_member_sub_requests'
38copyTable '#x4dat#.groupesx_auth' 'group_auth'
39
40copyTable '#x4dat#.axletter' 'axletter'
41copyTable '#x4dat#.axletter_ins' 'axletter_ins'
42copyTable '#x4dat#.axletter_rights' 'axletter_rights'
43
44copyTable '#x4dat#.newsletter' 'newsletter'
45copyTable '#x4dat#.newsletter_art' 'newsletter_art'
46copyTable '#x4dat#.newsletter_cat' 'newsletter_cat'
47copyTable '#x4dat#.newsletter_ins' 'newsletter_ins'
48
49copyTable '#x4dat#.evenements' 'announces'
50copyTable '#x4dat#.evenements_photo' 'announce_photos'
51copyTable '#x4dat#.evenements_vus' 'announce_read'
52
53copyTable '#x4dat#.gapps_accounts' 'gapps_accounts' 'false'
54copyTable '#x4dat#.gapps_nicknames' 'gapps_nicknames' 'false'
55copyTable '#x4dat#.gapps_queue' 'gapps_queue'
56copyTable '#x4dat#.gapps_reporting' 'gapps_reporting'
57
58copyTable '#x4dat#.contacts' 'contacts'
59copyTable '#x4dat#.coupures' 'downtimes'
60copyTable '#x4dat#.emails_watch' 'email_watch'
61copyTable '#x4dat#.emails_send_save' 'email_send_save'
62copyTable '#x4dat#.homonymes' 'homonyms'
63copyTable '#x4dat#.ip_watch' 'ip_watch'
64copyTable '#x4dat#.mx_watch' 'mx_watch'
65copyTable '#x4dat#.ml_moderate' 'email_list_moderate'
66
67copyTable '#x4dat#.postfix_blacklist' 'postfix_blacklist'
68copyTable '#x4dat#.postfix_mailseen' 'postfix_mailseen'
69copyTable '#x4dat#.postfix_whitelist' 'postfix_whitelist'
70
71copyTable '#x4dat#.photo' 'profile_photos'
72copyTable '#x4dat#.binets_def' 'profile_binet_enum'
73copyTable '#x4dat#.binets_ins' 'profile_binets'
74copyTable '#x4dat#.sections' 'profile_section_enum'
75copyTable '#x4dat#.profile_medals' 'profile_medal_enum'
76copyTable '#x4dat#.profile_medals_sub' 'profile_medals'
77copyTable '#x4dat#.competences_def' 'profile_skill_enum'
78copyTable '#x4dat#.competences_ins' 'profile_skills'
79copyTable '#x4dat#.langues_def' 'profile_langskill_enum'
80copyTable '#x4dat#.langues_ins' 'profile_langskills'
81
82copyTable '#x4dat#.register_marketing' 'register_marketing'
83copyTable '#x4dat#.register_pending' 'register_pending'
84copyTable '#x4dat#.register_subs' 'register_subs'
85copyTable '#x4dat#.register_mstats' 'register_mstats'
86
87copyTable '#x4dat#.reminder' 'reminder'
88copyTable '#x4dat#.reminder_type' 'reminder_type'
89
90copyTable '#x4dat#.requests' 'requests'
91copyTable '#x4dat#.requests_answers' 'requests_answers'
92copyTable '#x4dat#.requests_hidden' 'requests_hidden'
93
94copyTable '#x4dat#.search_autocomplete' 'search_autocomplete'
95copyTable '#x4dat#.search_name' 'search_name'
96
97copyTable '#x4dat#.skins' 'skins'
98copyTable '#x4dat#.tips' 'tips'
99
100copyTable '#x4dat#.survey_surveys' 'surveys'
101copyTable '#x4dat#.survey_answers' 'survey_answers'
102copyTable '#x4dat#.survey_votes' 'survey_votes'
103
104copyTable '#x4dat#.watch_profile' 'watch_profile'
105copyTable '#x4dat#.perte_pass' 'account_lost_passwords'
106
107copyTable '#x4dat#.emails' 'emails'
108copyTable '#x4dat#.aliases' 'aliases'
109copyTable '#x4dat#.virtual' 'virtual'
110copyTable '#x4dat#.virtual_domains' 'virtual_domains'
111copyTable '#x4dat#.virtual_redirect' 'virtual_redirect'
112
113copyTable '#x4dat#.watch_nonins' 'watch_nonins'
114copyTable '#x4dat#.watch_promo' 'watch_promo'
115
116copyTable '#x4dat#.openid_trusted' 'account_auth_openid' 'false'