$db->query("alter table sessions change dla session_dla int(11)");
$db->query("update applications set app_order=1,app_tables=NULL where app_name='admin'");
$db->query("update applications set app_order=2,app_tables=NULL where app_name='tts'");
$db->query("update applications set app_order=3,app_tables=NULL where app_name='inv'");
$db->query("update applications set app_order=4,app_tables=NULL where app_name='chat'");
$db->query("update applications set app_order=5,app_tables='news_sites,news_headlines,users_headlines' where app_name='headlines'");
$db->query("update applications set app_order=6,app_tables=NULL where app_name='filemanager'");
$db->query("update applications set app_order=7,app_tables='addressbook' where app_name='addressbook'");
$db->query("update applications set app_order=8,app_tables='todo' where app_name='todo'");
$db->query("update applications set app_order=9,app_tables='webcal_entry,webcal_entry_users,webcal_entry_groups,webcal_repeats' where app_name='calendar'");
$db->query("update applications set app_order=10,app_tables=NULL where app_name='email'");
$db->query("update applications set app_order=11,app_tables='newsgroups,users_newsgroups' where app_name='nntp'");
$db->query("update applications set app_order=0,app_tables=NULL where app_name='cron_apps'");
$sql="CREATE TABLE config ("
."config_name varchar(25) NOT NULL,"
."config_value varchar(100),"
."UNIQUE config_name (config_name)"
.")";
$db->query($sql);
$db->query("insert into config (config_name, config_value) values ('default_tplset', 'default')");
$db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')");
$db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')");
$db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else'");
$db->query("insert into config (config_name, config_value) values ('site_title', 'phpGroupWare')");
$db->query("insert into config (config_name, config_value) values ('hostname', 'local.machine.name')");
$db->query("insert into config (config_name, config_value) values ('webserver_url', '/phpgroupware')");
$db->query("insert into config (config_name, config_value) values ('auth_type', 'sql')");
$db->query("insert into config (config_name, config_value) values ('ldap_host', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('ldap_context', 'o=phpGroupWare')");
$db->query("insert into config (config_name, config_value) values ('usecookies', 'True')");
$db->query("insert into config (config_name, config_value) values ('mail_server', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('mail_server_type', 'imap')");
$db->query("insert into config (config_name, config_value) values ('imap_server_type', 'Cyrus')");
$db->query("insert into config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')");
$db->query("insert into config (config_name, config_value) values ('mail_login_type', 'standard')");
$db->query("insert into config (config_name, config_value) values ('smtp_server', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('smtp_port', '25')");
$db->query("insert into config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')");
$db->query("insert into config (config_name, config_value) values ('nntp_port', '119')");
$db->query("insert into config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')");
$db->query("insert into config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')");
$db->query("insert into config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')");
$db->query("insert into config (config_name, config_value) values ('nntp_login_username', '')");
$db->query("insert into config (config_name, config_value) values ('nntp_login_password', '')");
$db->query("insert into config (config_name, config_value) values ('default_ftp_server', 'localhost')");
$db->query("insert into config (config_name, config_value) values ('httpproxy_server', '')");
$db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')");
$db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')");
$db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')");
echo" <tr bgcolor=\"e6e6e6\">\n";
echo" <td>Upgrade from 9072000 to 0.9.1 is completed.</td>\n";
$db->query("update applications set app_version='$newversion' where (app_name='admin' or app_name='filemanager' or app_name='addressbook' or app_name='todo' or app_name='calendar' or app_name='email' or app_name='nntp' or app_name='cron_apps')");