I'm trying to add a field Order to my tables:
$tables = array(Gun => 6,Color => 2,Holster => 2,Canter => 1,Hand => 1);
foreach($tables as $key => $val) {
$table_name = $wpdb->prefix . 'GunInventory'.$key;
$sql = "CREATE TABLE $table_name (
GunInventory".$key."Id int(11) NOT NULL AUTO_INCREMENT,
Name varchar(200) NOT NULL,
Value char(".$val.") NOT NULL,
Price decimal(10,2) NOT NULL,
Order INT NOT NULL,
UNIQUE KEY GunInventory".$key."Id (GunInventory".$key."Id)
);";
dbDelta($sql);
}
The issue is the field Order is not being created on my tables, I've tried deleting the field from the tables and reinstalling the plug-in and my tables stay the same. The script will though create the tables.
I tried turning on debug and I don't get any errors.