Phx.gen.schema help. Period vs Space between context name and table name

Hi guys. I read the doc and currently reading programming phoenix >= 1.4 and I couldn’t find the answer.

What’s the difference between:

mix phx.gen.schema Multimedia.Category categories name:string

mix phx.gen.html Multimedia Video videos user_id:references:users url:string title:string description:text

Notice the first one the context and the module name is separated by a space.

The second command line the context and the module name is separated by a period.

The documentation on this command is a bit sparse. The context section is talking about OTP (which I haven’t learn yet).

From my understanding it’s context name, module/table name that will be put under the context folder, table name plural and then the table fields and types. I hope this is correct. I’m just confused on period vs space.

Thank you for your time!

2 Likes

This is generating ‘just’ a schema, so you completely define the name, the Multimedia.Category above.

This is generating multiple modules, thus it asks for the base context Multimedia and the name of the schema/controller/view/etc, Video here.

2 Likes

Thank you so much, I missed the .html .schema part. Guess I’m getting old. >___< Thanks again!

1 Like

Happens to us all, by far. ^.^;