mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 21:56:00 +00:00
oracle - rename table, deploy scripts passes
This commit is contained in:
@@ -89,7 +89,10 @@ async function testDatabaseDeploy(engine, conn, driver, dbModelsYaml, options) {
|
|||||||
systemConnection: conn.isPreparedOnly ? undefined : conn,
|
systemConnection: conn.isPreparedOnly ? undefined : conn,
|
||||||
connection: conn.isPreparedOnly ? conn : undefined,
|
connection: conn.isPreparedOnly ? conn : undefined,
|
||||||
driver,
|
driver,
|
||||||
loadedDbModel,
|
loadedDbModel: loadedDbModel.map(x => ({
|
||||||
|
...x,
|
||||||
|
text: x.text ? formatQueryWithoutParams(driver, x.text) : undefined,
|
||||||
|
})),
|
||||||
dbdiffOptionsExtra,
|
dbdiffOptionsExtra,
|
||||||
});
|
});
|
||||||
console.debug('Generated deploy script:', sql);
|
console.debug('Generated deploy script:', sql);
|
||||||
@@ -682,7 +685,7 @@ describe('Deploy database', () => {
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
name: '1.predeploy.sql',
|
name: '1.predeploy.sql',
|
||||||
text: 'create table t1 (id int primary key); insert into t1 (id) values (1);',
|
text: 'create table ~t1 (~id int primary key); insert into ~t1 (id) values (1);',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
@@ -702,29 +705,29 @@ describe('Deploy database', () => {
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
name: 't1.uninstall.sql',
|
name: 't1.uninstall.sql',
|
||||||
text: 'drop table t1',
|
text: 'drop table ~t1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 't1.install.sql',
|
name: 't1.install.sql',
|
||||||
text: 'create table t1 (id int primary key); insert into t1 (id) values (1)',
|
text: 'create table ~t1 (~id int primary key); insert into ~t1 (~id) values (1)',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 't2.once.sql',
|
name: 't2.once.sql',
|
||||||
text: 'create table t2 (id int primary key); insert into t2 (id) values (1)',
|
text: 'create table ~t2 (~id int primary key); insert into ~t2 (~id) values (1)',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
name: 't1.uninstall.sql',
|
name: 't1.uninstall.sql',
|
||||||
text: 'drop table t1',
|
text: 'drop table ~t1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 't1.install.sql',
|
name: 't1.install.sql',
|
||||||
text: 'create table t1 (id int primary key, val int); insert into t1 (id, val) values (1, 11)',
|
text: 'create table ~t1 (~id int primary key, ~val int); insert into ~t1 (~id, ~val) values (1, 11)',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 't2.once.sql',
|
name: 't2.once.sql',
|
||||||
text: 'insert into t2 (id) values (2)',
|
text: 'insert into ~t2 (~id) values (2)',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -122,6 +122,10 @@ class Dumper extends SqlDumper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renameTable(obj, newname) {
|
||||||
|
this.putCmd('^alter ^table %f ^rename ^to %i', obj, newname);
|
||||||
|
}
|
||||||
|
|
||||||
// putValue(value) {
|
// putValue(value) {
|
||||||
// if (value === true) this.putRaw('true');
|
// if (value === true) this.putRaw('true');
|
||||||
// else if (value === false) this.putRaw('false');
|
// else if (value === false) this.putRaw('false');
|
||||||
|
|||||||
Reference in New Issue
Block a user