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

Clean up migrations #230

Open
CodyRichter opened this issue May 20, 2020 · 1 comment
Open

Clean up migrations #230

CodyRichter opened this issue May 20, 2020 · 1 comment
Assignees
Labels

Comments

@CodyRichter
Copy link
Member

Currently in dashboard, the migrations for the database have become bloated and difficult to handle. We should refactor these into a more usable form to coincide with our transition to PostgreSQL from SQLite.

@harsh183
Copy link

Is this much of an issue? I think this can get quite counterproductive and might break things.

Db migrations are like git commits for a schema of a database, and mostly you don't really need to actually read them unless you are looking for where a specific thing was added. Like git commit history, it's fine to leave them alone and the filenames have dates on them so they sort quite nicely.

If you're worried about the performance you should really use rake db:schema:load which loads your entire schema in one go instead of rake db:migrate which applies each migration one by one which takes quite a while considering the number of files here. See this article for some more detail on this.

A place where you can try this can be the rails Dockerfile replacing rake db:migrate with rake db:schema:load

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

No branches or pull requests

3 participants