Make WordPress Core

Changeset 1595


Ignore:
Timestamp:
09/04/2004 10:04:19 PM (21 years ago)
Author:
saxmatt
Message:

Remove optiontypes table.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/install.php

    r1594 r1595  
    343343$q = $wpdb->query($query);
    344344
    345 // $query = "DROP TABLE IF EXISTS $tableoptiontypes";
    346 // $q = mysql_query($query) or mysql_doh("doh, can't drop the table \"$tableoptiontypes\" in the database.");
    347 
    348 $query = "
    349 CREATE TABLE $wpdb->optiontypes (
    350   optiontype_id int(11) NOT NULL auto_increment,
    351   optiontype_name varchar(64) NOT NULL,
    352   PRIMARY KEY (optiontype_id)
    353 )
    354 ";
    355 $q = $wpdb->query($query);
    356 
    357 
    358 // $query = "DROP TABLE IF EXISTS $tableoptiongroups";
    359 // $q = mysql_query($query) or mysql_doh("doh, can't drop the table \"$tableoptiongroups\" in the database.");
    360 
    361345$query = "
    362346CREATE TABLE $wpdb->optiongroups (
     
    385369
    386370$option_data = array(
    387 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (1, 'integer')",
    388 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (2, 'boolean')",
    389 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (3, 'string')",
    390 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (4, 'date')",
    391 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (5, 'select')",
    392 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (6, 'range')",
    393 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (7, 'sqlselect')",
    394 "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES (8, 'float')",
    395 
    396371//base options from b2cofig
    397372"INSERT INTO $wpdb->options (option_id, option_name, option_type, option_value, option_description, option_admin_level, option_width) VALUES(1,'siteurl', 3, '$guessurl', 'siteurl is your blog\'s URL: for example, \'http://example.com/wordpress\' (no trailing slash !)', 8, 30)",
  • trunk/wp-admin/upgrade-functions.php

    r1594 r1595  
    9393  PRIMARY KEY  (option_id,blog_id,option_name)
    9494);
    95 CREATE TABLE $wpdb->optiontypes (
    96   optiontype_id int(11) NOT NULL auto_increment,
    97   optiontype_name varchar(64) NOT NULL default '',
    98   PRIMARY KEY  (optiontype_id)
    99 );
    10095CREATE TABLE $wpdb->post2cat (
    10196  rel_id int(11) NOT NULL auto_increment,
     
    223218    )
    224219    ");
    225     maybe_create_table($wpdb->optiontypes, "
    226     CREATE TABLE $wpdb->optiontypes (
    227       optiontype_id int(11) NOT NULL auto_increment,
    228       optiontype_name varchar(64) NOT NULL,
    229       PRIMARY KEY (optiontype_id)
    230     )
    231     ");
    232220    maybe_create_table($wpdb->optiongroups, "
    233221    CREATE TABLE $wpdb->optiongroups (
     
    247235    )
    248236    ");
    249    
    250     // TODO: REWRITE THIS
    251     $option_types = array(
    252         "1" => "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES ('1', 'integer')",
    253         "2" => "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES ('2', 'boolean')",
    254         "3" => "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES ('3', 'string')",
    255         "4" => "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES ('4', 'date')",
    256         "5" => "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES ('5', 'select')",
    257         "6" => "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES ('6', 'range')",
    258         "7" => "INSERT INTO $wpdb->optiontypes (optiontype_id, optiontype_name) VALUES ('7', 'sqlselect')");
    259 
    260     foreach ($option_types as $option_id => $query) {
    261         if(!$wpdb->get_var("SELECT * FROM $wpdb->optiontypes WHERE optiontype_id = '$option_id'")) {
    262             $wpdb->query($query);
    263         }
    264     }
    265237
    266238    // Guess a site URI
     
    904876    }
    905877
     878    // Obsolete tables
    906879    $wpdb->query('DROP TABLE IF EXISTS ' . $table_prefix . 'optionvalues');
     880    $wpdb->query('DROP TABLE IF EXISTS ' . $table_prefix . 'optiontypes');
    907881}
    908882
  • trunk/wp-settings.php

    r1594 r1595  
    2626$wpdb->linkcategories      = $table_prefix . 'linkcategories';
    2727$wpdb->options             = $table_prefix . 'options';
    28 $wpdb->optiontypes         = $table_prefix . 'optiontypes';
    2928$wpdb->optiongroups        = $table_prefix . 'optiongroups';
    3029$wpdb->optiongroup_options = $table_prefix . 'optiongroup_options';
     
    4140$tablelinkcategories = $wpdb->linkcategories;
    4241$tableoptions = $wpdb->options;
    43 $tableoptiontypes = $wpdb->optiontypes;
    4442$tableoptiongroups = $wpdb->optiongroups;
    4543$tableoptiongroup_options = $wpdb->optiongroup_options;
Note: See TracChangeset for help on using the changeset viewer.