blob: e3776bcadf9035d830e58c4a37b193e1e9a8c652 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# Resetting Migrations
When you absolutely balls it up and you want to start again,
Make sure you do the following:
You first need to remove those pesky migrations from your thing:
```bash
find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
find . -path "*/migrations/*.pyc" -delete
```
Then you need to eradicate that old database and create a new one!
In PostgreSQL, that's easy:
```bash
sudo -u postgres psql
DROP DATABASE <database_name>
CREATE DATBASE <database_name>
\q
```
Now, to recreate those migrations...
Here is what you do:
```bash
python manage.py makemigrations
python manage.py migrate
```
If `allauth` social accounts gives you problems - and it can:
You need to except this app from your application momentarily...
Comment it out of your settings.
Run your migrations again.
You are good, my friend.
|