mirror of
https://github.com/djrobstep/migra.git
synced 2024-08-15 16:50:24 +03:00
refmt
This commit is contained in:
parent
2c38e8c483
commit
3ff01951b2
@ -122,7 +122,7 @@ def statements_from_differences(
|
||||
for k, v in added.items():
|
||||
if not has_uncreated_dependencies(v, pending_creations):
|
||||
if k in pending_creations:
|
||||
if hasattr(v, 'safer_create_statements'):
|
||||
if hasattr(v, "safer_create_statements"):
|
||||
statements += v.safer_create_statements
|
||||
else:
|
||||
statements.append(v.create_statement)
|
||||
@ -137,7 +137,7 @@ def statements_from_differences(
|
||||
if creations:
|
||||
if not has_uncreated_dependencies(v, pending_creations):
|
||||
if k in pending_creations:
|
||||
if hasattr(v, 'safer_create_statements'):
|
||||
if hasattr(v, "safer_create_statements"):
|
||||
statements += v.safer_create_statements
|
||||
else:
|
||||
statements.append(v.create_statement)
|
||||
|
@ -4,8 +4,6 @@ import argparse
|
||||
import sys
|
||||
from contextlib import contextmanager
|
||||
|
||||
|
||||
|
||||
from .migra import Migration
|
||||
from .statements import UnsafeMigrationException
|
||||
|
||||
@ -17,6 +15,7 @@ def arg_context(x):
|
||||
|
||||
else:
|
||||
from sqlbag import S
|
||||
|
||||
with S(x) as s:
|
||||
yield s
|
||||
|
||||
|
@ -2,7 +2,6 @@ from __future__ import unicode_literals
|
||||
|
||||
from schemainspect import DBInspector, get_inspector
|
||||
|
||||
|
||||
from .changes import Changes
|
||||
from .statements import Statements
|
||||
|
||||
@ -60,6 +59,7 @@ class Migration(object):
|
||||
|
||||
def apply(self):
|
||||
from sqlbag import raw_execute
|
||||
|
||||
for stmt in self.statements:
|
||||
raw_execute(self.s_from, stmt)
|
||||
self.changes.i_from = get_inspector(
|
||||
|
Loading…
Reference in New Issue
Block a user