Skip to content

Commit 4143a38

Browse files
committed
showing a warning if trying auto migrations with SQLite
1 parent 3063a4a commit 4143a38

File tree

1 file changed

+5
-0
lines changed
  • piccolo/apps/migrations/commands

1 file changed

+5
-0
lines changed

piccolo/apps/migrations/commands/new.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
DiffableTable,
1616
SchemaDiffer,
1717
)
18+
from piccolo.engine import SQLiteEngine
1819

1920

2021
TEMPLATE_DIRECTORY = os.path.join(
@@ -140,6 +141,10 @@ def new(app_name: str, auto: bool = False):
140141
print("Can't find piccolo_conf")
141142
sys.exit(1)
142143

144+
if auto and isinstance(getattr(piccolo_conf, "DB"), SQLiteEngine):
145+
print("Auto migrations aren't currently supported by SQLite.")
146+
sys.exit(1)
147+
143148
try:
144149
app_registry: AppRegistry = piccolo_conf.APP_REGISTRY
145150
except AttributeError:

0 commit comments

Comments
 (0)