Ability to export migrations as database-specific DDL? #2015
Replies: 3 comments
-
Migrations (a change from version N to version N+1 and vise-versa) and dumps (schema dumps? current schema at the moment. or data dumps?) are different things. Please clearify what do you want, what use case is it. For example, for PostgreSQL dumps (schema or data) it's better to use |
Beta Was this translation helpful? Give feedback.
-
You can setup a database logger, and take the logged SQL generated by the migration, and reuse it later. Depending on the migration, you could use a mock database for the given database type. Note that that will not work for all migrations, as some migrations need to read current database schema or data in order to work. |
Beta Was this translation helpful? Give feedback.
-
@jeremyevans @AlexWayfer thanks! I'll dig around further and see if there is a path forward. Use case is very niche, generating DDL to migrate both an iOS and server side app (sqlite on client, postgres on server). They both share nearly identical schemas. |
Beta Was this translation helpful? Give feedback.
-
This is quite out of the scope of the project, but thought I'd ask anyways.
Is there any easy way one could export Sequel migrations as database-specific DDL? It'd be nice to dump them as plain ole SQL to be run at a later date.
I couldn't see anything in the documentation -- presume I may just have to go digging into the source and manually find a way though.
Beta Was this translation helpful? Give feedback.
All reactions