Update update.sh
[platal.git] / upgrade / account / copy_tables.php
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
23 require('./connect.db.inc.php');
24
25 function copyTable($source, $target)
26 {
27 XDB::execute('CREATE TABLE ' . $target . '
28 LIKE ' . $source);
29 XDB::execute('INSERT INTO ' . $target . '
30 SELECT *
31 FROM ' . $source);
32 }
33
34 copyTable('#forums#.list', 'forums');
35 copyTable('#forums#.abos', 'forum_subs');
36 copyTable('#forums#.innd', 'forum_innd');
37 copyTable('#forums#.profils', 'forum_profiles');
38
39 copyTable('#logger#.actions', 'log_actions');
40 copyTable('#logger#.events', 'log_events');
41 copyTable('#logger#.last_sessions', 'log_last_sessions');
42 copyTable('#logger#.sessions', 'log_sessions');
43
44 copyTable('#paiement#.paiements', 'payments');
45 copyTable('#paiement#.codeC', 'payment_codeC');
46 copyTable('#paiement#.codeRCB', 'payment_codeRCB');
47 copyTable('#paiement#.methodes', 'payment_methods');
48 copyTable('#paiement#.transactions', 'payment_transactions');
49
50 copyTable('#groupex#.announces', 'group_announces');
51 copyTable('#groupex#.announces_photo', 'group_announces_photo');
52 copyTable('#groupex#.announces_read', 'group_announces_read');
53 copyTable('#groupex#.asso', 'groups');
54 copyTable('#groupex#.dom', 'group_dom');
55 copyTable('#groupex#.evenements', 'group_events');
56 copyTable('#groupex#.evenements_items', 'group_event_items');
57 copyTable('#groupex#.evenements_participants', 'group_event_participants');
58 copyTable('#groupex#.membres', 'group_members');
59 copyTable('#groupex#.membres_sub_requests', 'group_member_sub_requests');
60 copyTable('#x4dat#.groupesx_auth', 'group_auth');
61
62 copyTable('#x4dat#.axletter', 'axletter');
63 copyTable('#x4dat#.axletter_ins', 'axletter_ins');
64 copyTable('#x4dat#.axletter_rights', 'axletter_rights');
65
66 copyTable('#x4dat#.newsletter', 'newsletter');
67 copyTable('#x4dat#.newsletter_art', 'newsletter_art');
68 copyTable('#x4dat#.newsletter_cat', 'newsletter_cat');
69 copyTable('#x4dat#.newsletter_ins', 'newsletter_ins');
70
71 copyTable('#x4dat#.openid_trusted', 'openid_trusted');
72
73 copyTable('#x4dat#.evenements', 'announces');
74 copyTable('#x4dat#.evenements_photo', 'announce_photos');
75 copyTable('#x4dat#.evenements_vus', 'announce_read');
76
77 copyTable('#x4dat#.gapps_accounts', 'gapps_accounts');
78 copyTable('#x4dat#.gapps_nicknames', 'gapps_nicknames');
79 copyTable('#x4dat#.gapps_queue', 'gapps_queue');
80 copyTable('#x4dat#.gapps_reporting', 'gapps_reporting');
81
82 copyTable('#x4dat#.contacts', 'contacts');
83 copyTable('#x4dat#.coupures', 'downtimes');
84 copyTable('#x4dat#.emails_watch', 'email_watch');
85 copyTable('#x4dat#.homonymes', 'homonyms');
86 copyTable('#x4dat#.ip_watch', 'ip_watch');
87 copyTable('#x4dat#.mx_watch', 'mx_watch');
88 copyTable('#x4dat#.ml_moderate', 'ml_moderate');
89
90 copyTable('#x4dat#.postfix_blacklist', 'postfix_blacklist');
91 copyTable('#x4dat#.postfix_mailseen', 'postfix_mailseen');
92 copyTable('#x4dat#.postfix_whitelist', 'postfix_whitelist');
93
94 copyTable('#x4dat#.photo', 'profile_photos');
95
96 copyTable('#x4dat#.register_marketing', 'register_marketing');
97 copyTable('#x4dat#.register_pending', 'register_pending');
98 copyTable('#x4dat#.register_subs', 'register_subs');
99 copyTable('#x4dat#.register_mstats', 'register_mstats');
100
101 copyTable('#x4dat#.reminder', 'reminder');
102 copyTable('#x4dat#.reminder_type', 'reminder_type');
103
104 copyTable('#x4dat#.requests', 'requests');
105 copyTable('#x4dat#.requests_answers', 'requests_answers');
106 copyTable('#x4dat#.requests_hidden', 'requests_hidden');
107
108 copyTable('#x4dat#.search_autocomplete', 'search_autocomplete');
109 copyTable('#x4dat#.search_name', 'search_name');
110
111 copyTable('#x4dat#.skins', 'skins');
112 copyTable('#x4dat#.tips', 'tips');
113
114 copyTable('#x4dat#.survey_surveys', 'surveys');
115 copyTable('#x4dat#.survey_anwsers', 'survey_anwsers');
116 copyTable('#x4dat#.survey_votes', 'survey_votes');
117
118 copyTable('#x4dat#.watch_profile', 'watch_profile');
119 copyTable('#x4dat#.perte_pass', 'account_lost_passwords');
120
121 copyTable('#x4dat#.geoloc_pays', 'geoloc_pays');
122
123 copyTable('#x4dat#.aliases', 'aliases');
124 copyTable('#x4dat#.virtual', 'virtual');
125 copyTable('#x4dat#.virtual_domains', 'virtual_domains');
126 copyTable('#x4dat#.virtual_redirect', 'virtual_redirect');
127
128 copyTable('#x4dat#.watch_nonins', 'watch_nonins');
129 copyTable('#x4dat#.watch_promo', 'watch_promo');
130 copyTable('#x4dat#.watch_profile', 'watch_profile');
131
132 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
133 ?>