title: Does postgresql require unique constraint names when defining FOREIGN KEYS
body: <p>Here is my schema for database tables:</p>
  
  <pre><code> CREATE TABLE users (
    user_id INTEGER NOT NULL,
    device_id INTEGER,
    user_points INTEGER,
    cookie VARCHAR,
    PRIMARY KEY (user_id)
  );
  
   CREATE TABLE admins (
     admin_id INTEGER NOT NULL,
     username VARCHAR,
     password VARCHAR
   );
  
  
   CREATE TABLE admin_adventure (
     adventure_id INTEGER NOT NULL,
     admin_id INTEGER,
     PRIMARY KEY (adventure_id)
  
   );
  
   CREATE TABLE adventures (
     adventure_id INTEGER NOT NULL,
     prize_id INTEGER,
     novella_id INTEGER,
     PRIMARY KEY (adventure_id)
   );
  </code></pre>
  
  <p>Here I'm trying to define FOREIGN KEYS:</p>
  
  <pre><code>ALTER TABLE  admin_adventure  ADD FOREIGN KEY ( admin_id ) REFERENCES  admins  ( admin_id );
  
  
  ALTER TABLE  admin_adventure  ADD FOREIGN KEY ( adventure_id ) REFERENCES  adventures  ( adventure_id );
  </code></pre>
  
  <p>And here is the error I get when trying to migrate with Flyway:</p>
  
  <blockquote>
    <p>ERROR: there is no unique constraint matching given keys for
    referenced table "admins"</p>
  </blockquote>
  
  <p>Can someone explain what I'm doing wrong and why I get this error?</p>