Skip to content

Accept None in the migrations_folder_path argument#1252

Open
sinisaos wants to merge 11 commits intopiccolo-orm:masterfrom
sinisaos:disable_migrations
Open

Accept None in the migrations_folder_path argument#1252
sinisaos wants to merge 11 commits intopiccolo-orm:masterfrom
sinisaos:disable_migrations

Conversation

@sinisaos
Copy link
Member

Related to #1161

@sinisaos sinisaos added the enhancement New feature or request label Dec 28, 2025
@sinisaos sinisaos linked an issue Feb 13, 2026 that may be closed by this pull request
@dantownsend
Copy link
Member

OK, I see the value in this. What happens if we try creating a migration in an app with no migrations - does it raise an error or do nothing?

@sinisaos
Copy link
Member Author

sinisaos commented Mar 6, 2026

@dantownsend For now UnboundLocalError: cannot access local variable 'path' where it is not associated with a value. If raising ValueError will be better? Something like this

# apps/migrations/commands/new.py
if app_config.resolved_migrations_folder_path is None:
    raise ValueError("Migrations disabled in this app!")

path = os.path.join(
    app_config.resolved_migrations_folder_path, f"{filename}.py"
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable migrations

2 participants