Closed ErwinvanBrandwijk closed 13 years ago
Should be fixed in SHA: 51f01067431c2135d3b8ce21fa63685992425a6d. I ran the following changelog, and a table was created:
databaseChangeLog() {
new File('test.sql').withPrintWriter { pw ->
pw.println "CREATE TABLE monkey (id int, mood varchar(50))"
}
changeSet(id:'monkey', author: 'tlberglund') {
sqlFile(path: 'test.sql')
}
}
It is working now, great. You should at relativeToChangelogFile.
void sqlFile(Map params) {
def change = makeChangeFromMap(SQLFileChange, params, ['path', 'stripComments', 'splitStatements', 'encoding', 'endDelimiter','relativeToChangelogFile'])
change.resourceAccessor = resourceAccessor
addChange(change)
}
changelog changeSet(author: "erwin", id: "1"){ sqlFile(path: "dump.sql", stripComments: true, splitStatements: true, endDelimiter: ";", encoding: "utf8", relativeToChangelogFile: false) }
changeSet(author: "erwin", id: "2"){
sqlFile(path: "dump1.sql", stripComments: true, splitStatements: true, endDelimiter: ";", encoding: "utf8", relativeToChangelogFile: true)
}
It works on my fork, so just a little change.
Closing this issue. Solved.
relativeToChangelogFile has his own issue.
I tried to use sqlFile but I keep getting an error:
This is the changeset: changeSet(author: "erwin", id: "10") { comment("dump")
Also tried: changeSet(author: "erwin", id: "10") { comment("dump")
And changeSet(author: "erwin", id: "10") { comment("dump")
And (editted changeSetDelegate sqlFile I added relativeToChangelogFile) changeSet(author: "erwin", id: "10") { comment("dump")
None of them worked.