mirror of
https://github.com/fastapi/sqlmodel.git
synced 2025-12-12 15:39:09 +08:00
Remove --model
This commit is contained in:
@@ -44,6 +44,13 @@ def migration_env(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> MigrationT
|
||||
|
||||
shutil.copy(model_source, models_file)
|
||||
|
||||
# Create pyproject.toml with [tool.sqlmodel] configuration
|
||||
pyproject_content = """\
|
||||
[tool.sqlmodel]
|
||||
models = "test_models.models"
|
||||
"""
|
||||
(tmp_path / "pyproject.toml").write_text(pyproject_content)
|
||||
|
||||
monkeypatch.setenv("DATABASE_URL", db_url)
|
||||
monkeypatch.chdir(tmp_path)
|
||||
|
||||
@@ -67,8 +74,6 @@ def test_create_first_migration(migration_env: MigrationTestEnv):
|
||||
"create",
|
||||
"-m",
|
||||
"Initial migration",
|
||||
"--models",
|
||||
"test_models.models",
|
||||
"--path",
|
||||
str(migration_env.migrations_dir),
|
||||
],
|
||||
@@ -105,8 +110,6 @@ def test_running_migration_twice_only_generates_migration_once(
|
||||
"create",
|
||||
"-m",
|
||||
"Initial migration",
|
||||
"--models",
|
||||
"test_models.models",
|
||||
"--path",
|
||||
str(migration_env.migrations_dir),
|
||||
],
|
||||
@@ -121,8 +124,6 @@ def test_running_migration_twice_only_generates_migration_once(
|
||||
[
|
||||
"migrations",
|
||||
"migrate",
|
||||
"--models",
|
||||
"test_models.models",
|
||||
"--path",
|
||||
str(migration_env.migrations_dir),
|
||||
],
|
||||
@@ -138,8 +139,6 @@ def test_running_migration_twice_only_generates_migration_once(
|
||||
"create",
|
||||
"-m",
|
||||
"Initial migration",
|
||||
"--models",
|
||||
"test_models.models",
|
||||
"--path",
|
||||
str(migration_env.migrations_dir),
|
||||
],
|
||||
@@ -169,8 +168,6 @@ def test_cannot_create_migration_with_pending_migrations(
|
||||
"create",
|
||||
"-m",
|
||||
"Initial migration",
|
||||
"--models",
|
||||
"test_models.models",
|
||||
"--path",
|
||||
str(migration_env.migrations_dir),
|
||||
],
|
||||
@@ -187,8 +184,6 @@ def test_cannot_create_migration_with_pending_migrations(
|
||||
"create",
|
||||
"-m",
|
||||
"Second migration",
|
||||
"--models",
|
||||
"test_models.models",
|
||||
"--path",
|
||||
str(migration_env.migrations_dir),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user