peewee.OperationalError: (1061, "Duplicate key name 'fqcmodel_date_'") ?
peewee crate table in safe mode don't work at all????
![image](https://user-images.githubusercontent.com/6836400/164888113-8776e544-9687-4f79-8245-fd8f7219d8da.png)
 @jekoie You are supposed to do it like this:

```
class BaseModel(Model):
    class Meta:
        database = db

class FQCModel(BaseModel):
    date_ = DateTimeField(default=datetime.datetime.now, help_text="日期", verbose_name="日期", index=True, formats="%Y-%m-%d %H:%M:%S")

db.create_tables([FQCModel])
```
 MySQL does not support create index if not exists, if I recall correctly. So you probably need to check yourself beforehand. You can get the list of existing tables and indexes:

* http://docs.peewee-orm.com/en/latest/peewee/api.html#Database.get_tables
* http://docs.peewee-orm.com/en/latest/peewee/api.html#Database.get_indexes @coleifer My Model is Ok, The real problem is `peewee` can't  judge if the table already exist, so in I call  `db.create_tables([FQCModel], safe=True)` again , it will be throw error. You meant to reply to mkmoisen I believe.

Here is my comment, again:

MySQL does not support create index if not exists, if I recall correctly. So you probably need to check yourself beforehand.

And:

You can get the list of existing tables and indexes:

    http://docs.peewee-orm.com/en/latest/peewee/api.html#Database.get_tables
    http://docs.peewee-orm.com/en/latest/peewee/api.html#Database.get_indexes

@jekoie you can always write your own method that checks for existence before trying to create the table.
I use peewee create a table and connect to mysql, but it run failed?
`peewee.OperationalError: (1061, "Duplicate key name 'fqcmodel_date_'")`

```python
class FQCModel(Model):
    date_ = DateTimeField(default=datetime.datetime.now, help_text="日期", verbose_name="日期", index=True, formats="%Y-%m-%d %H:%M:%S")
```