public function drop(MidataView $view) { $name = $view->name(); return "DROP VIEW IF EXISTS `{$name}`;"; }
private function diffView($view) { $diff = array(); $status = self::NO_CHANGE; $sourceView = $this->adapter('source')->view($view); $targetView = $this->adapter('target')->view($view); foreach (View::allAttributes() as $attribute) { $sourceAttribute = $sourceView->{$attribute}(); $targetAttribute = $targetView->{$attribute}(); if ($sourceAttribute == Column::NOT_SUPPORTED || $targetAttribute == Column::NOT_SUPPORTED) { continue; } if ($sourceAttribute !== $targetAttribute) { $status = self::CHANGED; $diff[$attribute] = array('source' => $sourceAttribute, 'target' => $targetAttribute); } } return array('status' => $status, 'diff' => $diff); }