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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zachdaniel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/120/31980_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zachdaniel
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Ash</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><img src="https://forum.elixirforum.com/images/emoji/apple/man_facepalming.png?v=15" title=":man_facepalming:" class="emoji" alt=":man_facepalming:" loading="lazy" width="20" height="20"> my <code>git push</code> failed and I didn’t notice. Try again</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="316512" 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/unknown-error-originaldatanotavailable-when-trying-to-create-a-update/61398/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-316512" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="316512"
                     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="316513" data-post-id="316513">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="drikanius" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/drikanius/120/33205_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  drikanius
                      <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">
								<aside class="quote group-Ash-Core-Team" data-username="zachdaniel" data-post="10" data-topic="61398">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/48/31980_2.png" class="avatar"> zachdaniel:</div>
<blockquote>
<p>mix deps.update ash_postgres</p>
</blockquote>
</aside>
<p>Real-time support <img src="https://forum.elixirforum.com/images/emoji/apple/man_surfing.png?v=15" title=":man_surfing:" class="emoji" alt=":man_surfing:" loading="lazy" width="20" height="20"> <img src="https://forum.elixirforum.com/images/emoji/apple/man_surfing.png?v=15" title=":man_surfing:" class="emoji" alt=":man_surfing:" loading="lazy" width="20" height="20"> <img src="https://forum.elixirforum.com/images/emoji/apple/man_surfing.png?v=15" title=":man_surfing:" class="emoji" alt=":man_surfing:" loading="lazy" width="20" height="20"></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">✗ mix compile                 
==&gt; ash_postgres
Compiling 45 files (.ex)
      error: undefined variable "keys"
      │
 2145 │         Ecto.Changeset.unique_constraint(changeset, keys, opts)
      │                                                     ^^^^
      │
      └─ lib/data_layer.ex:2145:53: AshPostgres.DataLayer.add_unique_indexes/3


== Compilation error in file lib/data_layer.ex ==
** (CompileError) lib/data_layer.ex: cannot compile module AshPostgres.DataLayer (errors have been logged)

could not compile dependency :ash_postgres, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile ash_postgres --force", update it with "mix deps.update ash_postgres" or clean it with "mix deps.clean ash_postgres"
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="316513" 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/unknown-error-originaldatanotavailable-when-trying-to-create-a-update/61398/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-316513" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="316513"
                     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="316516" data-post-id="316516">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zachdaniel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/120/31980_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zachdaniel
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Ash</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>okay, this time for real <img src="https://forum.elixirforum.com/images/emoji/apple/crying_cat_face.png?v=15" title=":crying_cat_face:" class="emoji" alt=":crying_cat_face:" 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="316516" 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/unknown-error-originaldatanotavailable-when-trying-to-create-a-update/61398/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-316516" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="316516"
                     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="316517" data-post-id="316517">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="drikanius" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/drikanius/120/33205_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  drikanius
                      <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>Yay! At least now the error has changed (printing debug just because):</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">[debug] QUERY OK source="transactions" db=2.1ms
INSERT INTO "carbonite_default"."transactions" ("meta","inserted_at") VALUES ($1,$2) ON CONFLICT ("id") DO UPDATE SET "id" = EXCLUDED."id" RETURNING "inserted_at","meta","xact_id","id" [%{type: "update_view_count", actor: nil}, ~U[2024-02-01 20:22:04.037630Z]]
[debug] QUERY OK db=0.2ms
rollback []
** (Ash.Error.Unknown) Unknown Error

* ** (KeyError) key :resource not found in: #Ecto.Changeset&lt;
  action: nil,
  changes: %{updated_at: ~U[2024-02-01 20:22:04.040457Z], view_count: 1},
  errors: [],
  data: #Marketplace.Markets.Property&lt;&gt;,
  valid?: true
