2.5.1 I deleted the column for "city" in mdl_user on MyPHPAdmin...

2.5.1 I deleted the column for "city" in mdl_user on MyPHPAdmin...

על ידי Wendi Daniels בתאריך
מספר תגובות: 5

...and now I can't see my list of users. I am thinking I could simply upgrade, and that column will be put back on MyPHPAdmin...won't it? Please advise.

ממוצע דרוגים: -
בתגובה ל: Wendi Daniels

Re: 2.5.1 I deleted the column for "city" in mdl_user on MyPHPAdmin...

על ידי Howard Miller בתאריך
תמונה של Core developers תמונה של Documentation writers תמונה של Particularly helpful Moodlers תמונה של Peer reviewers תמונה של Plugin developers

No it won't. 

Try...

ALTER TABLE ADD city varchar(120) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' AFTER address;

I'm not going to ask why you deleted it - it's a required field for users in Moodle קריצה

בתגובה ל: Wendi Daniels

Re: 2.5.1 I deleted the column for "city" in mdl_user on MyPHPAdmin...

על ידי Guillermo Madero בתאריך

Hi Wendi,

As you want the field to be optional, I would do either of the following (assuming that the table prefix is mdl and that the collation is utf8_unicode_ci):

1. Allow null values

ALTER TABLE mdl_user
ADD city VARCHAR(120) NULL
CHARACTER SET utf8 COLLATE utf8_unicode_ci
AFTER address;

2. Do not allow null values but assign a default value (e.g. the one used in the location settings)

ALTER TABLE mdl_user
ADD city VARCHAR(120) NOT NULL
DEFAULT 'Default_City_Value'
CHARACTER SET utf8 COLLATE utf8_unicode_ci
AFTER address;

If I were doing this, I would go with the second option.

בתגובה ל: Guillermo Madero

Re: 2.5.1 I deleted the column for "city" in mdl_user on MyPHPAdmin...

על ידי Wendi Daniels בתאריך

Thank you both! I deleted it in a hopeful attempt to get rid of the required field "City" on the signup sheet. I am an amateur...very much so. I have "tweaked" one other website I had built not quite a year ago...that is my whole experience with techy stuff.  :D

בתגובה ל: Guillermo Madero

Re: 2.5.1 I deleted the column for "city" in mdl_user on MyPHPAdmin...

על ידי Wendi Daniels בתאריך

Thanks! I think I did it right...if not, I will be groveling once again...  ;)

 

(about 30 minutes later...)

Yep, seemed to work great!  Thank you!!!   :D