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

Evolute 'default' database by default. #451

Closed
wants to merge 2 commits into from
Closed

Conversation

Kicey
Copy link

@Kicey Kicey commented Nov 20, 2023

The application doesn't create the 'default' database by default. So, I need add the evolution configuration.
If there is a better way, just tell me.

@mkurz
Copy link
Member

mkurz commented Nov 21, 2023

The application doesn't create the 'default' database by default.

The Play evolutions module does not create a database for you (also not the Play jdbc module). You have to create the database yourself and then Play can connect to it and if you have evolutions enabled, then Play(-evolutions) will create necessary meta tables and will run the evolutions scripts you set up.

@Kicey
Copy link
Author

Kicey commented Nov 29, 2023

The application doesn't create the 'default' database by default.

The Play evolutions module does not create a database for you (also not the Play jdbc module). You have to create the database yourself and then Play can connect to it and if you have evolutions enabled, then Play(-evolutions) will create necessary meta tables and will run the evolutions scripts you set up.

I use the new config autoApply to replace the deprecated one(applyEvolutions.default), described as below:

    # Whether evolutions should be automatically applied.  In prod mode, this will only apply ups, in dev mode, it will
    # cause both ups and downs to be automatically applied.
    autoApply = false

(https://github.com/playframework/playframework/blob/18b6720d6a395f6a94b47804a3db5368cada44ef/persistence/play-jdbc-evolutions/src/main/resources/reference.conf#L29-L31)

@Kicey Kicey requested a review from mkurz December 4, 2023 10:48
@mkurz
Copy link
Member

mkurz commented Dec 13, 2023

@Kicey So I finally run the play-scala-anorm-example locally myself. What is the problem you trying to solve? When starting the application with sbt run and going to http://localhost:9000 in your browser, you will see a screen that asks you to run evolutions:
image

This is totally expected and how it should work.

Don't you see that page in your browser?

@Kicey
Copy link
Author

Kicey commented Dec 23, 2023

@Kicey So I finally run the play-scala-anorm-example locally myself. What is the problem you trying to solve? When starting the application with sbt run and going to http://localhost:9000 in your browser, you will see a screen that asks you to run evolutions: image

This is totally expected and how it should work.

Don't you see that page in your browser?

Since the behavior is expected (It's too much like an error interface.), I'll close the pr.

@mkurz
Copy link
Member

mkurz commented Jan 10, 2024

I will enhance the UI here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants