selda
selda copied to clipboard
How to handle migrations selda
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.
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?
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.