erikbra / grate

grate - the SQL scripts migration runner
MIT License
209 stars 40 forks source link

Question - How to mark one-time migration as run #546

Closed mattjones0111 closed 5 months ago

mattjones0111 commented 5 months ago

When applying grate to an existing codebase which already has an established schema, I'd like to create an 'initial state' migration which contains the schema creation up to that point, but not actually run it at the next deploy. How do I create a migration but mark it as already executed?

erikbra commented 5 months ago

That would be exactly what the --baseline switch does

https://erikbra.github.io/grate/configuration-options/

mattjones0111 commented 5 months ago

Ah. It helps to RTFM I guess. Thank you for the pointer.

erikbra commented 5 months ago

The manual IS a bit F here and there, and not always as easy as it should be to understand. If you have some suggestions, they are more than welcome! Glad you're helped!