fixed foreign key in rights table creation