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

Merge schemas? #78

Open
TimMoore opened this issue Jul 11, 2019 · 6 comments
Open

Merge schemas? #78

TimMoore opened this issue Jul 11, 2019 · 6 comments

Comments

@TimMoore
Copy link

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)

@octonato
Copy link
Member

Yes, sure.

@ignasi35
Copy link
Contributor

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.

@TimMoore
Copy link
Author

@ignasi35 why do you think it's better to split into two files?

@ignasi35
Copy link
Contributor

@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.

@TimMoore
Copy link
Author

Works for me. Any objections?

(I'm doing a revision of the deployment guide, so I'll sync that up with this.)

@octonato
Copy link
Member

I'm fine with it.

@settings settings bot removed the shopping-cart label Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants