meeting-room-booking-system / mrbs-code

MRBS application code
Other
120 stars 59 forks source link

Update from 1.4.9 to 1.8.0 #2727

Open jberanek opened 4 years ago

jberanek commented 4 years ago

Hi

When I try to update from version 1.4.9 to 1.8.0 but I get this error.

To complete the upgrade the database now needs to be upgraded. Please backup your database before proceeding.

Upgrading to database version: 44Uncaught exception 'MRBS\DBException' in /home/frivindrosen/public_html/booking_2020/web/lib/MRBS/DB.php at line 187
SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'uq_room_name'
SQL: -- Add some UNIQUE constraintsALTER TABLE mrbs_room ADD UNIQUE INDEX uq_room_name (area_id, room_name)
Params: Array
(
)

#0 /home/frivindrosen/public_html/booking_2020/web/upgrade.inc(164): MRBS\DB->query('-- Add some UNI...')
#1 /home/frivindrosen/public_html/booking_2020/web/upgrade.inc(67): MRBS\upgrade_database(false, '43', 63, Object(MRBS\DB_mysql))
#2 /home/frivindrosen/public_html/booking_2020/web/defaultincludes.inc(30): require_once('/home/frivindro...')
#3 /home/frivindrosen/public_html/booking_2020/web/index.php(8): require('/home/frivindro...')
#4 {main}

MRBS GET: Array
(
)
MRBS POST: Array
(
    [csrf_token] => e8975728f1de46679896e8791b13a3ec3a0cf19551a75f50d750b157db72810e
    [form_username] => ****
    [form_password] => ****
)
MRBS SESSION: Array
(
    [csrf_token] => e8975728f1de46679896e8791b13a3ec3a0cf19551a75f50d750b157db72810e
)

Fatal error: unfortunately the database is not available at the moment.

And here is a list of all the rooms, not nyons has the same name?

Aktivitetsrum - Ribe
Børns Voksenvenner 1. sa
Caféen - Østbo
Caféen (80 p.) - Østbo fr
Datastue - Ribe
Datastuen - Vindrosen
Fælleskontor 1.sal
Fælleskontor 2. sal
Fællesrum - Bramming
Grupperum 1 - Bramming
Grupperum 1 - Vindrosen
Grupperum 2 - Bramming
Grupperum 2 - Vindrosen
Grupperum 3 - Bramming
Grupperum 3 - Vindrosen
Grupperum 4 - 1. sal - Br
Grupperum 4 - Vindrosen
IT og kopirum - Esbjerg 1
kopimaskinen - Bramming
Kursusrum 1 - Østbo
Kursusrum 2 - Østbo
Kursusrum 3 - Østbo
Kursusrum 4 (1 sal) - Øst
Køkken - Bramming
Køkken - Esbjerg 2 sal
Køkken - Ribe
Køkken - Vindrosen
Køkken- Østbo fra 10-03
Mentornetværket 2. sal
Møderum 1 - Ribe
Møderum 1 (24 p.) - Esbje
Møderum 2  (12 p.) - Esbj
Møderum 2 - Ribe
Møderum 3  (10 p.) - Esbj
Møderum 3 - Ribe
Møderum 4 - Ribe
Møderum 4 (16-24 p) - Esb
Møderum 5 - Ribe
Møderum 5 (10 p.) - Esbje
Møderum 6 (6 p) - Esbjerg
Møderum 7 (10 p) - Esbjer
Møderum 8 (12 p) Sofa - E
Projektor - Esbjerg
Samtalerum - Østbo
Samtalerum - Østbo fra 10
Teleslynge - Esbjerg

Reported by: *anonymous

Original Ticket: mrbs/support-requests/2032

jberanek commented 4 years ago

Where does that list of rooms come from? Can you post a screenshot of your room names from phpMyAdmin?

Original comment by: campbell-m

jberanek commented 4 years ago

Actually, I think the problem is that you have a duplicate key name rather than a duplicate room name. Have a look at your keys in phpMyAdmin. It may be that you have delete the existing key.

Back up your database first!

Original comment by: campbell-m

jberanek commented 4 years ago

Hi

I still get the error after changing sort_key

Have included screen print from PHPmyadmin

http://snpy.in/tEXLAz

http://snpy.in/AtLOfS

/Bruno

Original comment by: *anonymous

jberanek commented 4 years ago

No, it's not the sort key column. Have a look at the indexes on the Structure tab of phpMyAdmin. I suspect you've probably already got an index called 'uq_room_name' for some reason. Try deleting it.

Original comment by: campbell-m

jberanek commented 4 years ago

Hi

It still comes with that error when I delete uq_room_name. But there is one called uq_area_name, can I try to delete it?

/Bruno

To complete the upgrade the database now needs to be upgraded. Please backup your database before proceeding.

Upgrading to database version: 44Uncaught exception 'MRBS\DBException' in /home/frivindrosen/public_html/booking_2020/web/lib/MRBS/DB.php at line 187
SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'uq_area_name'
SQL: ALTER TABLE mrbs_area ADD UNIQUE INDEX uq_area_name (area_name)
Params: Array
(
)

#0 /home/frivindrosen/public_html/booking_2020/web/upgrade.inc(164): MRBS\DB->query('\n \nALTER TABLE...')
#1 /home/frivindrosen/public_html/booking_2020/web/upgrade.inc(67): MRBS\upgrade_database(false, '43', 63, Object(MRBS\DB_mysql))
#2 /home/frivindrosen/public_html/booking_2020/web/defaultincludes.inc(30): require_once('/home/frivindro...')
#3 /home/frivindrosen/public_html/booking_2020/web/index.php(8): require('/home/frivindro...')
#4 {main}

MRBS GET: Array
(
)
MRBS POST: Array
(
    [csrf_token] => 8a5effd6fa23f52f8976794b12e2d40023813ec96cf31ce6f76d4e4d9033dd7a
    [form_username] => ****
    [form_password] => ****
)
MRBS SESSION: Array
(
    [csrf_token] => 8a5effd6fa23f52f8976794b12e2d40023813ec96cf31ce6f76d4e4d9033dd7a
)

Fatal error: unfortunately the database is not available at the moment.

Original comment by: *anonymous

jberanek commented 4 years ago

Yes, try deleting it.

Original comment by: campbell-m

jberanek commented 4 years ago

I I've tried to delete them both, but it comes with this error (uq_room_name and)

To complete the upgrade the database now needs to be upgraded. Please backup your database before proceeding.

Upgrading to database version: 44Uncaught exception 'MRBS\DBException' in /home/frivindrosen/public_html/booking_2020/web/lib/MRBS/DB.php at line 187
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'uq_name'
SQL: ALTER TABLE mrbs_users ADD UNIQUE INDEX uq_name (name)
Params: Array
(
)

#0 /home/frivindrosen/public_html/booking_2020/web/upgrade.inc(164): MRBS\DB->query('\n\nALTER TABLE m...')
#1 /home/frivindrosen/public_html/booking_2020/web/upgrade.inc(67): MRBS\upgrade_database(false, '43', 63, Object(MRBS\DB_mysql))
#2 /home/frivindrosen/public_html/booking_2020/web/defaultincludes.inc(30): require_once('/home/frivindro...')
#3 /home/frivindrosen/public_html/booking_2020/web/index.php(8): require('/home/frivindro...')
#4 {main}

MRBS GET: Array
(
)
MRBS POST: Array
(
    [csrf_token] => ddba362b63bde7d974b4e8df14f1ea39d7b911cbb4e097d92da67477ab77561d
    [form_username] => ****
    [form_password] => ****
)
MRBS SESSION: Array
(
    [csrf_token] => ddba362b63bde7d974b4e8df14f1ea39d7b911cbb4e097d92da67477ab77561d
)

Fatal error: unfortunately the database is not available at the moment.

I have also tried version 1.7.5 but it comes with this error

To complete the upgrade the database now needs to be upgraded. Please backup your database before proceeding.

Upgrading to database version: 44Uncaught exception 'MRBS\DBException' in /home/frivindrosen/public_html/booking_2020_1/web/lib/MRBS/DB.php at line 185
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'uq_name'
SQL: ALTER TABLE mrbs_users ADD UNIQUE INDEX uq_name (name)
Params: Array
(
)

#0 /home/frivindrosen/public_html/booking_2020_1/web/upgrade.inc(168): MRBS\DB->query('\n\nALTER TABLE m...')
#1 /home/frivindrosen/public_html/booking_2020_1/web/upgrade.inc(67): MRBS\upgrade_database(false, '43', 59, Object(MRBS\DB_mysql))
#2 /home/frivindrosen/public_html/booking_2020_1/web/defaultincludes.inc(33): require_once('/home/frivindro...')
#3 /home/frivindrosen/public_html/booking_2020_1/web/index.php(9): require('/home/frivindro...')
#4 {main}
MRBS GET: Array
(
)
MRBS POST: Array
(
    [csrf_token] => a47c58980242a7f28679f1eb322bcc93c94c6ef256b7e99f3699c829539c3a5f
    [form_username] => ****
    [form_password] => ****
)
MRBS SESSION: Array
(
    [csrf_token] => a47c58980242a7f28679f1eb322bcc93c94c6ef256b7e99f3699c829539c3a5f
)
Fatal error: unfortunately the database is not available at the moment.

Original comment by: *anonymous

jberanek commented 4 years ago

Duplicate entry '' for key 'uq_name'

It sounds like you've got more than one user with the username ''.

Original comment by: campbell-m

jberanek commented 4 years ago

Hi

I have found 2 user there was blank, so after deleting them it works, thanks for your help :-)

/Bruno

Original comment by: *anonymous