Browse Source

Fix migrations for MySQL

fix_buster_api
Hugo Levy-Falk 6 years ago
parent
commit
8ceb9ccc0c
  1. 8
      CHANGELOG.md
  2. 2
      install_re2o.sh
  3. 6
      users/migrations/0028_auto_20160726_0227.py
  4. 2
      users/migrations/0034_auto_20161018_0037.py
  5. 2
      users/migrations/0052_ldapuser_shadowexpire.py

8
CHANGELOG.md

@ -187,3 +187,11 @@ OPTIONNAL_APPS = OPTIONNAL_APPS_RE2O + (...,...,)
```
Don't forget to run migrations afterwards.
## MR 433 : upgrade django-ldapdb to 1.3.0
If you use MySQL, please run
```
SET GLOBAL SQL_MODE=ANSI_QUOTES;
```

2
install_re2o.sh

@ -109,7 +109,7 @@ install_database() {
mysql_command="CREATE DATABASE $db_name collate='utf8_general_ci';
CREATE USER '$username'@'localhost' IDENTIFIED BY '$password';
GRANT ALL PRIVILEGES ON $db_name.* TO '$username'@'localhost';
FLUSH PRIVILEGES;"
FLUSH PRIVILEGES;SET GLOBAL SQL_MODE=ANSI_QUOTES;"
if [ "$local_setup" == 1 ]; then
echo "Setting up local MySQL server ..."

6
users/migrations/0028_auto_20160726_0227.py

@ -54,9 +54,9 @@ class Migration(migrations.Migration):
),
],
database_operations=[
migrations.RunSQL('ALTER TABLE "users_ldapuser" ADD COLUMN "displayName" varchar(200) NULL;'),
migrations.RunSQL('ALTER TABLE "users_ldapuser" ADD COLUMN "sambaNTPassword" varchar(200) NULL;'),
migrations.RunSQL('ALTER TABLE "users_ldapuser" ADD COLUMN "userPassword" varchar(200) NULL;'),
migrations.RunSQL('ALTER TABLE users_ldapuser ADD COLUMN "displayName" varchar(200) NULL;'),
migrations.RunSQL('ALTER TABLE users_ldapuser ADD COLUMN "sambaNTPassword" varchar(200) NULL;'),
migrations.RunSQL('ALTER TABLE users_ldapuser ADD COLUMN "userPassword" varchar(200) NULL;'),
]
),
migrations.AddField(

2
users/migrations/0034_auto_20161018_0037.py

@ -45,7 +45,7 @@ class Migration(migrations.Migration):
),
],
database_operations=[
migrations.RunSQL('ALTER TABLE "users_ldapuser" ADD COLUMN "loginShell" varchar(200) NULL;')
migrations.RunSQL('ALTER TABLE users_ldapuser ADD COLUMN "loginShell" varchar(200) NULL;')
],
),
migrations.AddField(

2
users/migrations/0052_ldapuser_shadowexpire.py

@ -22,7 +22,7 @@ class Migration(migrations.Migration):
),
],
database_operations=[
migrations.RunSQL('ALTER TABLE "users_ldapuser" ADD COLUMN "shadowExpire" varchar(200) NULL;'),
migrations.RunSQL('ALTER TABLE users_ldapuser ADD COLUMN "shadowExpire" varchar(200) NULL;'),
]
),
]

Loading…
Cancel
Save