var $foreign_keys = false; // Does the generator build foreign keys
var $drop_primary_key = 'ALTER TABLE TABLENAME DROP CONSTRAINT KEYNAME'; // Template to drop PKs
- // with automatic replace for TABLENAME, KEYTYPE and KEYNAME
+ // with automatic replace for TABLENAME and KEYNAME
var $drop_unique_key = 'ALTER TABLE TABLENAME DROP CONSTRAINT KEYNAME'; // Template to drop UKs
- // with automatic replace for TABLENAME, KEYTYPE and KEYNAME
+ // with automatic replace for TABLENAME and KEYNAME
var $drop_foreign_key = 'ALTER TABLE TABLENAME DROP CONSTRAINT KEYNAME'; // Template to drop FKs
- // with automatic replace for TABLENAME, KEYTYPE and KEYNAME
+ // with automatic replace for TABLENAME and KEYNAME
var $sequence_extra_code = true; //Does the generator need to add extra code to generate the sequence fields
var $sequence_name = 'auto_increment'; //Particular name for inline sequences in this generator
case XMLDB_KEY_PRIMARY:
if ($this->primary_keys) {
$template = $this->drop_primary_key;
- $keytype = 'PRIMARY';
$dropkey = true;
}
break;
case XMLDB_KEY_UNIQUE:
if ($this->unique_keys) {
$template = $this->drop_unique_key;
- $keytype = 'UNIQUE';
$dropkey = true;
}
break;
case XMLDB_KEY_FOREIGN:
if ($this->foreign_keys) {
$template = $this->drop_foreign_key;
- $keytype = 'FOREIGN KEY';
$dropkey = true;
}
break;
if ($dropkey) {
/// Replace TABLENAME, CONSTRAINTTYPE and KEYNAME as needed
$dropsql = str_replace('TABLENAME', $this->getEncQuoted($this->prefix . $xmldb_table->getName()), $template);
- $dropsql = str_replace('KEYTYPE', $keytype, $dropsql);
$dropsql = str_replace('KEYNAME', $dbkeyname, $dropsql);
$results[] = $dropsql;
var $primary_key_name = ''; //To force primary key names to one string (null=no force)
- var $drop_primary_key = 'ALTER TABLE TABLENAME DROP KEYTYPE KEYNAME'; // Template to drop PKs
- // with automatic replace for TABLENAME, KEYTYPE and KEYNAME
+ var $drop_primary_key = 'ALTER TABLE TABLENAME DROP PRIMARY KEY'; // Template to drop PKs
+ // with automatic replace for TABLENAME and KEYNAME
- var $drop_unique_key = 'ALTER TABLE TABLENAME DROP KEYTYPE KEYNAME'; // Template to drop UKs
- // with automatic replace for TABLENAME, KEYTYPE and KEYNAME
+ var $drop_unique_key = 'ALTER TABLE TABLENAME DROP KEY KEYNAME'; // Template to drop UKs
+ // with automatic replace for TABLENAME and KEYNAME
- var $drop_foreign_key = 'ALTER TABLE TABLENAME DROP KEYTYPE KEYNAME'; // Template to drop FKs
- // with automatic replace for TABLENAME, KEYTYPE and KEYNAME
+ var $drop_foreign_key = 'ALTER TABLE TABLENAME DROP FOREIGN KEY KEYNAME'; // Template to drop FKs
+ // with automatic replace for TABLENAME and KEYNAME
var $sequence_extra_code = false; //Does the generator need to add extra code to generate the sequence fields
var $sequence_name = 'auto_increment'; //Particular name for inline sequences in this generator