Skip to content

Commit b293750

Browse files
committed
Fix renamed db wait command
1 parent 7a3413f commit b293750

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

plain-dev/plain/dev/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def run(self) -> int:
151151
if find_spec("plain.models"):
152152
click.secho("→ Waiting for database... ", dim=True, nl=False)
153153
subprocess.run(
154-
[sys.executable, "-m", "plain", "models", "db-wait"],
154+
[sys.executable, "-m", "plain", "db", "wait"],
155155
env=self.plain_env,
156156
check=True,
157157
)

plain-dev/plain/dev/precommit/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ def plain_db_connected() -> bool:
126126
result = subprocess.run(
127127
[
128128
"plain",
129-
"models",
130-
"show-migrations",
129+
"migrations",
130+
"list",
131131
],
132132
stdout=subprocess.DEVNULL,
133133
stderr=subprocess.DEVNULL,

plain-jobs/plain/jobs/migrations/0004_rename_tables_to_plainjobs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#
33
# If upgrading from plain.worker, run this SQL command BEFORE running migrations:
44
#
5-
# plain models db-shell -- -c "INSERT INTO plainmigrations (app, name, applied) SELECT 'plainjobs', name, applied FROM plainmigrations WHERE app = 'plainworker' ON CONFLICT DO NOTHING;"
5+
# plain db shell -- -c "INSERT INTO plainmigrations (app, name, applied) SELECT 'plainjobs', name, applied FROM plainmigrations WHERE app = 'plainworker' ON CONFLICT DO NOTHING;"
66
#
77
# Then run: plain migrate
8-
# Then run: plain migrate --prune (to clean up old plainworker records)
8+
# Then run: plain migrations prune (to clean up old plainworker records)
99
#
1010
# Step 1: Rename tables from plainworker_* to plainjobs_*
1111

plain-models/plain/models/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ plain makemigrations
125125
plain migrate
126126

127127
# See migration status
128-
plain models show-migrations
128+
plain migrations list
129129
```
130130

131131
Migrations are Python files that describe database schema changes. They're stored in your app's `migrations/` directory.

plain-models/plain/models/preflight.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ def run(self) -> list[PreflightResult]:
231231
unknown_tables.discard("plainmigrations") # Know this could be there
232232
if unknown_tables:
233233
table_names = ", ".join(unknown_tables)
234-
specific_fix = f'echo "DROP TABLE IF EXISTS {unknown_tables.pop()}" | plain models db-shell'
234+
specific_fix = (
235+
f'echo "DROP TABLE IF EXISTS {unknown_tables.pop()}" | plain db shell'
236+
)
235237
errors.append(
236238
PreflightResult(
237239
fix=f"Unknown tables in default database: {table_names}. "
@@ -311,9 +313,7 @@ def run(self) -> list[PreflightResult]:
311313
orphaned_list += f" (and {len(prunable_orphaned) - 3} more)"
312314
message_parts.append(f"From removed packages: {orphaned_list}.")
313315

314-
message_parts.append(
315-
"Run 'plain models prune-migrations' to review and remove them."
316-
)
316+
message_parts.append("Run 'plain migrations prune' to review and remove them.")
317317

318318
errors.append(
319319
PreflightResult(

0 commit comments

Comments
 (0)