summaryrefslogtreecommitdiff
path: root/app/locations/migrations/0001_initial.py
blob: 1854dbf7427ee24512b6ed28746b6187c8427f0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-12-14 22:25
from __future__ import unicode_literals

import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('area', models.IntegerField(help_text='Area of Country in SQ meters')),
                ('pop2005', models.IntegerField(verbose_name='Population 2005')),
                ('fips', models.CharField(help_text='<a href="http://www.census.gov/geo/www/fips/fips.html">Federal Information Processing Standard Code</a>', max_length=2, verbose_name='FIPS Code')),
                ('iso2', models.CharField(help_text='<a href="http://www.iso.org/">International Organization for Standardization</a>', max_length=2, verbose_name='2 Digit ISO')),
                ('iso3', models.CharField(help_text='<a href="http://www.iso.org/">International Organization for Standardization</a>', max_length=3, verbose_name='3 Digit ISO')),
                ('un', models.IntegerField(verbose_name='United Nations Code')),
                ('region', models.IntegerField(choices=[(0, 'MISC'), (2, 'Africa'), (9, 'Oceania'), (19, 'Americas'), (142, 'Asia'), (150, 'Europe')], verbose_name='Region Code')),
                ('subregion', models.IntegerField(choices=[(0, 'MISC'), (5, 'South America'), (11, 'Western Africa'), (13, 'Central America'), (14, 'Eastern Africa'), (15, 'Northern Africa'), (17, 'Middle Africa'), (18, 'Southern Africa'), (21, 'North America'), (29, 'Caribbean'), (30, 'Eastern Asia'), (34, 'Southern Asia'), (35, 'Southeast Asia'), (39, 'Southern Europe'), (53, 'Australia and New Zealand'), (54, 'Melanesia'), (57, 'Micronesia'), (61, 'Polynesia'), (143, 'Central Asia'), (145, 'Western Asia'), (151, 'Eastern Europe'), (154, 'Northern Europe'), (155, 'Western Europe')], verbose_name='Sub-Region Code')),
                ('lon', models.FloatField(help_text='Longitude of centerpoint', verbose_name='Longitude')),
                ('lat', models.FloatField(help_text='Latitude of centerpoint', verbose_name='Latitude')),
                ('zoom_level', models.CharField(max_length=2, null=True)),
                ('slug', models.SlugField(null=True)),
                ('visited', models.BooleanField(default=False)),
                ('pub_date', models.DateTimeField(null=True, verbose_name='Date published')),
                ('geometry', django.contrib.gis.db.models.fields.MultiPolygonField(srid=4326, verbose_name='Country Border')),
            ],
            options={
                'verbose_name_plural': 'Countries',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('slug', models.SlugField()),
                ('pub_date', models.DateTimeField(null=True, verbose_name='Date published')),
                ('geometry', django.contrib.gis.db.models.fields.MultiPolygonField(srid=4326)),
            ],
        ),
        migrations.CreateModel(
            name='Region',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('slug', models.SlugField()),
                ('pub_date', models.DateTimeField(null=True, verbose_name='Date published')),
                ('geometry', django.contrib.gis.db.models.fields.MultiPolygonField(null=True, srid=4326)),
                ('lon', models.FloatField(help_text='Longitude of centerpoint', null=True, verbose_name='Longitude')),
                ('lat', models.FloatField(help_text='Latitude of centerpoint', null=True, verbose_name='Latitude')),
                ('zoom_level', models.CharField(max_length=2, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Route',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('slug', models.SlugField()),
                ('zoom', models.CharField(max_length=2, null=True)),
                ('template_var_name', models.CharField(max_length=10, null=True)),
                ('pub_date', models.DateTimeField(null=True, verbose_name='Date published')),
                ('geometry', django.contrib.gis.db.models.fields.MultiPointField(srid=4326)),
            ],
        ),
        migrations.CreateModel(
            name='State',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=250, null=True)),
                ('slug', models.SlugField()),
                ('code', models.CharField(blank=True, max_length=2, null=True)),
                ('pub_date', models.DateTimeField(null=True, verbose_name='Date published')),
                ('geometry', django.contrib.gis.db.models.fields.MultiPolygonField(null=True, srid=4326)),
                ('country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='locations.Country')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.AddField(
            model_name='location',
            name='state',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='locations.State'),
        ),
        migrations.AddField(
            model_name='country',
            name='lux_region',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='locations.Region'),
        ),
    ]