conditional_fields.install in Conditional Fields 5
File
conditional_fields.install
View source
<?php
function conditional_fields_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {conditional_fields} (\n control_field_name varchar(32) NOT NULL default '',\n field_name varchar(32) NOT NULL default '',\n type varchar(127) NOT NULL default '',\n trigger_values mediumtext NOT NULL\n ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
break;
case 'pgsql':
db_query("CREATE TABLE {conditional_fields} (\n control_field_name varchar(32) NOT NULL default '',\n field_name varchar(32) NOT NULL default '',\n type varchar(127) NOT NULL default '',\n trigger_values text NOT NULL\n ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
break;
}
db_query("UPDATE {system} SET weight = 10 WHERE name = 'conditional_fields'");
}
function conditional_fields_uninstall() {
db_query("DELETE FROM {variable} WHERE name LIKE 'c_fields_%'");
cache_clear_all('variables', 'cache');
db_query('DROP TABLE {conditional_fields}');
}