Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last row fails when primary keys are not auto_incremented. #10

Open
dotancohen opened this issue Dec 5, 2013 · 1 comment
Open

Last row fails when primary keys are not auto_incremented. #10

dotancohen opened this issue Dec 5, 2013 · 1 comment
Labels

Comments

@dotancohen
Copy link
Owner

The last row shown is incorrect in the case where a table has a non-auto_increment primary key, such as if that primary key is a phone number. In these cases, squeal should check if there are any datetime columns or timestamp columns, and if there is exactly one then that column should be sorted on for purpose of last record. If there are more than one then ask the user one which column to sort.

Here is an example of a non-auto_increment primary key:

+-----------------+--------------+------+-----+---------+-------+
| Field           | Type         | Null | Key | Default | Extra |
+-----------------+--------------+------+-----+---------+-------+
| phone           | char(10)     | NO   | PRI |         |       |

Here is an example of an auto_increment primary key:

+--------------+-------------+------+-----+---------+----------------+
| Field        | Type        | Null | Key | Default | Extra          |
+--------------+-------------+------+-----+---------+----------------+
| id           | int(11)     | NO   | PRI | None    | auto_increment |
@dotancohen
Copy link
Owner Author

Depends on Issue #11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant