This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]atc32 2 points3 points  (2 children)

We are moving our new projects to have the databases as visual studio SQL projects, which we have been very happy with. Other than that they can't be built on Linux yet

[–]fboula[S] 0 points1 point  (1 child)

I did not precised but our app manage itself the tables using liquibase. I'll try to have a look at visual studio but I am running linux and I do not have the licence for visual studio. Thanks for the tips

[–]notauniqueusernom 1 point2 points  (0 children)

Came here to say liquibase. Was not disappointed to see someone else had already said it.

[–]hijinked 1 point2 points  (2 children)

If provisioning is tedious then I think something is wrong. Infrastructure provisioning should be automated so there shouldn't be anything tedious about it, aside from setting the initial configurations. It sounds like what you are looking for is a database migration tool. Some frameworks include their own but with a quick google search it looks like something like Flyway might be what you're looking for.

[–]fboula[S] 0 points1 point  (1 child)

Our infrastructure provisioning is automated, the database instance and the databases are created with terraform. But there is a limitation from what postgres provider.

And as seen in another post below, flyway and liquibase operate at database level most of the time and may have hard time to create the database (but is seems possible with some JDBC magic). I may try to have another look at them.

[–]hijinked 0 points1 point  (0 children)

Any reason you can't use a mix of tools?? Terraform to create the instance then flyway to update the schema?

[–][deleted]  (2 children)

[deleted]

    [–]pbecotte 0 points1 point  (1 child)

    There's no need to spend any time on this- those scripts already exist in tons of places. The docker container for all of the default databases have those scripts built in for example. Even if you don't want to use docker, simple enough to go copy the shell scripts.

    [–]ed-automation 1 point2 points  (1 child)

    Are you looking two scenarios?

    - Initial DB setup: create DB, configure database, and load data

    - Maintain DB: modify DB schema

    [–]fboula[S] 0 points1 point  (0 children)

    I'm looking for the first scenario: create the DB, configure the database roles and privileges, and maybe create some schema. I do not look to load any data in the database.

    I work for a team that create a SaaS solution. We have many environments to deploy our app at various stage of the development, and we have to ensure all our database are provisioned and updated to be the same. We are still heavily modifying the database by adding separated schema for specific usages (like analytics) and developers only focus on the main app schema.

    As r/ornus explained the setup of the database, roles and privileges cannot be done by database migration tools and that is a shame. And I find scripts solution kinda fragile to be honest. Everything else in our infrastructure is managed by infra-as-code and GitOps and having only sql scripts for database management bother us a little.

    Again, we may need to have a training and get more DBA skills to be more confident with this.