Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db migration commands results in errors when using inline/exploded plugins #133

Open
snimavat opened this issue Jun 27, 2017 · 3 comments
Open

Comments

@snimavat
Copy link
Contributor

When a project uses any plugin as exploded as below

grails {
    exploded = true
    plugins {
        compile project(':inline-plugin')
    }
}

Db migration will try to run the commands on the plugin too, and will fails with error

Try with attached example
bugwork.zip

run the grails dam-generate-gorm-changelog on the app and u should see the error.

@Giacom
Copy link

Giacom commented May 15, 2018

Same problem here. Has anyone had any workarounds?

@Giacom
Copy link

Giacom commented Aug 16, 2018

The only 'work-around' I have found is to use dbmUpdate, or other commands, using gradle.

Example:

# dbm-update for root project only
grails gradle :dbmUpdate

@Giacom
Copy link

Giacom commented Aug 31, 2018

I discovered an even better workaround if you can edit the inline project.

If you add this to your inline project's build.gradle:

//
// Workaround for the database migration plugin.
//
// If the root project has the database migration plugin then trying to execute
// its commands will try to trigger the task on this library,
// which then causes errors and stops the command from running.
// This workaround will mimic the command so it will not throw an error.

task dbmStatus(overwrite: true) {}
task dbmChangelogSync(overwrite: true) {}
task dbmChangelogSyncSql(overwrite: true) {}
task dbmClearChecksums(overwrite: true) {}
task dbmDbDoc(overwrite: true) {}
task dbmDiff(overwrite: true) {}
task dbmDropAll(overwrite: true) {}
task dbmFutureRollbackCountSql(overwrite: true) {}
task dbmFutureRollbackSql(overwrite: true) {}
task dbmGenerateChangelog(overwrite: true) {}
task dbmGenerateGormChangelog(overwrite: true) {}
task dbmGormDiff(overwrite: true) {}
task dbmListLocks(overwrite: true) {}
task dbmMarkNextChangesetRan(overwrite: true) {}
task dbmMarkNextChangesetRanSql(overwrite: true) {}
task dbmReleaseLocks(overwrite: true) {}
task dbmRollback(overwrite: true) {}
task dbmRollbackCount(overwrite: true) {}
task dbmRollbackCountSql(overwrite: true) {}
task dbmRollbackSql(overwrite: true) {}
task dbmRollbackToDate(overwrite: true) {}
task dbmRollbackToDateSql(overwrite: true) {}
task dbmStatus(overwrite: true) {}
task dbmTag(overwrite: true) {}
task dbmUpdate(overwrite: true) {}
task dbmUpdateCount(overwrite: true) {}
task dbmUpdateCountSql(overwrite: true) {}
task dbmUpdateSql(overwrite: true) {}
task dbmValidate(overwrite: true) {}

It will override the tasks and allow you to perform the normal commands on your root project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants