title: Why do I get "foreign key mismatch" error?
body: <p>I don't understand why I get the error, could you explain please?</p>
  
  <pre><code>sqlite&gt; create table a (id text, val text);
  sqlite&gt; create table b (bid text, ref text, foreign key(ref) references a(text));
  sqlite&gt; insert into a values("1", "one");
  sqlite&gt; insert into b values("1", "one");
  Error: foreign key mismatch
  </code></pre>