BUG: When creating table, db indexes should be created from DataFrame indexes

Unfortunately my PR #8022 introduced a bug wherein database indexes are not created from DataFrame indexes.  This pull request fixes it, also introduces this feature for the legacy interface, and adds tests to make sure indexes are created as appropriate.
I think a `;` is needed here in the end of the line (I think that is the reason of part of the test failures)

\+ maybe using ``"CREATE INDEX ix_{table}_{column} ON ...".format(table=self.name, column=cname, ...)`` instead of using `+` can maybe lead to nicer code