<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="234923" data-post-id="234923">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kalkatfyodor" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kalkatfyodor
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks a lot. The only problem is that I already have Cars context and although it could look similar to you, the data stored there are very different - that is the reason for a different table name.</p>
<p>Could you try that again if you know this information? I mean only the shell commands themselves - you don’t have to write the description of each element.</p>
<p>Also, for <code>cars_from_alternative_universe</code> and <code>men_women_children</code> tables, please. Thank you in advance.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="234923" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/context-module-name-and-ecto-schema-module-name-for-more-than-one-word-database-tables/44396/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-234923" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="234923"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="234926" data-post-id="234926">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="pdgonzalez872" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/pdgonzalez872/120/28792_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  pdgonzalez872
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hi!</p>
<blockquote>
<p>The only problem is that I already have Cars context</p>
</blockquote>
<blockquote>
<p>Could you try that again if you know this information?</p>
</blockquote>
<p>Sure! Alright, so you want a different context name? You can give it a context name of your choice, you don’t need to use the same one:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">mix phx.gen.context KalkatfyodorAwesomeContextname CarAll cars_all model:string price:string
</code></pre>
<p>It’s good to play with the generators, they are very powerful.</p>
<blockquote>
<p>Also, for <code>cars_from_alternative_universe</code> and <code>men_women_children</code> tables</p>
</blockquote>
<p>Given what I shared above, what have you tried so far? Please share and we can discuss further.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="234926" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/context-module-name-and-ecto-schema-module-name-for-more-than-one-word-database-tables/44396/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-234926" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="234926"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="234928" data-post-id="234928">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kalkatfyodor" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kalkatfyodor
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<pre data-code-wrap="elixir"><code class="lang-elixir">mix phx.gen.context KalkatfyodorAwesomeContextname CarAll cars_all model:string price:string
</code></pre>
<p>That’s not what I want to find out. I am fully aware of the possibility of having a name for context that doesn’t resemble the schema and/or table name.</p>
<p>Can you try that with <code>cars_from_alternative_universe</code> and <code>men_women_children</code> tables? If it’s not possible, then OK, I will try to ask on SQL forums or something, but I would like to see how you (and others) reason and how you try make things as consistent and logical as possible - especially when it comes to Phoenix/Ecto conventions.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="234928" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/context-module-name-and-ecto-schema-module-name-for-more-than-one-word-database-tables/44396/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-234928" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="234928"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="234930" data-post-id="234930">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="pdgonzalez872" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/pdgonzalez872/120/28792_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  pdgonzalez872
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<blockquote>
<p>That’s not what I want to find out. I am fully aware of the possibility of having a name for context that doesn’t resemble the schema and/or table name.</p>
</blockquote>
<p><img src="https://forum.elixirforum.com/images/emoji/apple/+1.png?v=15" title=":+1:" class="emoji only-emoji" alt=":+1:" loading="lazy" width="20" height="20"></p>
<blockquote>
<p>Can you try that with <code>cars_from_alternative_universe</code> and <code>men_women_children</code> tables? If it’s not possible, then OK, I will try to ask on SQL forums or something</p>
</blockquote>
<p>I think this is beyond me at this time. Please go ahead and ask in the SQL forums. After you do, do you mind reporting back? I’d love to know how you solved this when you do. Thanks!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="234930" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/context-module-name-and-ecto-schema-module-name-for-more-than-one-word-database-tables/44396/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-234930" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="234930"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="234942" data-post-id="234942">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kalkatfyodor" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kalkatfyodor
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>OK, thank you anyway. Also, it would be interesting to hear Chris or some other Phoenix heavyweights on this topic and how would they solve this task <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="234942" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/context-module-name-and-ecto-schema-module-name-for-more-than-one-word-database-tables/44396/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-234942" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="234942"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="235079" data-post-id="235079">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="John-Goff" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/John-Goff/120/19768_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  John-Goff
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Alright I’ll bite. So first off, let’s just establish that one single context can have more than one schema inside of it. So if you already have</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">mix phx.gen.context Cars Car car....
</code></pre>
<p>Now your application needs to deal with cars that come from an alternate universe, which have enough different details that you want to keep them in a different table, but they’re similar enough to our dimensional cars that you still want to use the Cars module to manage them. You could then do</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">mix phx.gen.context Cars CarFromAlternativeUniverse cars_from_alternative_universe...
</code></pre>
<p>OK, so what about your other example? Let’s say you now need to track who bought your cars, you could do</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">mix phx.gen.context Purchaser ManWomanChild men_women_children...
</code></pre>
<p>Now it’s also possible to have two schemas in two different contexts refer to the same database table. Let’s say our car application also wants to know, in addition to who purchased the car, who is the riders in the car for any given trip. We could create a <code>Riders</code> context to handle all the logic around tracking riders, and then do</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">mix phx.gen.context Riders ManWomanChild men_women_children...
</code></pre>
<p>This now creates a new context which has a schema which refers to the same table that we created before. You can have some of the fields on the table exposed in the Purchaser schema, and some in the Riders schema. Your schema doesn’t need to have all of the fields that the table has. You can also safely refer to the same database fields from both the Riders and Purchaser schema.</p>
<p>Hope this helps! I’m still not certain on what exactly database structure you had in mind, so I’m not sure where <code>cars_all</code> would fit in, but hopefully you can see how the schema, context, and database all relate from these examples.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="235079" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/context-module-name-and-ecto-schema-module-name-for-more-than-one-word-database-tables/44396/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-235079" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="235079"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-solved cat-solved" title="Marked as solution"></div>
  </section>
</div>
    <div class="postbit" id="235085" data-post-id="235085">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kalkatfyodor" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kalkatfyodor
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thank you. A nice explanation. Especially with the two contexts for the same table. I didn’t know about that.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="235085" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/context-module-name-and-ecto-schema-module-name-for-more-than-one-word-database-tables/44396/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-235085" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="235085"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>