Skip to content

Non-unique indexes are quietly omitted #108

@vendeeglobe

Description

@vendeeglobe

SQLite requires index names to be unique throughout the database, not just within a single table.

Currently, if option -K is missing, all indexes are quietly omitted without any indication being displayed if another INDEX with the same index name has already been processed.

The inexperienced user should at least receive an indication that important indices may be missing from their converted database. This will save him a lot of headaches later on.

Suggestion

[a] Show notice:

Skipped creating the following INDEX, an index with the same index name already exists:
$index[0]
$index[1]
$index[2]
...
Please use the -K option to prefix indices with their corresponding tables. This ensures that their names remain unique across the SQLite database.

[b] Or add a counter as suffix to each INDEX with the same index name:

$suffix = '_' . $i++;

idx_page_id
idx_page_id_2
idx_page_id_3
...
idx_user_id
idx_user_id_2
idx_user_id_3
...

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions