title: SQLite foreign key mismatch error
body: <p>Why am I getting a SQLite "<em>foreign key mismatch</em>" error when executing script below?</p>
  
  <pre><code>DELETE 
  FROM rlsconfig 
  WHERE importer_config_id=2 and 
  program_mode_config_id=1
  </code></pre>
  
  <p>Here is main table definition: </p>
  
  <pre><code> CREATE TABLE [RLSConfig] (
          "rlsconfig_id"      integer PRIMARY KEY AUTOINCREMENT NOT NULL,
          "importer_config_id"        integer NOT NULL,
          "program_mode_config_id"        integer NOT NULL,
          "l2_channel_config_id"      integer NOT NULL,
          "rls_fixed_width"       integer NOT NULL
      ,
          FOREIGN KEY ([importer_config_id])
              REFERENCES [ImporterConfig]([importer_config_id]),
          FOREIGN KEY ([program_mode_config_id])
              REFERENCES [ImporterConfig]([importer_config_id]),
          FOREIGN KEY ([importer_config_id])
              REFERENCES [ImporterConfig]([program_mode_config_id]),
          FOREIGN KEY ([program_mode_config_id])
              REFERENCES [ImporterConfig]([program_mode_config_id])
      )
  </code></pre>
  
  <p>and referenced table:</p>
  
  <pre><code>    CREATE TABLE [ImporterConfig] (
          "importer_config_id"        integer NOT NULL,
          "program_mode_config_id"        integer NOT NULL,
          "selected"      integer NOT NULL DEFAULT 0,
          "combined_config_id"        integer NOT NULL,
          "description"       varchar(50) NOT NULL COLLATE NOCASE,
          "date_created"      datetime NOT NULL DEFAULT (CURRENT_TIMESTAMP),
          PRIMARY KEY ([program_mode_config_id], [importer_config_id])
      ,
          FOREIGN KEY ([program_mode_config_id])
              REFERENCES [ProgramModeConfig]([program_mode_config_id])
      )
  </code></pre>