aboutsummaryrefslogtreecommitdiffstats
path: root/utility/resetting_migrations.md
diff options
context:
space:
mode:
Diffstat (limited to 'utility/resetting_migrations.md')
-rw-r--r--utility/resetting_migrations.md34
1 files changed, 34 insertions, 0 deletions
diff --git a/utility/resetting_migrations.md b/utility/resetting_migrations.md
new file mode 100644
index 0000000..e3776bc
--- /dev/null
+++ b/utility/resetting_migrations.md
@@ -0,0 +1,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.