To support leveraging the same resource backed by multiple tables (useful for things like polymorphic associations), AshPostgres supports setting the `data_layer.table` context for a given resource. For this example, lets assume that you have a `MyApp.Post` resource and a `MyApp.Comment` resource. For each of those resources, users can submit `reactions`. However, you want a separate table for `post_reactions` and `comment_reactions`. You could accomplish that like so:
```elixir
defmodule MyApp.Reaction do
use Ash.Resource,
data_layer: AshPostgres.DataLayer
postgres do
polymorphic? true # Without this, `table` is a required configuration