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

How to handle migrations selda #171

Open
tonyalaribe opened this issue Oct 1, 2021 · 2 comments
Open

How to handle migrations selda #171

tonyalaribe opened this issue Oct 1, 2021 · 2 comments

Comments

@tonyalaribe
Copy link

Is there any examples on how to work with or create migrations in selda?

The migration section of the selda documentation is TBA, so I have no idea how to do this.
I'm relatively new to Haskell, so some code examples could be really helpful.

@tonyalaribe
Copy link
Author

One more question, sometimes it's helpful to fallback to writing raw SQL. Especially on complex larger queries. How can I execute such raw SQL strings with selda? Is there an escape hatch for this?

@peacememories
Copy link

This would interest me also. I see that there is utilities for migrating one table to another, this, for one, only covers single table conversions, but more pressingly would require me to keep every version of my data model somewhere in my codebase.

The most preferable way for me would be:

  • Have a serializable data type for defining migrations
  • Have a function that can create this data type based on previous migration data and a set of tables
  • Have a function that can take a list of these migration types and perform up and down migrations
  • Have some tools on top of this that actually write files to disk and search directories

Most migration systems I know store their current migration state in a separate table in the database.

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

No branches or pull requests

2 participants