Skip to content
  • Rafael Mendonça França's avatar
    096e25bc
    Don't over protect the MySQL users on insert_all · 096e25bc
    Rafael Mendonça França authored
    MySQL don't support conflict target on insert_all so we can't pass the
    :unique_by option. But, if you don't check if the index exists MySQL will
    successfully inset the data.
    
    If there is a conflict in an index like the primary key the database will
    raise an error. We should let the database decide if the data is acceptable
    or not.
    
    The test added on this commit exercise a table that has composite primary
    keys, but, in order to keep all the Rails behavior working (given Rails
    doesn't officially support composite primary keys) we set the primary
    key to an auto increment :id column.
    096e25bc
    Don't over protect the MySQL users on insert_all
    Rafael Mendonça França authored
    MySQL don't support conflict target on insert_all so we can't pass the
    :unique_by option. But, if you don't check if the index exists MySQL will
    successfully inset the data.
    
    If there is a conflict in an index like the primary key the database will
    raise an error. We should let the database decide if the data is acceptable
    or not.
    
    The test added on this commit exercise a table that has composite primary
    keys, but, in order to keep all the Rails behavior working (given Rails
    doesn't officially support composite primary keys) we set the primary
    key to an auto increment :id column.
Loading