mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Don't SQL export indices or triggers if their base table isn't exported
See issue #1013.
This commit is contained in:
@@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user