&gt;
  (ash_postgres 1.4.0) lib/data_layer.ex:2120: AshPostgres.DataLayer.add_unique_indexes/3
  (ash_postgres 1.4.0) lib/data_layer.ex:1736: AshPostgres.DataLayer.ecto_changeset/5
  (ash_postgres 1.4.0) lib/data_layer.ex:2330: AshPostgres.DataLayer.update/2
  (ash 2.18.1) lib/ash/actions/update/update.ex:366: anonymous fn/5 in Ash.Actions.Update.commit/3
  (ash 2.18.1) lib/ash/changeset/changeset.ex:2823: Ash.Changeset.run_around_actions/2
  (ash 2.18.1) lib/ash/changeset/changeset.ex:2406: anonymous fn/3 in Ash.Changeset.with_hooks/3
  (ecto_sql 3.11.1) lib/ecto/adapters/sql.ex:1358: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
  (db_connection 2.6.0) lib/db_connection.ex:1710: DBConnection.run_transaction/4
  (ash 2.18.1) lib/ash/changeset/changeset.ex:2404: anonymous fn/3 in Ash.Changeset.with_hooks/3
  (ash 2.18.1) lib/ash/changeset/changeset.ex:2543: anonymous fn/2 in Ash.Changeset.transaction_hooks/2
  (ash 2.18.1) lib/ash/changeset/changeset.ex:2385: Ash.Changeset.with_hooks/3
  (ash 2.18.1) lib/ash/actions/update/update.ex:289: Ash.Actions.Update.commit/3
  (ash 2.18.1) lib/ash/actions/update/update.ex:176: Ash.Actions.Update.do_run/4
  (ash 2.18.1) lib/ash/actions/update/update.ex:135: Ash.Actions.Update.run/4
  (marketplace 1.19.0) lib/marketplace/markets.ex:1: Marketplace.Markets.update/2
  (stdlib 5.0.2) erl_eval.erl:746: :erl_eval.do_apply/7
  (elixir 1.16.0) src/elixir.erl:378: :elixir.eval_forms/4
  (elixir 1.16.0) lib/module/parallel_checker.ex:112: Module.ParallelChecker.verify/1
  (iex 1.16.0) lib/iex/evaluator.ex:331: IEx.Evaluator.eval_and_inspect/3
  (iex 1.16.0) lib/iex/evaluator.ex:305: IEx.Evaluator.eval_and_inspect_parsed/3
  (iex 1.16.0) lib/iex/evaluator.ex:294: IEx.Evaluator.parse_eval_inspect/4
  (iex 1.16.0) lib/iex/evaluator.ex:187: IEx.Evaluator.loop/1
  (iex 1.16.0) lib/iex/evaluator.ex:32: IEx.Evaluator.init/5
  (stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
    (ash_postgres 1.4.0) lib/data_layer.ex:2120: AshPostgres.DataLayer.add_unique_indexes/3
    (ash_postgres 1.4.0) lib/data_layer.ex:1736: AshPostgres.DataLayer.ecto_changeset/5
    (ash_postgres 1.4.0) lib/data_layer.ex:2330: AshPostgres.DataLayer.update/2
    (ash 2.18.1) lib/ash/actions/update/update.ex:366: anonymous fn/5 in Ash.Actions.Update.commit/3
    (ash 2.18.1) lib/ash/changeset/changeset.ex:2823: Ash.Changeset.run_around_actions/2
    (ash 2.18.1) lib/ash/changeset/changeset.ex:2406: anonymous fn/3 in Ash.Changeset.with_hooks/3
    (ecto_sql 3.11.1) lib/ecto/adapters/sql.ex:1358: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
    (db_connection 2.6.0) lib/db_connection.ex:1710: DBConnection.run_transaction/4
    (ash 2.18.1) lib/ash/changeset/changeset.ex:2404: anonymous fn/3 in Ash.Changeset.with_hooks/3
    (ash 2.18.1) lib/ash/changeset/changeset.ex:2543: anonymous fn/2 in Ash.Changeset.transaction_hooks/2
    (ash 2.18.1) lib/ash/changeset/changeset.ex:2385: Ash.Changeset.with_hooks/3
    (ash 2.18.1) lib/ash/actions/update/update.ex:289: Ash.Actions.Update.commit/3
    (ash 2.18.1) lib/ash/actions/update/update.ex:176: Ash.Actions.Update.do_run/4
    (ash 2.18.1) lib/ash/actions/update/update.ex:135: Ash.Actions.Update.run/4
    (marketplace 1.19.0) lib/marketplace/markets.ex:1: Marketplace.Markets.update/2
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="316517" 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/unknown-error-originaldatanotavailable-when-trying-to-create-a-update/61398/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-316517" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="316517"
                     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="316518" data-post-id="316518">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zachdaniel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/120/31980_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zachdaniel
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Ash</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>          <a href="https://media4.giphy.com/media/efNxYoJxgusMQOgVql/giphy.gif" target="_blank" rel="noopener nofollow ugc" class="onebox">
            <img src="https://media4.giphy.com/media/efNxYoJxgusMQOgVql/giphy.gif" width="480" height="196">
          </a>
</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="316518" 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/unknown-error-originaldatanotavailable-when-trying-to-create-a-update/61398/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-316518" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="316518"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 2 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="316520" data-post-id="316520">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zachdaniel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/120/31980_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zachdaniel
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Ash</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Not normally this all over the place, but I’m presently working on about 6 different things. Sorry bout that <img src="https://forum.elixirforum.com/images/emoji/apple/laughing.png?v=15" title=":laughing:" class="emoji" alt=":laughing:" 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="316520" 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/unknown-error-originaldatanotavailable-when-trying-to-create-a-update/61398/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-316520" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="316520"
                     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 #16"></div>
  </section>
</div>
    <div class="postbit" id="316521" data-post-id="316521">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="drikanius" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/drikanius/120/33205_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  drikanius
                      <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>No problem sr. If I’m bothering you, I can go back to the stable version. I’m only using <code>main</code> because I had the problem with 2 databases and migration was crazy.</p>
<p>But I think now we get back to the prevous error:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">** (Ash.Error.Unknown) Unknown Error

* ** (FunctionClauseError) no function clause matching in Ecto.Changeset.unique_constraint/3
  (ecto 3.11.1) Ecto.Changeset.unique_constraint(#Ecto.Changeset&lt;action: nil, changes: %{updated_at: ~U[2024-02-01 20:31:08.375531Z], view_count: 1}, errors: [], data: #Marketplace.Markets.Property&lt;&gt;, valid?: true&gt;, [], [name: "properties_normalized_full_address_gin_trgm_ops"])
  (elixir 1.16.0) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3
  (ash_postgres 1.4.0) lib/data_layer.ex:2152: AshPostgres.DataLayer.add_unique_indexes/3
  (ash_postgres 1.4.0) lib/data_layer.ex:1736: AshPostgres.DataLayer.ecto_changeset/5
  (ash_postgres 1.4.0) lib/data_layer.ex:2330: AshPostgres.DataLayer.update/2
  (ash 2.18.1) lib/ash/actions/update/update.ex:366: anonymous fn/5 in Ash.Actions.Update.commit/3
  (ash 2.18.1) lib/ash/changeset/changeset.ex:2823: Ash.Changeset.run_around_actions/2
  (ash 2.18.1) lib/ash/changeset/changeset.ex:2406: anonymous fn/3 in Ash.Changeset.with_hooks/3
  (ecto_sql 3.11.1) lib/ecto/adapters/sql.ex:1358: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
  (db_connection 2.6.0) lib/db_connection.ex:1710: DBConnection.run_transaction/4
  (ash 2.18.1) lib/ash/changeset/changeset.ex:2404: anonymous fn/3 in Ash.Changeset.with_hooks/3
  (ash 2.18.1) lib/ash/changeset/changeset.ex:2543: anonymous fn/2 in Ash.Changeset.transaction_hooks/2
  (ash 2.18.1) lib/ash/changeset/changeset.ex:2385: Ash.Changeset.with_hooks/3
  (ash 2.18.1) lib/ash/actions/update/update.ex:289: Ash.Actions.Update.commit/3
  (ash 2.18.1) lib/ash/actions/update/update.ex:176: Ash.Actions.Update.do_run/4
  (ash 2.18.1) lib/ash/actions/update/update.ex:135: Ash.Actions.Update.run/4
  (marketplace 1.19.0) lib/marketplace/markets.ex:1: Marketplace.Markets.update/2
  (stdlib 5.0.2) erl_eval.erl:746: :erl_eval.do_apply/7
  (elixir 1.16.0) src/elixir.erl:378: :elixir.eval_forms/4
  (elixir 1.16.0) lib/module/parallel_checker.ex:112: Module.ParallelChecker.verify/1
  (iex 1.16.0) lib/iex/evaluator.ex:331: IEx.Evaluator.eval_and_inspect/3
  (iex 1.16.0) lib/iex/evaluator.ex:305: IEx.Evaluator.eval_and_inspect_parsed/3
  (iex 1.16.0) lib/iex/evaluator.ex:294: IEx.Evaluator.parse_eval_inspect/4
  (iex 1.16.0) lib/iex/evaluator.ex:187: IEx.Evaluator.loop/1
  (iex 1.16.0) lib/iex/evaluator.ex:32: IEx.Evaluator.init/5
  (stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
    (ecto 3.11.1) Ecto.Changeset.unique_constraint(#Ecto.Changeset&lt;action: nil, changes: %{updated_at: ~U[2024-02-01 20:31:08.375531Z], view_count: 1}, errors: [], data: #Marketplace.Markets.Property&lt;&gt;, valid?: true&gt;, [], [name: "properties_normalized_full_address_gin_trgm_ops"])
    (elixir 1.16.0) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3
    (ash_postgres 1.4.0) lib/data_layer.ex:2152: AshPostgres.DataLayer.add_unique_indexes/3
    (ash_postgres 1.4.0) lib/data_layer.ex:1736: AshPostgres.DataLayer.ecto_changeset/5
    (ash_postgres 1.4.0) lib/data_layer.ex:2330: AshPostgres.DataLayer.update/2
    (ash 2.18.1) lib/ash/actions/update/update.ex:366: anonymous fn/5 in Ash.Actions.Update.commit/3
    (ash 2.18.1) lib/ash/changeset/changeset.ex:2823: Ash.Changeset.run_around_actions/2
    (ash 2.18.1) lib/ash/changeset/changeset.ex:2406: anonymous fn/3 in Ash.Changeset.with_hooks/3
    (ecto_sql 3.11.1) lib/ecto/adapters/sql.ex:1358: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
    (db_connection 2.6.0) lib/db_connection.ex:1710: DBConnection.run_transaction/4
    (ash 2.18.1) lib/ash/changeset/changeset.ex:2404: anonymous fn/3 in Ash.Changeset.with_hooks/3
    (ash 2.18.1) lib/ash/changeset/changeset.ex:2543: anonymous fn/2 in Ash.Changeset.transaction_hooks/2
    (ash 2.18.1) lib/ash/changeset/changeset.ex:2385: Ash.Changeset.with_hooks/3
    (ash 2.18.1) lib/ash/actions/update/update.ex:289: Ash.Actions.Update.commit/3
    (ash 2.18.1) lib/ash/actions/update/update.ex:176: Ash.Actions.Update.do_run/4
    (ash 2.18.1) lib/ash/actions/update/update.ex:135: Ash.Actions.Update.run/4
    (marketplace 1.19.0) lib/marketplace/markets.ex:1: Marketplace.Markets.update/2
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="316521" 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/unknown-error-originaldatanotavailable-when-trying-to-create-a-update/61398/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-316521" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="316521"
                     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 #17"></div>
  </section>
</div>
    <div class="postbit" id="316522" data-post-id="316522">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zachdaniel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/120/31980_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zachdaniel
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Ash</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Does your resource have a primary key?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="316522" 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/unknown-error-originaldatanotavailable-when-trying-to-create-a-update/61398/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-316522" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="316522"
                     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 #18"></div>
  </section>
</div>
    <div class="postbit" id="316523" data-post-id="316523">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="zachdaniel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/120/31980_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  zachdaniel
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Ash</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Where does this: <code>properties_normalized_full_address_gin_trgm_ops</code> come from? I’m assuming thats something you’ve added manually?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="316523" 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/unknown-error-originaldatanotavailable-when-trying-to-create-a-update/61398/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-316523" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="316523"
                     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 #19"></div>
  </section>
</div>
    <div class="postbit" id="316524" data-post-id="316524">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="drikanius" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/drikanius/120/33205_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  drikanius
                      <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>Well I was removing part of the code and miss-click, but yeah, properties_normalized_full_address_gin_trm_ops is a custom index</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Marketplace.Markets.Property do
  @moduledoc false

#  alias ...

  use Ash.Resource,
    data_layer: AshPostgres.DataLayer,
    authorizers: [Ash.Policy.Authorizer],
    extensions: [AshGraphql.Resource, AshRbac],
    notifiers: [Ash.Notifier.PubSub]

  require Ash.Query

  code_interface do
    define_for Marketplace.Markets

    # define ...
  end

  attributes do
    alias Marketplace.Ash.Types.Currency

    uuid_primary_key :id

    attribute :street, :string, allow_nil?: false
    attribute :house_number, :string, allow_nil?: false
    attribute :city, :string, allow_nil?: false
    attribute :county, :string, allow_nil?: false

    attribute :state, :string do
      allow_nil? false

      constraints max_length: 2, min_length: 2
    end

    attribute :zip, :string, allow_nil?: false

    attribute :country, :string do
      allow_nil? false

      default "USA"
    end
    

    attribute :normalized_full_address, :string, allow_nil?: false, generated?: true

    attribute :view_count, :integer, default: 0

    attribute :showing, Showing, allow_nil?: false, default: %{}

    attribute :over_under_paid, Currency

    attribute :adj_mao, Currency

    attribute :opened_at, :utc_datetime, default: &amp;DateTime.utc_now/0

    timestamps(private?: false)
  end

  calculations do
    alias Markets.Offer

    calculate :full_address,
              :string,
              expr(
                house_number &lt;&gt; " " &lt;&gt; street &lt;&gt; " - " &lt;&gt; city &lt;&gt; ", " &lt;&gt; state &lt;&gt; " - " &lt;&gt; zip
              )

    calculate :offeror_current_offer, Offer, Calculations.GetCurrentOfferor

    calculate :favorite?,
              :boolean,
              expr(
                exists(property_user_activities, user_id == ^actor(:id) and favorited? == true)
              )

    calculate :total_unique_offers, Offer, Calculations.TotalUniqueOffers
  end

  preparations do
    prepare build(load: [:full_address, :favorite?])
  end

  aggregates do
    first :last_offer, :offers, :updated_at do
      sort updated_at: :desc
    end

    count :total_valid_offer, :offers do
      filter expr(status in [:submitted, :evaluating, :accepted])
    end

    count :favorite_count, :user_activities

    count :total_offers, :offers do
      filter expr(status in [:submitted, :evaluating, :accepted])
    end

    max :max_offer, :offers, :price do
      filter expr(status in [:submitted, :evaluating, :accepted])
    end
  end

  relationships do
    alias Markets.{Offer, Organization, PropertyUserActivity, User}

    has_many :offers, Offer

    belongs_to :disposition_agent, User do
      allow_nil? true
      attribute_writable? true
    end

    belongs_to :organization, Organization do
      allow_nil? false
      attribute_writable? true
    end

    many_to_many :user_activities, User do
      through PropertyUserActivity

      join_relationship :property_user_activities

      source_attribute_on_join_resource :property_id
      destination_attribute_on_join_resource :user_id
    end
  end

  rbac do
   #...
  end

  policies do
    #...
  end

  changes do
    alias Marketplace.Common.Property.Actions.Changes

    change {Marketplace.Ash.Changes.Audit, meta: %{actor: actor(:id)}},
      on: [:create, :update, :destroy]

    change Actions.Common.Changes.SendTelemetryEvent,
      on: [:create, :update, :destroy]

    change Changes.CalculateOverUnderPaid, on: [:create, :update, :destroy]
  end

  graphql do
    type :property

    field_names favorite?: :is_favorite

    queries do
      get :get_valid_property, :get_valid

      list :list_valid_properties, :read_valids

      list :list_favorites, :list_user_favorites
    end

    mutations do
      update :set_as_favorite, :set_as_favorite

      update :remove_from_favorite, :remove_from_favorite
    end
  end

  pub_sub do
    module MarketplaceWeb.Endpoint

    prefix "property"

    publish :update, [:id], event: "property_updated"
    publish :update_images, [:id], event: "property_updated"
  end

  postgres do
    table "properties"

    repo Marketplace.Repo

    migration_defaults images: "[]", metadata: "%{}", showing: "%{}"

    migration_ignore_attributes [:normalized_full_address]

    custom_indexes do
      index ["normalized_full_address gin_trgm_ops"],
        using: "gin",
        name: "properties_normalized_full_address_gin_trgm_ops"

      index [:view_count]
    end

    custom_statements do
      statement :create_normalized_full_address_field do
        up """
        alter table properties add column normalized_full_address varchar (255) generated always as
        (
          lower(
            btrim(
              regexp_replace(
                coalesce(house_number, '') || ' ' ||
                coalesce(street, '') || ' ' ||
                coalesce(city, '') || ' ' ||
                coalesce(county, '') || ' ' ||
                state || ' ' ||
                country || ' ' ||
                coalesce(zip, ''),
                '\\s+', ' ', 'g'
              )
            )
          )
        )
        stored;
        """

        down "alter table properties drop column normalized_full_address;"
      end
    end
  end

  actions do
    alias Marketplace.Markets.Common.Changelog

    defaults [:read]

    create :create do
      alias Actions.Create.Changes

      primary? true

      argument :uploaded_images, {:array, :map}, allow_nil?: false
      argument :removed_images, {:array, :map}, allow_nil?: false

      argument :disposition_agent, :uuid, allow_nil?: false

      change Changes.MaybeCreateProcessImagesJob

      change Changes.MaybeIgnoreOffMarket

      change Changes.AddOrganizationFromActor

      change Changes.AddDispositionAgent

      change load([:full_address, :last_offer, :total_valid_offer])
    end

    update :update do
      alias Actions.Update.{Changes, Validations}

      primary? true

      argument :uploaded_images, {:array, :map}, allow_nil?: false, default: []
      argument :removed_images, {:array, :map}, allow_nil?: false, default: []

      argument :disposition_agent, :uuid, allow_nil?: true

      validate Validations.IsNotProcessing

      change Changes.MaybeCreateProcessImagesJob

      change Changes.MaybeIgnoreOffMarket

      change Changes.MaybeUpdateProForma

      change Changes.MaybeUpdateOverUnderPaid

      change Changes.AddDispositionAgent

      change load([:full_address, :last_offer, :total_valid_offer])
    end

    update :update_view_count do
      argument :view_count, :integer, allow_nil?: false

      change set_attribute(:view_count, arg(:view_count))
    end

  end
end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="316524" 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/unknown-error-originaldatanotavailable-when-trying-to-create-a-update/61398/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-316524" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="316524"
                     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 #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/61398/load_more?page=3">Load more posts</a>
</div></template></turbo-stream>