update_100
- Versions
- 4.6
update_100()
Code
database/updates.inc, line 1585
<?php
function update_100() {
$ret = array();
if ($GLOBALS["db_type"] == "mysql") {
$ret[] = update_sql("CREATE TABLE {locales_source} (
lid int(11) NOT NULL auto_increment,
location varchar(128) NOT NULL default '',
source blob NOT NULL,
PRIMARY KEY (lid)
)");
$ret[] = update_sql("CREATE TABLE {locales_target} (
lid int(11) NOT NULL default '0',
translation blob NOT NULL,
locale varchar(12) NOT NULL default '',
plid int(11) NOT NULL default '0',
plural int(1) NOT NULL default '0',
KEY lid (lid),
KEY lang (locale),
KEY plid (plid),
KEY plural (plural)
)");
$ret[] = update_sql("ALTER TABLE {users} CHANGE language language varchar(12) NOT NULL default ''");
}
else {
$ret[] = update_sql("CREATE TABLE {locales_target} (
lid int4 NOT NULL default '0',
translation text DEFAULT '' NOT NULL,
locale varchar(12) NOT NULL default '',
plid int4 NOT NULL default '0',
plural int4 NOT NULL default '0'
)");
$ret[] = update_sql("CREATE INDEX {locales_target}_lid ON {locales_target}(lid)");
$ret[] = update_sql("CREATE INDEX {locales_target}_locale ON {locales_target}(locale)");
$ret[] = update_sql("CREATE INDEX {locales_target}_plid ON {locales_target}(plid)");
$ret[] = update_sql("CREATE INDEX {locales_target}_plural ON {locales_target}(plural)");
$ret[] = update_sql("CREATE SEQUENCE {locales_source}_lid INCREMENT 1 START 0 MINVALUE 0");
$ret[] = update_sql("CREATE TABLE {locales_source} (
lid serial,
location varchar(128) NOT NULL default '',
source text NOT NULL,
PRIMARY KEY (lid)
)");
$ret[] = update_sql("ALTER TABLE {users} rename language to lang_archive");
$ret[] = update_sql("ALTER TABLE {users} add language varchar(12)");
$ret[] = update_sql("ALTER TABLE {users} ALTER language SET DEFAULT ''");
$ret[] = update_sql("UPDATE {users} SET language = ''");
$ret[] = update_sql("ALTER TABLE {users} ALTER language SET NOT NULL");
$ret[] = update_sql("update {users} set language = lang_archive");
}
$ret[] = update_sql("INSERT INTO {locales_meta} (locale, name, enabled, isdefault) VALUES ('en', 'English', '1', '1')");
return $ret;
}
?>Login or register to post comments 