I am using http://rails-erd.rubyforge.org/ to generate an ERD - the output is a very nice diagram of my project's object model. There is also a rake task to generate the ERD, generate_erd, that I would like to have invoked automatically after I run rake db:migrate. How do I do that?
Regenerate ERD after rake db:migrate
432 Views Asked by Marek Příhoda At
1
There are 1 best solutions below
Related Questions in RUBY-ON-RAILS
- How to display legend box in tooltip text for amCharts 5 in Rails application?
- how to integrate cashfree payment gateway in ruby on rails project
- RSpec Capybara throwing Selenium error when trying to click a button with browser confirm
- rails minitest not picking up fixture properly, instance variable not percolating
- Duplicate GET requests - Rails & Heroku
- How to stub out current_user in JWT model for Rspec?
- NameError in Home#index
- Verifying Google Identity OAuth2 token with Ruby
- Error WebMock::NetConnectNotAllowedError in testing with stub using minitest in rails (using Faraday)
- why is mission_control-jobs erroring with load path error?
- Rescuing validation errors from a polymorphic association
- New error on random number assigned to local variable , Rails
- How to fix error in model with gem lockbox
- Images uploaded via Active Storage not displaying in Active Admin or on certain devices
- controller test_methods generating two errors intermittently
Related Questions in RUBY
- how to integrate cashfree payment gateway in ruby on rails project
- RSpec Capybara throwing Selenium error when trying to click a button with browser confirm
- Duplicate GET requests - Rails & Heroku
- convert csv file with json data inside to a column, rows table in 2nd csv file
- Installing dependencies from a gemspec file
- Verifying Google Identity OAuth2 token with Ruby
- Java code of AES/GCM/NoPadding encryption algorithm with authentication tag
- How to fix error in model with gem lockbox
- Cannot install Ruby Gem on Window
- use logstash filter ,aes gcm encrypted in ruby,but cannot decrypted in java
- In Rails 7, what is the right ActiveRecord callback to use if I need to prevent (or rollback) persistance on error?
- How can I go through an array and still remove elements from it
- Nokogiri only returning 5 results
- How do I get the fullscreen mode in firefox?
- undefined group option when using branch reset group regex in Ruby
Related Questions in RAILS-MIGRATIONS
- How does the Rails migration `change` method reverse its operations?
- The edits to Rails models, generated in Docker, do not update in Docker when migrating
- Updating existing column in Rails table to be foreign key to another table
- how to resolve pending migration error in rails 7
- Faster way to copy a large PostgreSQL table into a new table with Ruby on Rails migrations
- How to deal with failed migrations during deployment in Rails?
- Schema options being changed after migration
- What should I do when my migration references a nonexistent class?
- Multiple Column Foreign Key Ruby on Rails
- Can I change how Rails creates migrations
- ActiveRecord without Rails: Can't run migrations
- How to set references in Rails when using custom primary keys
- Add timestamps to existing table in db Ruby on Rails using rails g migration
- How to add a string with a literal backslash in mysql, using ruby/rails migrations?
- Rails migration to modify some values not working
Related Questions in ERD
- Moodle Database - Reverse Engineering ERD
- An associative Entity with optional participation on one side and mandatory participation on the other
- ER diagroms Composite Key representation in m;n relationship
- How to specify relation based on a condition in Entity Relationship Diagram (ERD)?
- Is there any identifying or non-Identifying relationship in this ERD?
- Which Lucidchart license is required for import data to directly get metadata from database to create ERD?
- erd diagram Car buying and selling website
- is it allowed to leave an attribute empty in the Entity–relationship model?
- One to many relationship in Product Ordering System with Crow's Foot Notation
- Can an Identifying relationship be one-to-one?
- How to model a complex relationship involving a Weak Entity and entities related to its parents?
- Mermaid Entity-Relationship diagram in top-down layout
- Relations between entities in ER diagram: can they have a key?
- Total Disjoint vs U-type in EERD
- Do Entity-Relationship diagrams need attributes to represent relationships?
Related Questions in DIAGRAMMING
- How can I dynamically apply different visual representation for the same Element in JointJS
- Display mindfusion diagram as a image
- Anchor node to a subgraph in Mermaid
- Object oriented modeling and UML for agile development
- Can Apache nifi be used as an application server?
- Activity Recognition Api Diagram
- Can attributes be used with entitiy titles on data flow diagrams?
- Are you modeling or drawing? in uml
- Diagraming MS Office Object Models
- draw2d touch (js) rotate ports and bounding box with figure
- Diagraming tool from text that links to properties
- How to generate an editable diagram from SQL file?
- Jointjs with TogetherJs
- Data model. ¿Pluralize or not pluralize the names of the tables?
- Intellij Idea Missing Diagram Context Menu
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The given link by @MaxWilliams is a helpful but I don't think any of those answers quite do what you want. I found this article on Rake Task Overwriting. It's from 2008, but I tried this out and it worked.
I created another .rake file (for organization) and just happened to call mine
migrate_and_generate_erb.rakebut name it whatever you want.Inside I just had this:
Basically, according to the article, Rake just keeps appending code implementation to the task if it's already defined.
Now running
rake db:migratealso generated me my ERD.Careful: You'll also want to do the same for
db:rollbackso that rolling back a migration also updates your ERD.One last note: consider also just aliasing this (shell command), just in case you'd ever want to run the migrate without generate the ERD, or use environment variables along with your new Rake task.