awferreira / c5-db-migration

Automatically exported from code.google.com/p/c5-db-migration
0 stars 0 forks source link

allow loading migrations from classpath as well #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'd like to ask for an enhancement. I'd love to use c5-db-migrations
with maven but load migrations from the maven classpath instead of the
filesystem.

The basic usage scenario is having a root pom where c5-db-migrations
is configured and which also depends on the artifact holding the
migration scripts. Therefore, all child-project developers could
automatically use c5-db-migrations to execute the default migration
scripts.

I actually hacked this feature into c5dbmigrations with changing line 135 from:

if (!(migrationsPath.startsWith("/") || migrationsPath.startsWith
("\"")))
to
if (!(migrationsPath.startsWith("/") || migrationsPath.startsWith
("\"") || migrationsPath.startsWith("classpath:")))

so the Spring Resource API's classpath: prefix could be applied to
this scenario, it works well. 

I actually think it might helps others too and become a docuemented feature
of this excellent tool.

Original issue reported on code.google.com by kristof....@gmail.com on 1 Apr 2009 at 6:42

GoogleCodeExporter commented 8 years ago

Original comment by christia...@gmail.com on 31 Aug 2009 at 6:26

GoogleCodeExporter commented 8 years ago

Original comment by christia...@gmail.com on 31 Aug 2009 at 6:27

GoogleCodeExporter commented 8 years ago
Fixed in 0.9.8-rc1 (note the new groupId com.carbonfive.db-support).  Why don't 
you
give it a try and let me know if it works as expected?

Original comment by christia...@gmail.com on 1 Sep 2009 at 4:32

GoogleCodeExporter commented 8 years ago
0.9.8-rc3 is what you should try... I missed a few things.

Original comment by christia...@gmail.com on 1 Sep 2009 at 9:04