mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 02:06:01 +00:00
oracle - implemented scope identity
This commit is contained in:
@@ -142,6 +142,9 @@ class Analyser extends DatabaseAnalyser {
|
||||
..._.pick(col, ['columnName']),
|
||||
})),
|
||||
})),
|
||||
identitySequenceName: (columnsGrouped[columnGroup(table)] || [])
|
||||
.find(x => x?.default_value?.endsWith('.nextval'))
|
||||
?.default_value?.match(/\"([^"]+)\"\.nextval/)?.[1],
|
||||
};
|
||||
}),
|
||||
views: views.rows.map(view => ({
|
||||
|
||||
@@ -109,23 +109,13 @@ class Dumper extends SqlDumper {
|
||||
this.putCmd('^alter ^table %f ^modify (%i ^default ^null)', newcol, newcol.columnName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if (oldcol.notNull != newcol.notNull) {
|
||||
// if (newcol.notNull) this.putCmd('^alter ^table %f ^alter ^column %i ^set ^not ^null', newcol, newcol.columnName);
|
||||
// else this.putCmd('^alter ^table %f ^alter ^column %i ^drop ^not ^null', newcol, newcol.columnName);
|
||||
// }
|
||||
// if (oldcol.defaultValue != newcol.defaultValue) {
|
||||
// if (newcol.defaultValue == null) {
|
||||
// this.putCmd('^alter ^table %f ^alter ^column %i ^drop ^default', newcol, newcol.columnName);
|
||||
// } else {
|
||||
// this.putCmd(
|
||||
// '^alter ^table %f ^alter ^column %i ^set ^default %s',
|
||||
// newcol,
|
||||
// newcol.columnName,
|
||||
// newcol.defaultValue
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
selectScopeIdentity(table) {
|
||||
const sequence = table.identitySequenceName;
|
||||
if (sequence) {
|
||||
this.put('^select %i.CURRVAL FROM DUAL', sequence);
|
||||
}
|
||||
}
|
||||
|
||||
// putValue(value) {
|
||||
|
||||
@@ -22,6 +22,7 @@ const dialect = {
|
||||
},
|
||||
userDatabaseNamePrefix: 'C##',
|
||||
upperCaseAllDbObjectNames: true,
|
||||
requireStandaloneSelectForScopeIdentity: true,
|
||||
|
||||
createColumn: true,
|
||||
dropColumn: true,
|
||||
|
||||
Reference in New Issue
Block a user