-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
db migrate should also run db structure dump #74
Comments
@timriley From this placeholder, it isn't easy to guess. If you're looking for We had
https://guides.hanamirb.org/v1.3/command-line/database/#apply |
Ah, I wasn't aware of However, I'd still be keen to learn why you're not in favour of dumping the schema after migrating. From my perspective, there's a few reasons for it:
Personally, if we didn't offer this "dump on migrate"-style behaviour, I'd need to somehow find a way to ensure "db migrate" and "db structure dump" are always run together in my projects, either via an extra Lastly, I'd actually be concerned to run that Keen to hear your thoughts! |
This definitely caught me by surprise! I thought I'd misconfigured ROM. For now I made it work like this for my app: class MigrateAndStructureDump < Hanami::CLI::Commands::App::DB::Migrate
def call(**options)
super
Hanami::CLI::Commands::App::DB::Structure::Dump.new.call
end
end
Hanami::CLI.tap do |cli|
cli.register "db migrate", MigrateAndStructureDump |
I'd agree that dumping or applying the latest migration to update the schema is a good convention to carry over. I've found myself drudging into the depths of manually dumping Postgres DDLs in projects that don't offer this type of tooling just so I can quickly get a CI environment loaded, or even to set up a blank slate local test db on team development machines when there are years of (yet-to-be rolled up) migrations to go through just to get a dev environment going. It seems reasonable to make this an opt-out behavior however, since some folks may have no use for the schema? |
No description provided.
The text was updated successfully, but these errors were encountered: