Show in constraint list and in generated SQL when a constraint is inherited
This commit is contained in:
parent
60fb4ce285
commit
ccd88d0578
5 changed files with 50 additions and 22 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "PgConstraint.h"
|
||||
#include "SqlFormattingUtils.h"
|
||||
#include <QStringBuilder>
|
||||
|
||||
void operator<<(ConstraintType &s, const Pgsql::Value &v)
|
||||
{
|
||||
|
|
@ -176,10 +177,16 @@ QString PgConstraint::typeName() const
|
|||
|
||||
QString PgConstraint::dropSql() const
|
||||
{
|
||||
return getDropConstraintDefinition(catalog(), *this);
|
||||
if (isInherited())
|
||||
return "-- " % objectName() % " is inherited";
|
||||
|
||||
return getDropConstraintDefinition(catalog(), *this);
|
||||
}
|
||||
|
||||
QString PgConstraint::createSql() const
|
||||
{
|
||||
return getAlterTableConstraintDefinition(catalog(), *this);
|
||||
if (isInherited())
|
||||
return "-- " % objectName() % " is inherited";
|
||||
|
||||
return getAlterTableConstraintDefinition(catalog(), *this);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue