When I started my project, I was following two courses that used the following to set up a new project:
mix phx.new project_name --live mix phx.gen.context Accounts User users name:string age:integer mix ecto.migrate
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.