+ protected function dropFkey( $table, $field ) {
+ $fi = $this->db->fieldInfo( $table, $field );
+ if ( is_null( $fi ) ) {
+ $this->output( "WARNING! Column '$table.$field' does not exist but it should! " .
+ "Please report this.\n" );
+ return;
+ }
+ $conname = $fi->conname();
+ if ( $fi->conname() ) {
+ $this->output( "Dropping foreign key constraint on '$table.$field'\n" );
+ $conclause = "CONSTRAINT \"$conname\"";
+ $command = "ALTER TABLE $table DROP CONSTRAINT $conname";
+ $this->db->query( $command );
+ } else {
+ $this->output( "Foreign key constraint on '$table.$field' already does not exist\n" );
+ };
+ }
+