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

[suggestion] What to do when no. of migrations gets very large #314

Closed
derekdreery opened this Issue May 1, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@derekdreery
Contributor

derekdreery commented May 1, 2016

I've used a framework before written in PHP that handles migrations in a slightly different way. In that system, you must keep an install.sql file up to date with the latest version of the db, and then add extra migrations with db_version to migrate. This has the advantage that if you have many, many migrations (this project is c. 10 years old - 1000s of migrations) you get a quicker initial install for new instances of the system. Is this an issue that needs to be thought about, or should applying lots of migrations on initialization never take too long?

Just to give an example of how this works, the migration file is like the following:

{
    "201501010030": "CREATE TABLE test ( .......",
    "201501021123": "ALTER TABLE test ADD ....."
}

and the install file is just flat sql.

@derekdreery

This comment has been minimized.

Contributor

derekdreery commented May 1, 2016

Related issue - it may be useful to group migrations into year-month to stop the folder getting too full.

@derekdreery derekdreery changed the title from [suggestion] What to do when migrations get very large to [suggestion] What to do when no. of migrations gets very large May 1, 2016

@sgrif

This comment has been minimized.

Member

sgrif commented May 2, 2016

Most backends provide some sort of a schema dump tool, which I think is the main path forward for something like that. I could see us potentially hooking into that with Diesel setup

@sgrif

This comment has been minimized.

Member

sgrif commented Dec 16, 2017

Going to close this, since it's not immediately actionable. I'm happy to consider a feature for this if an issue were to be opened with a concrete proposal on what the API for this would look like, and exactly what it would do.

@sgrif sgrif closed this Dec 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment