mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-12-19 07:15:04 +01:00
find and replace fixes, will introduce errors
This commit is contained in:
@@ -13,8 +13,7 @@ Your auth project is just a regular Django project - you can add in [other Djang
|
||||
|
||||
The following instructions will explain how you can remove an app properly fom your Alliance Auth installation.
|
||||
|
||||
```eval_rst
|
||||
.. note::
|
||||
:::{note}
|
||||
We recommend following these instructions to avoid dangling foreign keys or orphaned Python packages on your system, which might cause conflicts with other apps down the road.
|
||||
|
||||
```
|
||||
@@ -27,7 +26,7 @@ First, we want to remove the app related tables from the database.
|
||||
|
||||
Let's first try the automatic approach by running the following command:
|
||||
|
||||
```sh
|
||||
```shell
|
||||
python manage.py migrate appname zero
|
||||
```
|
||||
|
||||
@@ -39,32 +38,32 @@ If that did not work and you got error messages, you will need to remove the tab
|
||||
|
||||
First, tell Django that these migrations are no longer in effect (note the additional `--fake`):
|
||||
|
||||
```sh
|
||||
```shell
|
||||
python manage.py migrate appname zero --fake
|
||||
```
|
||||
|
||||
Then, open the mysql tool and connect to your Alliance Auth database:
|
||||
|
||||
```sh
|
||||
```shell
|
||||
sudo mysql -u root
|
||||
use alliance_auth;
|
||||
```
|
||||
|
||||
Next disable foreign key check. This makes it much easier to drop tables in any order.
|
||||
|
||||
```sh
|
||||
```shell
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
```
|
||||
|
||||
Then get a list of all tables. All tables belonging to the app in question will start with `appname_`.
|
||||
|
||||
```sh
|
||||
```shell
|
||||
show tables;
|
||||
```
|
||||
|
||||
Now, drop the tables from the app one by one like so:
|
||||
|
||||
```sh
|
||||
```shell
|
||||
drop table appname_model_1;
|
||||
drop table appname_model_2;
|
||||
...
|
||||
@@ -72,7 +71,7 @@ drop table appname_model_2;
|
||||
|
||||
And finally, but very importantly, re-enable foreign key checks again and then exit:
|
||||
|
||||
```sh
|
||||
```shell
|
||||
SET FOREIGN_KEY_CHECKS=1;
|
||||
exit;
|
||||
```
|
||||
@@ -85,7 +84,7 @@ Once the tables have been removed, you you can remove the app from Alliance Auth
|
||||
|
||||
Finally, we want to remove the app's Python package. For that run the following command:
|
||||
|
||||
```sh
|
||||
```shell
|
||||
pip uninstall app-package-name
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user