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

Added 2 new tasks for importing and exporting sql dump files. #216

Merged
merged 12 commits into from
Sep 13, 2019

Conversation

jwoertink
Copy link
Member

@jwoertink jwoertink commented Aug 16, 2019

Fixes #168

This adds in 2 new tasks.

  • lucky db.schema.restore path/to/sql_dump.sql
  • lucky db.schema.dump

These allow you to task a sql dump file and import your schema in the case you don't have migration files to run. Or you can create a dump file from your current schema that you can use to import later.

Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good so far. Can you ping me when you've got the spec ready to go?

@jwoertink
Copy link
Member Author

oh yeah, what did you want to do about that? Should I just get specs running outside of Docker? Or should I update the Dockerfile to install the latest pg client stuff?

@paulcsmith
Copy link
Member

@jwoertink Whichever is easiest. If you wanna remove Docker and just use Crystal on Travis then I'm cool with that too!

Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small comments. So stoked for this. This will be super helpful when migrations start getting huge. You can just dump the structure. Delete the migrations and start new migrations from that point on (at least I think that'll work)

spec/tasks/db_schema_dump_spec.cr Outdated Show resolved Hide resolved
src/avram/migrator/runner.cr Outdated Show resolved Hide resolved
src/avram/tasks/db/schema_restore.cr Outdated Show resolved Hide resolved
Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small comment! Looks awesome

spec/spec_helper.cr Outdated Show resolved Hide resolved
spec/tasks/db_schema_restore_spec.cr Show resolved Hide resolved
Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome! And nice find. I forgot about with_cleanup :P

@paulcsmith paulcsmith merged commit e197d27 into master Sep 13, 2019
@paulcsmith paulcsmith deleted the features/168 branch September 13, 2019 20:48
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

Successfully merging this pull request may close these issues.

Add new tasks for importing and exporting schema
2 participants