Issue: Exception when switching from MySql to Sqlite
Author: hamiltont
State: closed
Created: 2015-02-23 22:50:16

With mysql this was valid: 

```
database.drop_tables(tables, safe=True, cascade=True)    
```

When I switched to sqlite, this line caused the exception below. I'd have expected that it would just ignore the cascade argument if the engine is sqlite. 

```
('DROP TABLE IF EXISTS "benchmark" CASCADE', [])
127.0.0.1 - - [23/Feb/2015 17:49:09] "GET / HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/flask_debugtoolbar/__init__.py", line 124, in dispatch_request
    return view_func(**req.view_args)
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/line_profiler.py", line 141, in runcall
    return func(*args, **kw)
  File "/Users/hamiltont/Documents/FrameworkContinuous/webapp.py", line 35, in dash
    models.create_database()
  File "/Users/hamiltont/Documents/FrameworkContinuous/src/models.py", line 36, in create_database
    database.drop_tables(tables, safe=True, cascade=True)
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/peewee.py", line 2987, in drop_tables
    drop_model_tables(models, fail_silently=safe, cascade=cascade)
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/peewee.py", line 4054, in drop_model_tables
    m.drop_table(**drop_table_kwargs)
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/peewee.py", line 3843, in drop_table
    cls._meta.database.drop_table(cls, fail_silently, cascade)
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/peewee.py", line 2984, in drop_table
    model_class, fail_silently, cascade))
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/peewee.py", line 2877, in execute_sql
    self.commit()
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/peewee.py", line 2732, in __exit__
    reraise(new_type, new_type(*exc_value.args), traceback)
  File "/Users/hamiltont/Documents/FrameworkContinuous/env/lib/python2.7/site-packages/peewee.py", line 2869, in execute_sql
    cursor.execute(sql, params or ())
OperationalError: near "CASCADE": syntax error
```


I'm inclined to actually leave that error as-is, since I wouldn't want you to specify `cascade=True` with SQLite, then have it _not_ cascade. Thank you for reporting, though.


Ok dokie! Figured it's a preference thing, thanks for the quick reply!