Commit 8ceb9ccc authored by klafyvel's avatar klafyvel
Browse files

Fix migrations for MySQL

parent 61ac9c55
Pipeline #2140 failed with stage
in 16 seconds
......@@ -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;
```
......@@ -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 ..."
......
......@@ -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(
......
......@@ -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(
......
......@@ -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;'),
]
),
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment