--
-- VIEW category-view
--
-DROP VIEW `category-view`;
+DROP VIEW IF EXISTS `category-view`;
CREATE VIEW `category-view` AS SELECT
`post-category`.`uri-id` AS `uri-id`,
`post-category`.`uid` AS `uid`,
--
-- VIEW tag-view
--
-DROP VIEW `tag-view`;
+DROP VIEW IF EXISTS `tag-view`;
CREATE VIEW `tag-view` AS SELECT
`post-tag`.`uri-id` AS `uri-id`,
`item-uri`.`uri` AS `uri`,
--
-- VIEW network-item-view
--
-DROP VIEW `network-item-view`;
+DROP VIEW IF EXISTS `network-item-view`;
CREATE VIEW `network-item-view` AS SELECT
`item`.`parent-uri-id` AS `uri-id`,
`item`.`parent-uri` AS `uri`,
--
-- VIEW network-thread-view
--
-DROP VIEW `network-thread-view`;
+DROP VIEW IF EXISTS `network-thread-view`;
CREATE VIEW `network-thread-view` AS SELECT
`item`.`uri-id` AS `uri-id`,
`item`.`uri` AS `uri`,
--
-- VIEW owner-view
--
-DROP VIEW `owner-view`;
+DROP VIEW IF EXISTS `owner-view`;
CREATE VIEW `owner-view` AS SELECT
`contact`.`id` AS `id`,
`contact`.`uid` AS `uid`,
--
-- VIEW pending-view
--
-DROP VIEW `pending-view`;
+DROP VIEW IF EXISTS `pending-view`;
CREATE VIEW `pending-view` AS SELECT
`register`.`id` AS `id`,
`register`.`hash` AS `hash`,
--
-- VIEW tag-search-view
--
-DROP VIEW `tag-search-view`;
+DROP VIEW IF EXISTS `tag-search-view`;
CREATE VIEW `tag-search-view` AS SELECT
`post-tag`.`uri-id` AS `uri-id`,
`item`.`id` AS `iid`,
--
-- VIEW workerqueue-view
--
-DROP VIEW `workerqueue-view`;
+DROP VIEW IF EXISTS `workerqueue-view`;
CREATE VIEW `workerqueue-view` AS SELECT
`process`.`pid` AS `pid`,
`workerqueue`.`priority` AS `priority`
}
if (self::isView($name)) {
- $sql = sprintf("DROP VIEW `%s`", DBA::escape($name));
+ $sql = sprintf("DROP VIEW IF EXISTS `%s`", DBA::escape($name));
} elseif (self::isTable($name)) {
- $sql = sprintf("DROP TABLE `%s`", DBA::escape($name));
+ $sql = sprintf("DROP TABLE IF EXISTS `%s`", DBA::escape($name));
}
if ($verbose) {