mirror of
https://github.com/carrotquest/django-clickhouse.git
synced 2024-11-22 00:56:37 +03:00
some refactoring
This commit is contained in:
parent
cea0f3cab5
commit
68914a20f0
|
@ -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.')
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue
Block a user