Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Composite Primary Key watcher fails #47

@dv01sw

Description

@dv01sw

In my application.ex:

  {EctoWatch,
   repo: Bla.Repo,
   pub_sub: Bla.PubSub,
   watchers: [
     {Bla.Things, :inserted}
   ]},

In my schema:

  @primary_key false
  schema "things" do
    field :timestamp, :utc_datetime, primary_key: true
    field :something, :string, primary_key: true
    field :other, :string
  end

In WatcherOptions, Line 32 it crashes:

  [primary_key] = schema_mod.__schema__(:primary_key)

schema_mod.schema(:primary_key) returns a list of two keys, which cannot be matched to [primary_key]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions