| 1 |
<?php
|
| 2 |
|
| 3 |
// $Id: phorum_converter.install,v 1.1 2007/01/23 17:59:54 greggles Exp $
|
| 4 |
|
| 5 |
/**
|
| 6 |
* Creates the necessery extra and temporary tables for the conversion
|
| 7 |
*/
|
| 8 |
function phorum_converter_install() {
|
| 9 |
// user_id - uid
|
| 10 |
db_query("
|
| 11 |
CREATE TABLE {phorum_tmp_user_join} (
|
| 12 |
phorum int unsigned not null PRIMARY KEY,
|
| 13 |
drupal int unsigned not null
|
| 14 |
)
|
| 15 |
");
|
| 16 |
// forum_id - tid
|
| 17 |
db_query("
|
| 18 |
CREATE TABLE {phorum_tmp_forum_join} (
|
| 19 |
phorum int unsigned not null PRIMARY KEY,
|
| 20 |
drupal int unsigned not null
|
| 21 |
)
|
| 22 |
");
|
| 23 |
// message_id - cid - nid
|
| 24 |
db_query("
|
| 25 |
CREATE TABLE {phorum_tmp_message_join} (
|
| 26 |
phorum int unsigned not null PRIMARY KEY,
|
| 27 |
drupal int unsigned not null,
|
| 28 |
nid int unsigned not null
|
| 29 |
)
|
| 30 |
");
|
| 31 |
db_query("
|
| 32 |
CREATE TABLE {phorum_users} (
|
| 33 |
uid int unsigned not null PRIMARY KEY,
|
| 34 |
email_notify tinyint(1) unsigned not null,
|
| 35 |
post_count int unsigned not null
|
| 36 |
)
|
| 37 |
");
|
| 38 |
db_query("
|
| 39 |
ALTER TABLE {comments}
|
| 40 |
MODIFY subject varchar(255) not null
|
| 41 |
");
|
| 42 |
db_query("
|
| 43 |
ALTER TABLE {node}
|
| 44 |
MODIFY title varchar(255) not null
|
| 45 |
");
|
| 46 |
db_query("
|
| 47 |
ALTER TABLE {node_revisions}
|
| 48 |
MODIFY title varchar(255) not null
|
| 49 |
");
|
| 50 |
db_query("
|
| 51 |
ALTER TABLE {users}
|
| 52 |
MODIFY signature text not null
|
| 53 |
");
|
| 54 |
}
|
| 55 |
|
| 56 |
function phorum_converter_uninstall() {
|
| 57 |
// delete the variables we created.
|
| 58 |
variable_del('phorum_converter_prefix');
|
| 59 |
variable_del('phorum_converter_runtime');
|
| 60 |
variable_del('phorum_converter_admin_role');
|
| 61 |
variable_del('phorum_converter_msg_format');
|
| 62 |
variable_del('phorum_converter_phase');
|
| 63 |
variable_del('phorum_converter_phase_arg');
|
| 64 |
|
| 65 |
db_query("DROP TABLE {phorum_tmp_user_join}");
|
| 66 |
db_query("DROP TABLE {phorum_tmp_forum_join}");
|
| 67 |
db_query("DROP TABLE {phorum_tmp_message_join}");
|
| 68 |
db_query("DROP TABLE {phorum_users}");
|
| 69 |
}
|
| 70 |
|