function radioactivity_install in Radioactivity 5
Same name and namespace in other branches
- 6 radioactivity.install \radioactivity_install()
- 7.2 radioactivity.install \radioactivity_install()
File
- ./
radioactivity.install, line 4
Code
function radioactivity_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {radioactivity} (\n id int NOT NULL,\n class varchar(7) NOT NULL,\n\t\t decay_profile int NOT NULL,\n energy double unsigned NOT NULL DEFAULT 0,\n last_emission_timestamp int NOT NULL,\n PRIMARY KEY (id, class, decay_profile)\n ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
db_query("CREATE INDEX {radioactivity_ix_energy}\n ON {radioactivity} (energy);");
break;
case 'pgsql':
db_query("CREATE TABLE {radioactivity} (\n id int NOT NULL,\n class varchar(7) NOT NULL,\n\t\t decay_profile int NOT NULL,\n energy double precision NOT NULL DEFAULT 0,\n last_emission_timestamp int NOT NULL,\n PRIMARY KEY (id, class, decay_profile)\n );");
db_query("CREATE INDEX {radioactivity}_ix_energy\n ON {radioactivity} (energy);");
break;
}
}