diff options
| author | Chris Wilson <chris+github@qwirx.com> | 2013-09-06 12:18:16 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-09-06 12:31:17 -0400 |
| commit | eade315da1c8372ac1dfcf1fd20ea87f454d71ac (patch) | |
| tree | 8eeb30580f8ca4a00d2a776e65b88288887f95da /django/db/backends/sqlite3 | |
| parent | 630eb0564abd228da439d86ad93acb4089d795e7 (diff) | |
Fixed #10164 -- Made AutoField increase monotonically on SQLite
Thanks malte for the report.
Diffstat (limited to 'django/db/backends/sqlite3')
| -rw-r--r-- | django/db/backends/sqlite3/base.py | 1 | ||||
| -rw-r--r-- | django/db/backends/sqlite3/creation.py | 3 | ||||
| -rw-r--r-- | django/db/backends/sqlite3/introspection.py | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py index 385733cb8d..889630faf9 100644 --- a/django/db/backends/sqlite3/base.py +++ b/django/db/backends/sqlite3/base.py @@ -106,6 +106,7 @@ class DatabaseFeatures(BaseDatabaseFeatures): supports_check_constraints = False autocommits_when_autocommit_is_off = True supports_paramstyle_pyformat = False + supports_sequence_reset = False @cached_property def uses_savepoints(self): diff --git a/django/db/backends/sqlite3/creation.py b/django/db/backends/sqlite3/creation.py index 435cee3436..bdd4560516 100644 --- a/django/db/backends/sqlite3/creation.py +++ b/django/db/backends/sqlite3/creation.py @@ -34,6 +34,9 @@ class DatabaseCreation(BaseDatabaseCreation): 'TextField': 'text', 'TimeField': 'time', } + data_types_suffix = { + 'AutoField': 'AUTOINCREMENT', + } def sql_for_pending_references(self, model, style, pending_references): "SQLite3 doesn't support constraints" diff --git a/django/db/backends/sqlite3/introspection.py b/django/db/backends/sqlite3/introspection.py index f1d433fe0f..55e68c34b9 100644 --- a/django/db/backends/sqlite3/introspection.py +++ b/django/db/backends/sqlite3/introspection.py @@ -175,7 +175,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): results = results[results.index('(') + 1:results.rindex(')')] for field_desc in results.split(','): field_desc = field_desc.strip() - m = re.search('"(.*)".*PRIMARY KEY$', field_desc) + m = re.search('"(.*)".*PRIMARY KEY( AUTOINCREMENT)?$', field_desc) if m: return m.groups()[0] return None |
