From e3d26b5dd1cc6f7bd4d629fd9d2d034d8a6bc35b Mon Sep 17 00:00:00 2001 From: littlewolf Date: Tue, 1 Oct 2019 07:43:38 +0300 Subject: [PATCH] Temp commit --- apps/migrates/__init__.py | 0 apps/migrates/admin.py | 3 ++ apps/migrates/apps.py | 5 ++ apps/migrates/migrations/__init__.py | 0 apps/migrates/models.py | 68 ++++++++++++++++++++++++++++ apps/migrates/tests.py | 3 ++ apps/migrates/views.py | 3 ++ project/settings/base.py | 1 + 8 files changed, 83 insertions(+) create mode 100644 apps/migrates/__init__.py create mode 100644 apps/migrates/admin.py create mode 100644 apps/migrates/apps.py create mode 100644 apps/migrates/migrations/__init__.py create mode 100644 apps/migrates/models.py create mode 100644 apps/migrates/tests.py create mode 100644 apps/migrates/views.py diff --git a/apps/migrates/__init__.py b/apps/migrates/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/apps/migrates/admin.py b/apps/migrates/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/apps/migrates/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/apps/migrates/apps.py b/apps/migrates/apps.py new file mode 100644 index 00000000..60537525 --- /dev/null +++ b/apps/migrates/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class MigratesConfig(AppConfig): + name = 'migrates' diff --git a/apps/migrates/migrations/__init__.py b/apps/migrates/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/apps/migrates/models.py b/apps/migrates/models.py new file mode 100644 index 00000000..7ce617c5 --- /dev/null +++ b/apps/migrates/models.py @@ -0,0 +1,68 @@ +# This is an auto-generated Django model module. +# You'll have to do the following manually to clean this up: +# * Rearrange models' order +# * Make sure each model has one field with primary_key=True +# * Make sure each ForeignKey has `on_delete` set to the desired behavior. +# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table +# Feel free to rename the models, but don't rename db_table values or field names. +from django.contrib.gis.db import models + + +class Cities(models.Model): + using = 'legacy' + + name = models.CharField(max_length=255, blank=True, null=True) + country_code = models.CharField(max_length=3, blank=True, null=True) + country_code_2 = models.CharField(max_length=2, blank=True, null=True) + region_code = models.CharField(max_length=255, blank=True, null=True) + subregion_code = models.CharField(max_length=255, blank=True, null=True) + is_island = models.IntegerField(blank=True, null=True) + zip_code = models.CharField(max_length=9, blank=True, null=True) + situation = models.CharField(max_length=255, blank=True, null=True) + map_ref = models.CharField(max_length=255, blank=True, null=True) + map1 = models.CharField(max_length=255, blank=True, null=True) + map2 = models.CharField(max_length=255, blank=True, null=True) + latitude = models.FloatField(blank=True, null=True) + longitude = models.FloatField(blank=True, null=True) + encima_id = models.IntegerField(blank=True, null=True) + related_city_id = models.IntegerField(blank=True, null=True) + created_at = models.DateTimeField() + updated_at = models.DateTimeField() + index_name = models.CharField(max_length=255, blank=True, null=True) + + class Meta: + managed = False + db_table = 'cities' + unique_together = (('name', 'region_code', 'country_code'),) + + +class CityNames(models.Model): + using = 'legacy' + + name = models.CharField(max_length=100, blank=True, null=True) + locale = models.CharField(max_length=5, blank=True, null=True) + city = models.ForeignKey(Cities, models.DO_NOTHING, blank=True, null=True) + created_at = models.DateTimeField() + updated_at = models.DateTimeField() + + class Meta: + managed = False + db_table = 'city_names' + unique_together = (('city', 'name', 'locale'),) + + +class CityPhotos(models.Model): + using = 'legacy' + + city_id = models.IntegerField(blank=True, null=True) + attachment_file_name = models.CharField(max_length=255, blank=True, null=True) + attachment_content_type = models.CharField(max_length=255, blank=True, null=True) + geometries = models.CharField(max_length=1024, blank=True, null=True) + attachment_file_size = models.IntegerField(blank=True, null=True) + attachment_updated_at = models.DateTimeField(blank=True, null=True) + created_at = models.DateTimeField() + updated_at = models.DateTimeField() + + class Meta: + managed = False + db_table = 'city_photos' diff --git a/apps/migrates/tests.py b/apps/migrates/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/apps/migrates/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/apps/migrates/views.py b/apps/migrates/views.py new file mode 100644 index 00000000..91ea44a2 --- /dev/null +++ b/apps/migrates/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/project/settings/base.py b/project/settings/base.py index 6ea27a6c..2fca1b46 100644 --- a/project/settings/base.py +++ b/project/settings/base.py @@ -91,6 +91,7 @@ EXTERNAL_APPS = [ 'rest_framework_simplejwt.token_blacklist', 'solo', 'phonenumber_field', + 'apps.migrates' ]