maxtepkeev/architect — pull request #7 by alph486 (2014-11-24 23:07:49+00:00)
Title: Fix: Initializing sqlite with `architect` causes PartitionTypeError

Hi there,

In 0.2.0, when experimenting with the new sqlite dummy support, I noticed an issue. I implemented simple Meta Fields in my Model I want to partition.

```
class Event(PartitionableMixin, models.Model):

class PartitionableMeta:
partition_type = 'range'
partition_subtype = 'date'
partition_range = 'month'
partition_column = 'timestamp'
...
```

This works fine in when using Postgres (which is in my server environment). When testing locally using Django 1.7.1 and Sqlite3, `architect partition --module my.app.models` would produce:

`Unsupported partition type "range" in model "Event", supported types for "sqlite" database are: range`

I traced this back to `cursor.connection.autocommit` apparently not being available with this backend. Apparently, `transaction_isolation = None` will do this: https://docs.python.org/2/library/sqlite3.html#connection-objects . After making the attached changes it appears to work correctly.

I'm not sure how you feel about passing the `dialect`into the Database `__init__`, but it was quick. I will also admit I am a novice with travis and nose, but I attempted to add tests for SQLite+Django to just verify it could call the command without breaking and insert data.

Please let me know your thoughts.

Thanks
Kevin