Improve movement of tables between different schemata

This improves the Edit Table dialog to better handle moving tables from
one schema to another, though the UI currently only knows about the main
and the temp schema.

This also simplifies the grammar code by removing the temporary flag
from all classes because it's redundant now that we support multiple
schemata.
This commit is contained in:
Martin Kleusberg
2017-09-04 17:38:08 +02:00
parent a5ca75655c
commit 7db96cdf13
5 changed files with 17 additions and 23 deletions

View File

@@ -253,7 +253,6 @@ void Table::clear()
m_fields.clear();
m_constraints.clear();
m_virtual = QString();
m_temporary = false;
}
Table::~Table()
{
@@ -456,8 +455,7 @@ QString Table::sql(const QString& schema, bool ifNotExists) const
return QString("CREATE VIRTUAL TABLE %1 USING %2;").arg(ObjectIdentifier(schema, m_name).toString(true)).arg(m_virtual);
// This is a normal table, not a virtual one
QString sql = QString("CREATE %1TABLE%2 %3 (\n")
.arg(m_temporary ? QString("TEMPORARY ") : QString(""))
QString sql = QString("CREATE TABLE%1 %2 (\n")
.arg(ifNotExists ? QString(" IF NOT EXISTS") : QString(""))
.arg(ObjectIdentifier(schema, m_name).toString(true));