I’ve now added a lot of code to my context, schema and .leex files to get all of my relationships to work. I don’t want to lose this code! BUT … I’ve been reading the Programming Phoenix Liveview book by Tate & DeBenedetto and I’ve realized that I should have used mix phx.gen.live in order to get LiveView code and templates generated for me (eg index_live.ex, form_component.ex, modal_component.ex, etc).
Can I safely run the following to get the templates but NOT touch my context and schemas: mix phx.gen.live --no-context --no-schema
OR … should I set up a second dummy directory and completely rerun my project using mix phx.gen.live and then copy over the template files that I didn’t get using phx.gen.context. My only concern about doing this is that I don’t know if phx.gen.live is inserting code in files that I might not see.
Are you using git or other source control? If so, just run it (after a commit) and use your tool of choice to inspect the differences. If you don’t like what you see, you can easily revert they changes.
Good idea! I am using git, although I’m learning Elixir, Ecto, Phoenix and git all at once. I’m on a bit of a steep learning curve. That said, I think I’ve figured out how I can diff the files using git and Visual Studio. Thanks for the idea!