Detect multiple auto increment or primary key columns on table creation #8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently the implementation only checks for duplicate primary keys (or auto increments) during table alteration in
Database::enforceSchema(). The implementation should also prevent this situation during table creation.Actually, the driver will already throw an exception in this situation so the implementation does not need to duplicate that effort.
The checks do need to stay in the ALTER TABLE variant, since it consists of sequential queries. The first queries should not be applied if one of the later ones is guaranteed to fail.
This reasoning should be added as a comment to the method that performs the CREATE TABLE query.
Changed my mind again. In the bigger picture it wastes less compute to catch this error before it has to go through a socket and parsed by a separate application.