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