Comments (11)
Hi, the reason is that all the migration objects must be executed somewhere. I put them in MigrationSummary
so they can be executed when MigrationSummary
is executed (and MigrationSummary
will be executed by MyMigrations
).
I think the best solution is to have the empty MigrationSummary
in your version control but never commit any changes to it. I'm not familiar with Mercurial. Do you think there is an easy way to do that in Mercurial?
from scala-forklift.
Thanks for answer, I need to try it.
I have one more idea, write soon.
from scala-forklift.
The problem is that we have rolled migrations summary. But we need to have all available migrations in summary and look for their status through the database. In this case we don't need to create symlinks and can commit all changes.
If I could change the migration status source, it would be enough for my case. Could you help me to find the respective code?
from scala-forklift.
I'm glad to help. However, I'm not sure I have understood your question.
I would not recommend putting the rolled migrations and migration summary in your version control, because some migrations may depend on the generated code, which may not have been generated on other people's machine.
from scala-forklift.
Ok, let me explain one more time.
I need to easy deploy an application and run tests on teamcity. So, code must be compiled every time. MyMigrations depends on MigrationSummary which contains for now only rolled migrations. I would like to store in MigrationSummary all available migrations. On other hand the status of migrations stored in database, and it's completely enough.
What do you think?
from scala-forklift.
If you store all migrations in MigrationSummary
you might not be able to compile the code because the code might depend on some generated code which is not generated yet.
If you want to get the status of migrations stored in the database, you can find it out using this method. If you want to modify how migration files and migration summary are handled, you can try to override traits in this file(In particular, handleMigrationFiles
for creating symlinks for migration files; writeSummary
for putting migrations into the summary file).
from scala-forklift.
I think I might see a problem here. If you compile and run a clean copy of the code on a machine with some migrations already applied, there might be a problem: the migrations will not be applied twice, but Forklift will not generate code for current database schemas, either. Not sure if that's a problem you have met. I will try to find some time to fix that over the weekend.
from scala-forklift.
If you store all migrations in MigrationSummary you might not be able to compile the code because the code might depend on some generated code which is not generated yet.
If I deploy the project from scratch I might meet the same problem. So it's the problem of migration code, but not MigrationSummary file.
We should always store the actual DB schema and migration list in repository. It guarantees us always working code.
from scala-forklift.
I overriden handleMigrationFile method, I don't create symlink, but make a hard copy of migration file. In this case application always compiles well.
from scala-forklift.
Cool! Guess I should make hard copy an option.
from scala-forklift.
Should be fixed by #35
from scala-forklift.
Related Issues (20)
- Overriding of Slick Code generation HOT 5
- "build.scala" is deprecated HOT 4
- Change License to Apache 2.0 HOT 1
- Add more tests HOT 1
- Add slick-migration-api in the slick3.2 version
- Don't swallow exceptions silently in `mg new s` HOT 4
- Scala 2.12 Support HOT 11
- Packaging up migrations HOT 16
- Scala-Forklift 0.3.0 for Scala 2.11
- Tests for cross Scala versions
- Provide SQL migration via SQL file HOT 5
- Make `APIMigration` the subtype of `slick.migration.api.Migration`
- mg reset fails due to constraints HOT 4
- [Feature] maybeInit HOT 1
- SlickMigrationManager not very modular HOT 1
- Support Slick 3.3.0 HOT 2
- Scala 2.13 Support HOT 3
- [Help] Running multiple migratedb tool in parallel HOT 4
- Slick 3.4.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scala-forklift.