mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Improve error handling when moving table to a different schema
When moving an existing table to a different schema which already contains a table of that name, this causes an error. With this commit we try to detect this type of error as early as possible. This commit also updates the error message for that case. The old error message still mentioned the 'temporary flag' which isn't correct anymore. Also, when changing the schema fails, reset the dropdown box back to a working schema to avoid any confusion about whether the change worked or not.
This commit is contained in:
@@ -733,8 +733,8 @@ void EditTableDialog::changeSchema(const QString& schema)
|
||||
{
|
||||
if(!pdb.renameColumn(curTable, m_table, QString(), sqlb::FieldPtr(), 0, schema))
|
||||
{
|
||||
QMessageBox::warning(this, QApplication::applicationName(),
|
||||
tr("Setting the temporary flag for the table failed. Error message:\n%1").arg(pdb.lastError()));
|
||||
QMessageBox::warning(this, QApplication::applicationName(), tr("Changing the table schema failed. Error message:\n%1").arg(pdb.lastError()));
|
||||
ui->comboSchema->setCurrentText(curTable.schema()); // Set it back to the original schema
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user