Eu estou tentando atualizar a versão do OJS do 3.3.0-17 para 3.4.0-5.
Estou encontrando o seguinte erro:
2024-05-28 19:19:52 [migration: PKP\migration\upgrade\v3_4_0\I9039_DropDeprecatedFields]
2024-05-28 19:19:52 [migration: APP\migration\upgrade\v3_4_0\I8933_EventLogLocalized]
2024-05-28 19:22:21 [migration: APP\migration\upgrade\v3_4_0\I7470_FixDeprecatedFileStage]
2024-05-28 19:22:22 [note: docs/release-notes/README-3.4.0]
2024-05-28 19:22:22 [migration: PKP\migration\upgrade\v3_4_0\I7249_UpdateUsersUniqueIndex]
2024-05-28 19:22:22 [revert migration: APP\migration\upgrade\v3_4_0\I7470_FixDeprecatedFileStage]
2024-05-28 19:22:22 [downgrade for "APP\migration\upgrade\v3_4_0\I7470_FixDeprecatedFileStage" unsupported: Downgrade n ot supported]
ERROR: Upgrade failed: DB: SQLSTATE[42704]: Undefined object: 7 ERROR: constraint "users_username" of relation "users" does not exist (SQL: ALTER TABLE users DROP CONSTRAINT users_username;)
[root@ojs4 ojs-3.4.0-5]#
Seguindo o post:
OJS upgrade error from 3.3.0.15 to 3.4.0-0 - Software Support - PKP Community Forum (sfu.ca)
Vi que o arquivo nesta versão 3.4.0-5 já estava atulizado com o IF EXISTS…
Meu banco apresenta a seguinte resposta com o comando \d+ users:
ojs=# \d+ users
Table "public.users"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
----------------------+-----------------------------+-----------+----------+----------------------------------------+----------+--------------+-------------
user_id | bigint | | not null | nextval('users_user_id_seq'::regclass) | plain | |
username | character varying(32) | | not null | | extended | |
password | character varying(255) | | not null | | extended | |
email | character varying(255) | | not null | | extended | |
url | character varying(2047) | | | | extended | |
phone | character varying(32) | | | | extended | |
mailing_address | character varying(255) | | | | extended | |
billing_address | character varying(255) | | | | extended | |
country | character varying(90) | | | | extended | |
locales | character varying(255) | | not null | '[]'::character varying | extended | |
date_last_email | timestamp without time zone | | | | plain | |
date_registered | timestamp without time zone | | not null | | plain | |
date_validated | timestamp without time zone | | | | plain | |
date_last_login | timestamp without time zone | | | | plain | |
must_change_password | smallint | | | | plain | |
auth_id | bigint | | | | plain | |
auth_str | character varying(255) | | | | extended | |
disabled | smallint | | not null | 0 | plain | |
disabled_reason | text | | | | extended | |
inline_help | smallint | | | | plain | |
gossip | text | | | | extended | |
Indexes:
"users_pkey" PRIMARY KEY, btree (user_id)
"users_email" UNIQUE, btree (email)
"users_username" UNIQUE, btree (username)
Referenced by:
TABLE "access_keys" CONSTRAINT "access_keys_user_id_foreign" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "completed_payments" CONSTRAINT "completed_payments_user_id" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE SET NULL
TABLE "edit_decisions" CONSTRAINT "edit_decisions_editor_id" FOREIGN KEY (editor_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "email_log_users" CONSTRAINT "email_log_users_user_id_foreign" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "event_log" CONSTRAINT "event_log_user_id_foreign" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "notes" CONSTRAINT "notes_user_id_foreign" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "notification_subscription_settings" CONSTRAINT "notification_subscription_settings_user_id_foreign" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELET
E CASCADE
TABLE "notifications" CONSTRAINT "notifications_user_id_foreign" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "query_participants" CONSTRAINT "query_participants_user_id_foreign" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "review_assignments" CONSTRAINT "review_assignments_reviewer_id_foreign" FOREIGN KEY (reviewer_id) REFERENCES users(user_id)
TABLE "sessions" CONSTRAINT "sessions_user_id" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "stage_assignments" CONSTRAINT "stage_assignments_user_id" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "subeditor_submission_group" CONSTRAINT "subeditor_submission_group_user_id" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "submission_comments" CONSTRAINT "submission_comments_author_id_foreign" FOREIGN KEY (author_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "submission_files" CONSTRAINT "submission_files_uploader_user_id_foreign" FOREIGN KEY (uploader_user_id) REFERENCES users(user_id) ON DELETE SET NULL
TABLE "subscriptions" CONSTRAINT "subscriptions_user_id" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "temporary_files" CONSTRAINT "temporary_files_user_id" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "user_interests" CONSTRAINT "user_interests_user_id_foreign" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "user_settings" CONSTRAINT "user_settings_user_id_foreign" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
TABLE "user_user_groups" CONSTRAINT "user_user_groups_user_id" FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE
Access method: heap
Atualizamos o PHP e o Postgresql e antes usávamos o usuário postgres, e agora, criamos o usuário ojs, pois o sistema não estava aceitando o usuário postgres.
O que podemos fazer?