some refactoring
This commit is contained in:
M1ha 2018-11-23 11:04:31 +05:00
parent cea0f3cab5
commit 68914a20f0
3 changed files with 9 additions and 6 deletions

View File

@ -15,6 +15,11 @@ class Database(InfiDatabase):
}
super(Database, self).__init__(**infi_kwargs)
def drop_database(self):
# BUG fix https://github.com/Infinidat/infi.clickhouse_orm/issues/89
super(Database, self).drop_database()
self.db_exists = False
def migrate(self, migrations_package_name, up_to=9999):
raise NotImplementedError('This method is not supported by django-clickhouse.'
' Use django_clickhouse.migrations module instead.')

View File

@ -3,16 +3,15 @@ Migrating database
"""
import datetime
from django.db import DEFAULT_DB_ALIAS as DJANGO_DEFAULT_DB_ALIAS
from django.db.models.signals import post_migrate
from django.dispatch import receiver
from django.db import DEFAULT_DB_ALIAS as DJANGO_DEFAULT_DB_ALIAS
from infi.clickhouse_orm.migrations import *
from infi.clickhouse_orm.utils import import_submodules
from django_clickhouse.utils import lazy_class_import, module_exists
from .configuration import config
from .database import connections
from .utils import lazy_class_import, module_exists
class Migration:

View File

@ -1,11 +1,10 @@
from infi.clickhouse_orm.migrations import CreateTable
from django_clickhouse import migrations
from tests.clickhouse_models import ClickHouseTestModel, ClickHouseCollapseTestModel
class Migration(migrations.Migration):
operations = [
CreateTable(ClickHouseTestModel),
CreateTable(ClickHouseCollapseTestModel)
migrations.CreateTable(ClickHouseTestModel),
migrations.CreateTable(ClickHouseCollapseTestModel)
]