Copy missing tables: all the tables needed by profile/edit are present.
[platal.git] / upgrade / account / copy_tables.php
CommitLineData
100e66fc
FB
1#!/usr/bin/php5 -q
2<?php
3/***************************************************************************
4 * Copyright (C) 2003-2010 Polytechnique.org *
5 * http://opensource.polytechnique.org/ *
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the Free Software *
19 * Foundation, Inc., *
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
21 ***************************************************************************/
22
23require('./connect.db.inc.php');
24
161daeb9
FB
25$globals->dbuser = 'admin';
26$globals->dbpwd = 'lknjiuhb';
27$globals->debug = 1;
28
d0293d9b 29function copyTable($source, $target, $convertToInnoDB = true)
100e66fc
FB
30{
31 XDB::execute('CREATE TABLE ' . $target . '
d0293d9b
FB
32 LIKE ' . $source);
33 if ($convertToInnoDB) {
34 XDB::execute('ALTER TABLE ' . $target . '
35 ENGINE = InnoDB');
36 }
100e66fc
FB
37 XDB::execute('INSERT INTO ' . $target . '
38 SELECT *
39 FROM ' . $source);
40}
41
42copyTable('#forums#.list', 'forums');
43copyTable('#forums#.abos', 'forum_subs');
44copyTable('#forums#.innd', 'forum_innd');
45copyTable('#forums#.profils', 'forum_profiles');
46
47copyTable('#logger#.actions', 'log_actions');
48copyTable('#logger#.events', 'log_events');
49copyTable('#logger#.last_sessions', 'log_last_sessions');
50copyTable('#logger#.sessions', 'log_sessions');
51
52copyTable('#paiement#.paiements', 'payments');
53copyTable('#paiement#.codeC', 'payment_codeC');
54copyTable('#paiement#.codeRCB', 'payment_codeRCB');
55copyTable('#paiement#.methodes', 'payment_methods');
56copyTable('#paiement#.transactions', 'payment_transactions');
57
58copyTable('#groupex#.announces', 'group_announces');
59copyTable('#groupex#.announces_photo', 'group_announces_photo');
60copyTable('#groupex#.announces_read', 'group_announces_read');
61copyTable('#groupex#.asso', 'groups');
62copyTable('#groupex#.dom', 'group_dom');
63copyTable('#groupex#.evenements', 'group_events');
64copyTable('#groupex#.evenements_items', 'group_event_items');
65copyTable('#groupex#.evenements_participants', 'group_event_participants');
66copyTable('#groupex#.membres', 'group_members');
67copyTable('#groupex#.membres_sub_requests', 'group_member_sub_requests');
9d5e1087 68copyTable('#x4dat#.groupesx_auth', 'group_auth');
100e66fc 69
06f4daf9
FB
70copyTable('#x4dat#.axletter', 'axletter');
71copyTable('#x4dat#.axletter_ins', 'axletter_ins');
72copyTable('#x4dat#.axletter_rights', 'axletter_rights');
73
74copyTable('#x4dat#.newsletter', 'newsletter');
75copyTable('#x4dat#.newsletter_art', 'newsletter_art');
76copyTable('#x4dat#.newsletter_cat', 'newsletter_cat');
77copyTable('#x4dat#.newsletter_ins', 'newsletter_ins');
78
06f4daf9
FB
79
80copyTable('#x4dat#.evenements', 'announces');
81copyTable('#x4dat#.evenements_photo', 'announce_photos');
82copyTable('#x4dat#.evenements_vus', 'announce_read');
83
d0293d9b
FB
84copyTable('#x4dat#.gapps_accounts', 'gapps_accounts', false);
85copyTable('#x4dat#.gapps_nicknames', 'gapps_nicknames', false);
06f4daf9
FB
86copyTable('#x4dat#.gapps_queue', 'gapps_queue');
87copyTable('#x4dat#.gapps_reporting', 'gapps_reporting');
88
89copyTable('#x4dat#.contacts', 'contacts');
90copyTable('#x4dat#.coupures', 'downtimes');
91copyTable('#x4dat#.emails_watch', 'email_watch');
92copyTable('#x4dat#.homonymes', 'homonyms');
93copyTable('#x4dat#.ip_watch', 'ip_watch');
94copyTable('#x4dat#.mx_watch', 'mx_watch');
95copyTable('#x4dat#.ml_moderate', 'ml_moderate');
96
97copyTable('#x4dat#.postfix_blacklist', 'postfix_blacklist');
98copyTable('#x4dat#.postfix_mailseen', 'postfix_mailseen');
99copyTable('#x4dat#.postfix_whitelist', 'postfix_whitelist');
100
100e66fc 101copyTable('#x4dat#.photo', 'profile_photos');
5c8a71f2
FB
102copyTable('#x4dat#.binets_def', 'profile_binet_enum');
103copyTable('#x4dat#.binets_ins', 'profile_binets');
104copyTable('#x4dat#.sections', 'profile_section_enum');
105copyTable('#x4dat#.profile_medals', 'profile_medal_enum');
106copyTable('#x4dat#.profile_medals_sub', 'profile_medals');
107copyTable('#x4dat#.competences_def', 'profile_skill_enum');
108copyTable('#x4dat#.competences_ins', 'profile_skills');
109copyTable('#x4dat#.langues_def', 'profile_langskill_enum');
110copyTable('#x4dat#.langues_ins', 'profile_langskills');
100e66fc 111
100e66fc 112copyTable('#x4dat#.register_marketing', 'register_marketing');
06f4daf9
FB
113copyTable('#x4dat#.register_pending', 'register_pending');
114copyTable('#x4dat#.register_subs', 'register_subs');
115copyTable('#x4dat#.register_mstats', 'register_mstats');
116
117copyTable('#x4dat#.reminder', 'reminder');
118copyTable('#x4dat#.reminder_type', 'reminder_type');
119
120copyTable('#x4dat#.requests', 'requests');
121copyTable('#x4dat#.requests_answers', 'requests_answers');
122copyTable('#x4dat#.requests_hidden', 'requests_hidden');
123
124copyTable('#x4dat#.search_autocomplete', 'search_autocomplete');
125copyTable('#x4dat#.search_name', 'search_name');
126
127copyTable('#x4dat#.skins', 'skins');
128copyTable('#x4dat#.tips', 'tips');
129
130copyTable('#x4dat#.survey_surveys', 'surveys');
d0293d9b 131copyTable('#x4dat#.survey_answers', 'survey_answers');
06f4daf9
FB
132copyTable('#x4dat#.survey_votes', 'survey_votes');
133
100e66fc 134copyTable('#x4dat#.watch_profile', 'watch_profile');
06f4daf9 135copyTable('#x4dat#.perte_pass', 'account_lost_passwords');
100e66fc 136
100e66fc
FB
137copyTable('#x4dat#.geoloc_pays', 'geoloc_pays');
138
d0293d9b 139copyTable('#x4dat#.emails', 'emails');
06f4daf9
FB
140copyTable('#x4dat#.aliases', 'aliases');
141copyTable('#x4dat#.virtual', 'virtual');
142copyTable('#x4dat#.virtual_domains', 'virtual_domains');
143copyTable('#x4dat#.virtual_redirect', 'virtual_redirect');
144
145copyTable('#x4dat#.watch_nonins', 'watch_nonins');
146copyTable('#x4dat#.watch_promo', 'watch_promo');
d0293d9b
FB
147
148copyTable('#x4dat#.openid_trusted', 'openid_trusted', false);
06f4daf9 149
100e66fc
FB
150// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
151?>