mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
oracle: fixed analysing constraints
This commit is contained in:
parent
8f5b395935
commit
2d1ac97191
@ -139,7 +139,7 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
indexes: _.uniqBy(
|
indexes: _.uniqBy(
|
||||||
indexes.rows.filter(
|
indexes.rows.filter(
|
||||||
idx =>
|
idx =>
|
||||||
idx.tableName == table.pureName && !uniqueNames.rows.find(x => x.constraintName == idx.constraintName)
|
idx.tableName == newTable.pureName && !uniqueNames.rows.find(x => x.constraintName == idx.constraintName)
|
||||||
),
|
),
|
||||||
'constraintName'
|
'constraintName'
|
||||||
).map(idx => ({
|
).map(idx => ({
|
||||||
@ -149,12 +149,13 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
.filter(col => col.tableName == idx.tableName && col.constraintName == idx.constraintName)
|
.filter(col => col.tableName == idx.tableName && col.constraintName == idx.constraintName)
|
||||||
.map(col => ({
|
.map(col => ({
|
||||||
..._.pick(col, ['columnName']),
|
..._.pick(col, ['columnName']),
|
||||||
|
isDescending: col.descending == 'DESC',
|
||||||
})),
|
})),
|
||||||
})),
|
})),
|
||||||
uniques: _.uniqBy(
|
uniques: _.uniqBy(
|
||||||
indexes.rows.filter(
|
indexes.rows.filter(
|
||||||
idx =>
|
idx =>
|
||||||
idx.tableName == table.pureName && uniqueNames.rows.find(x => x.constraintName == idx.constraintName)
|
idx.tableName == newTable.pureName && uniqueNames.rows.find(x => x.constraintName == idx.constraintName)
|
||||||
),
|
),
|
||||||
'constraintName'
|
'constraintName'
|
||||||
).map(idx => ({
|
).map(idx => ({
|
||||||
|
@ -5,7 +5,6 @@ select i.table_name as "tableName",
|
|||||||
i.index_type as "indexType",
|
i.index_type as "indexType",
|
||||||
i.uniqueness as "Unique",
|
i.uniqueness as "Unique",
|
||||||
ic.column_name as "columnName",
|
ic.column_name as "columnName",
|
||||||
ic.column_position as "postion",
|
|
||||||
ic.descend as "descending"
|
ic.descend as "descending"
|
||||||
from all_ind_columns ic, all_indexes i
|
from all_ind_columns ic, all_indexes i
|
||||||
where INDEX_OWNER = '$owner' AND ic.index_owner = i.owner
|
where INDEX_OWNER = '$owner' AND ic.index_owner = i.owner
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
module.exports = `
|
module.exports = `
|
||||||
select constraint_name
|
select constraint_name as "constraintName"
|
||||||
from all_constraints
|
from all_constraints
|
||||||
where OWNER='$owner' and constraint_type = 'U'
|
where owner='$owner' and constraint_type = 'U'
|
||||||
and constraint_name =OBJECT_ID_CONDITION
|
and constraint_name =OBJECT_ID_CONDITION
|
||||||
`;
|
`;
|
||||||
|
Loading…
Reference in New Issue
Block a user