summaryrefslogtreecommitdiffstats
path: root/google_appengine/lib/django/django/db/backends/postgresql/creation.py
diff options
context:
space:
mode:
Diffstat (limited to 'google_appengine/lib/django/django/db/backends/postgresql/creation.py')
-rwxr-xr-xgoogle_appengine/lib/django/django/db/backends/postgresql/creation.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/google_appengine/lib/django/django/db/backends/postgresql/creation.py b/google_appengine/lib/django/django/db/backends/postgresql/creation.py
new file mode 100755
index 0000000..6c130f3
--- /dev/null
+++ b/google_appengine/lib/django/django/db/backends/postgresql/creation.py
@@ -0,0 +1,29 @@
+# This dictionary maps Field objects to their associated PostgreSQL column
+# types, as strings. Column-type strings can contain format strings; they'll
+# be interpolated against the values of Field.__dict__ before being output.
+# If a column type is set to None, it won't be included in the output.
+DATA_TYPES = {
+ 'AutoField': 'serial',
+ 'BooleanField': 'boolean',
+ 'CharField': 'varchar(%(maxlength)s)',
+ 'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)',
+ 'DateField': 'date',
+ 'DateTimeField': 'timestamp with time zone',
+ 'FileField': 'varchar(100)',
+ 'FilePathField': 'varchar(100)',
+ 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)',
+ 'ImageField': 'varchar(100)',
+ 'IntegerField': 'integer',
+ 'IPAddressField': 'inet',
+ 'ManyToManyField': None,
+ 'NullBooleanField': 'boolean',
+ 'OneToOneField': 'integer',
+ 'PhoneNumberField': 'varchar(20)',
+ 'PositiveIntegerField': 'integer CHECK ("%(column)s" >= 0)',
+ 'PositiveSmallIntegerField': 'smallint CHECK ("%(column)s" >= 0)',
+ 'SlugField': 'varchar(%(maxlength)s)',
+ 'SmallIntegerField': 'smallint',
+ 'TextField': 'text',
+ 'TimeField': 'time',
+ 'USStateField': 'varchar(2)',
+}