mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 02:16:02 +00:00
fix
This commit is contained in:
@@ -638,6 +638,10 @@ describe('Deploy database', () => {
|
|||||||
testWrapper(async (conn, driver, engine) => {
|
testWrapper(async (conn, driver, engine) => {
|
||||||
await testDatabaseDeploy(engine, conn, driver, [
|
await testDatabaseDeploy(engine, conn, driver, [
|
||||||
[
|
[
|
||||||
|
{
|
||||||
|
name: 't1.uninstall.sql',
|
||||||
|
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)',
|
||||||
|
|||||||
@@ -161,7 +161,8 @@ export class ScriptDrivedDeployer {
|
|||||||
case 'install':
|
case 'install':
|
||||||
if (isEqual) return;
|
if (isEqual) return;
|
||||||
const uninstallFile = this.uninstall.find(x => x.name == file.name.replace('.install.sql', '.uninstall.sql'));
|
const uninstallFile = this.uninstall.find(x => x.name == file.name.replace('.install.sql', '.uninstall.sql'));
|
||||||
if (uninstallFile) {
|
if (uninstallFile && journalItem) {
|
||||||
|
// file was previously installed, uninstall first
|
||||||
await this.runFileCore(
|
await this.runFileCore(
|
||||||
uninstallFile,
|
uninstallFile,
|
||||||
'uninstall',
|
'uninstall',
|
||||||
|
|||||||
Reference in New Issue
Block a user