Don't SQL export indices or triggers if their base table isn't exported

See issue #1013.
This commit is contained in:
Martin Kleusberg
2017-06-17 12:14:57 +02:00
parent 357faeed04
commit 157dadef50

View File

@@ -610,6 +610,11 @@ bool DBBrowserDB::dump(const QString& filename,
if(it.value()->type() == sqlb::Object::Types::Table)
continue;
// If this object is based on a table (e.g. is an index for that table) it depends on the existence of this table.
// So if we didn't export the base table this depends on, don't export this object either.
if(!(*it)->baseTable().isEmpty() && !tablesToDump.contains((*it)->baseTable()))
continue;
// Write the SQL string used to create this object to the output file
if(!(*it)->originalSql().isEmpty())
{