mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Add column to EditTableDialog to allow setting foreign key constraints
Add a new column to the fiel table in the Edit Table Dialog to allow the user to add and edit foreign key constraints.
This commit is contained in:
@@ -112,6 +112,7 @@ void EditTableDialog::populateFields()
|
||||
tbitem->setCheckState(kUnique, f->unique() ? Qt::Checked : Qt::Unchecked);
|
||||
tbitem->setText(kDefault, f->defaultValue());
|
||||
tbitem->setText(kCheck, f->check());
|
||||
tbitem->setText(kForeignKey, f->foreignKey());
|
||||
ui->treeWidget->addTopLevelItem(tbitem);
|
||||
}
|
||||
|
||||
@@ -365,6 +366,11 @@ void EditTableDialog::itemChanged(QTreeWidgetItem *item, int column)
|
||||
if(!m_bNewTable)
|
||||
callRenameColumn = true;
|
||||
break;
|
||||
case kForeignKey:
|
||||
field->setForeignKey(item->text(column));
|
||||
if(!m_bNewTable)
|
||||
callRenameColumn = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(callRenameColumn)
|
||||
|
||||
Reference in New Issue
Block a user