django / django/new-features

Single line command for migrating multiple databases

Open
#57 3 comments 8 reactions 0 assignees View on GitHub
Migrations Third Party Package
Dominant language
No language data
Stars
188
Forks
7
PR merge metrics
No merged PRs in 30d

Description

### Code of Conduct

- [x] I agree to follow Django's Code of Conduct

### Feature Description

I believe that the behavior of the --database flag can be improved slightly, while keeping the explicitness requirement

Proposed Behavior:

```python
# Maintained Behavior: migrate is performed only on the 'default' database
./manage.py migrate

# New Behavior: A single command needed to perform migrate on multiple databases
./manage.py migrate --database=default,users,customers
```
PS: Its possible that the proposed behavior is already supported and only the documentation needs updating about it? If so, then a documentation issue could be opened alternatively.

### Problem

Image

While going through the official documentation, I noticed currently when you have multiple databases, and you want to migrate them, you have to write multiple commands

Current Behavior:

```python
./manage.py migrate # Performs migration on only the 'default' database

# Then two commands more needed for the remaining two databases
./manage.py migrate --database=users
./manage.py migrate --database=customers

```

### Request or proposal

request

### Additional Details

_No response_

### Implementation Suggestions

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.