mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 18:40:13 -06:00
add columns if modifying tables
This commit is contained in:
@@ -115,6 +115,16 @@ void EditTableDialog::accept()
|
||||
} else {
|
||||
// Editing of old table
|
||||
|
||||
// add added fields
|
||||
// TODO this will not work if an added field is marked
|
||||
// as autoincrement
|
||||
QString sTablesql = pdb->getTableSQL(curTable);
|
||||
sqlb::Table oldschema = sqlb::Table::parseSQL(sTablesql);
|
||||
for( int i = oldschema.fields().count(); i < m_table.fields().count(); ++i)
|
||||
{
|
||||
pdb->addColumn(curTable, m_table.fields().at(i));
|
||||
}
|
||||
|
||||
// Rename table if necessary
|
||||
if(ui->editTableName->text() != curTable)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user