Foreign Key column pointing to `craft_relations` table
I might be wrong, but I don't believe you'll be able to do that within the defineRelations() method – Craft needs a record class for the table you want to create a relation with.

A workaround is to override the createTable() method in your record class and add the foreign key constraint manually using DbCommand:

public function createTable()
{
    parent::createTable();
    craft()-&gt;db-&gt;createCommand()-&gt;addForeignKey($this-&gt;getTableName(), 'id', 'relations', 'id', 'CASCADE', 'CASCADE');
}


To be perfectly honest the above feels quite hacky and there might be a better way – but it seems to work :)