lagom-samples
lagom-samples copied to clipboard
Merge schemas?
I noticed that the deployment scripts for shopping cart were moved up a level, outside of the Java/Scala specific projects.
Should we do the same for the "schemas" directory?
https://github.com/lagom/lagom-samples/blob/1.5.x/shopping-cart/shopping-cart-java/schemas/shopping-cart.sql https://github.com/lagom/lagom-samples/blob/1.5.x/shopping-cart/shopping-cart-scala/schemas/shopping-cart.sql
(They're identical)
Yes, sure.
I think the best location is shopping-cart/deploy/scripts/sql/ (or ddl/). I'd also split and rename into write-side.sql and read-side.sql (or something like that).
Then, there's also some SQL for schema creation embedded in the .sh scripts.
@ignasi35 why do you think it's better to split into two files?
@ignasi35 why do you think it's better to split into two files?
I like having smaller, more clear pieces: a sql file for the journal and snapshots and another one for the offset store and, finally, the third one for user-provided tables. Then, if we think it's useful, a fourth one (preceding them all) to create the database schema(s).
This will be a pattern easy to reproduce in, for example, the mixed-persistence samples where read-side and write-side use different technologies.
Works for me. Any objections?
(I'm doing a revision of the deployment guide, so I'll sync that up with this.)
I'm fine with it.