Content
You are here:
Foreign Key Issue while migrating from mysql to postgres
Added by Ming M almost 3 years ago
Hi,
we want to upgrade from Openproject 9.0.4 (mysql) to the latest current Openproject version with PostgreSQL . There for we are using the /app/script/migration/migrate-from-pre-8.sh (https://www.openproject.org/docs/installation-and-operations/misc/upgrading-older-openproject-versions/).
But during step 1.6) Migrating database from 6 to 7 ... (NOOP if already on 7)
we get the following issue
Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails: DROP TABLE `projects`
Can somebody help us or have the same issue?
Here the full output of the migration script:
1) Migrate to 8 in MySQL
1.1) Starting mysql database...
already running
1.2) Starting OpenProject 7
OpenProject already running
1.3) Starting OpenProject 8
OpenProject already running
1.4) Creating MySQL database for migration from OP 7 to 8
Created database
1.5) Importing MySQL dump (mysql-dump-20220120181334.sql)
Imported database
1.6) Migrating database from 6 to 7 ... (NOOP if already on 7)
[auth_saml] Missing settings from '/usr/src/app/config/plugins/auth_saml/settings.yml', skipping omniauth registration.
hook registered
== 0 AggregatedMigrations: migrating ==========================================
-- create_table("attachments", {:force=>true})
-> 0.0771s
-- add_index("attachments", ["author_id"], {:name=>"index_attachments_on_author_id"})
-> 0.0545s
-- add_index("attachments", ["container_id", "container_type"], {:name=>"index_attachments_on_container_id_and_container_type"})
-> 0.0535s
-- add_index("attachments", ["created_on"], {:name=>"index_attachments_on_created_on"})
-> 0.0534s
-- create_table("auth_sources", {:force=>true})
-> 0.0884s
-- add_index("auth_sources", ["id", "type"], {:name=>"index_auth_sources_on_id_and_type"})
-> 0.0545s
-- create_table("boards", {:force=>true})
-> 0.0634s
-- add_index("boards", ["last_message_id"], {:name=>"index_boards_on_last_message_id"})
-> 0.0536s
-- add_index("boards", ["project_id"], {:name=>"boards_project_id"})
-> 0.0540s
-- create_table("changes", {:force=>true})
-> 0.0864s
-- add_index("changes", ["changeset_id"], {:name=>"changesets_changeset_id"})
-> 0.0522s
-- create_table("changesets", {:force=>true})
-> 0.0860s
-- add_index("changesets", ["committed_on"], {:name=>"index_changesets_on_committed_on"})
-> 0.0550s
-- add_index("changesets", ["repository_id", "revision"], {:name=>"changesets_repos_rev", :unique=>true})
-> 0.0509s
-- add_index("changesets", ["repository_id", "scmid"], {:name=>"changesets_repos_scmid"})
-> 0.0538s
-- add_index("changesets", ["repository_id"], {:name=>"index_changesets_on_repository_id"})
-> 0.0524s
-- add_index("changesets", ["user_id"], {:name=>"index_changesets_on_user_id"})
-> 0.0529s
-- create_table("changesets_issues", {:id=>false, :force=>true})
-> 0.0532s
-- add_index("changesets_issues", ["changeset_id", "issue_id"], {:name=>"changesets_issues_ids", :unique=>true})
-> 0.0927s
-- create_table("comments", {:force=>true})
-> 0.0870s
-- add_index("comments", ["author_id"], {:name=>"index_comments_on_author_id"})
-> 0.0543s
-- add_index("comments", ["commented_id", "commented_type"], {:name=>"index_comments_on_commented_id_and_commented_type"})
-> 0.0538s
-- create_table("custom_fields", {:force=>true})
-> 0.0876s
-- add_index("custom_fields", ["id", "type"], {:name=>"index_custom_fields_on_id_and_type"})
-> 0.0538s
-- create_table("custom_fields_projects", {:id=>false, :force=>true})
-> 0.0892s
-- add_index("custom_fields_projects", ["custom_field_id", "project_id"], {:name=>"index_custom_fields_projects_on_custom_field_id_and_project_id"})
-> 0.0529s
-- create_table("custom_fields_trackers", {:id=>false, :force=>true})
-> 0.0633s
-- add_index("custom_fields_trackers", ["custom_field_id", "tracker_id"], {:name=>"index_custom_fields_trackers_on_custom_field_id_and_tracker_id"})
-> 0.0524s
-- create_table("custom_values", {:force=>true})
-> 0.0883s
-- add_index("custom_values", ["custom_field_id"], {:name=>"index_custom_values_on_custom_field_id"})
-> 0.0536s
-- add_index("custom_values", ["customized_type", "customized_id"], {:name=>"custom_values_customized"})
-> 0.0537s
-- create_table("documents", {:force=>true})
-> 0.1042s
-- add_index("documents", ["category_id"], {:name=>"index_documents_on_category_id"})
-> 0.0528s
-- add_index("documents", ["created_on"], {:name=>"index_documents_on_created_on"})
-> 0.0529s
-- add_index("documents", ["project_id"], {:name=>"documents_project_id"})
-> 0.0530s
-- create_table("enabled_modules", {:force=>true})
-> 0.0880s
-- add_index("enabled_modules", ["project_id"], {:name=>"enabled_modules_project_id"})
-> 0.0540s
-- create_table("enumerations", {:force=>true})
-> 0.0880s
-- add_index("enumerations", ["id", "type"], {:name=>"index_enumerations_on_id_and_type"})
-> 0.0533s
-- add_index("enumerations", ["project_id"], {:name=>"index_enumerations_on_project_id"})
-> 0.0537s
-- create_table("groups_users", {:id=>false, :force=>true})
-> 0.0625s
-- add_index("groups_users", ["group_id", "user_id"], {:name=>"groups_users_ids", :unique=>true})
-> 0.0968s
-- create_table("issue_categories", {:force=>true})
-> 0.0634s
-- add_index("issue_categories", ["assigned_to_id"], {:name=>"index_issue_categories_on_assigned_to_id"})
-> 0.0540s
-- add_index("issue_categories", ["project_id"], {:name=>"issue_categories_project_id"})
-> 0.0547s
-- create_table("issue_relations", {:force=>true})
-> 0.0628s
-- add_index("issue_relations", ["issue_from_id"], {:name=>"index_issue_relations_on_issue_from_id"})
-> 0.0573s
-- add_index("issue_relations", ["issue_to_id"], {:name=>"index_issue_relations_on_issue_to_id"})
-> 0.0554s
-- create_table("issue_statuses", {:force=>true})
-> 0.0621s
-- add_index("issue_statuses", ["is_closed"], {:name=>"index_issue_statuses_on_is_closed"})
-> 0.0549s
-- add_index("issue_statuses", ["is_default"], {:name=>"index_issue_statuses_on_is_default"})
-> 0.0529s
-- add_index("issue_statuses", ["position"], {:name=>"index_issue_statuses_on_position"})
-> 0.0542s
-- create_table("issues", {:force=>true})
-> 0.0626s
-- add_index("issues", ["assigned_to_id"], {:name=>"index_issues_on_assigned_to_id"})
-> 0.0550s
-- add_index("issues", ["author_id"], {:name=>"index_issues_on_author_id"})
-> 0.0532s
-- add_index("issues", ["category_id"], {:name=>"index_issues_on_category_id"})
-> 0.0544s
-- add_index("issues", ["created_on"], {:name=>"index_issues_on_created_on"})
-> 0.0534s
-- add_index("issues", ["fixed_version_id"], {:name=>"index_issues_on_fixed_version_id"})
-> 0.0549s
-- add_index("issues", ["priority_id"], {:name=>"index_issues_on_priority_id"})
-> 0.0536s
-- add_index("issues", ["project_id"], {:name=>"issues_project_id"})
-> 0.0520s
-- add_index("issues", ["root_id", "lft", "rgt"], {:name=>"index_issues_on_root_id_and_lft_and_rgt"})
-> 0.0540s
-- add_index("issues", ["status_id"], {:name=>"index_issues_on_status_id"})
-> 0.0537s
-- add_index("issues", ["tracker_id"], {:name=>"index_issues_on_tracker_id"})
-> 0.0553s
-- create_table("journal_details", {:force=>true})
-> 0.0659s
-- add_index("journal_details", ["journal_id"], {:name=>"journal_details_journal_id"})
-> 0.0544s
-- create_table("journals", {:force=>true})
-> 0.0905s
-- add_index("journals", ["activity_type"], {:name=>"index_journals_on_activity_type"})
-> 0.0532s
-- add_index("journals", ["created_at"], {:name=>"index_journals_on_created_at"})
-> 0.0536s
-- add_index("journals", ["created_at"], {:name=>"index_journals_on_created_on"})
-> 0.0533s
-- add_index("journals", ["journaled_id"], {:name=>"index_journals_on_journaled_id"})
-> 0.0528s
-- add_index("journals", ["journaled_id"], {:name=>"index_journals_on_journalized_id"})
-> 0.0540s
-- add_index("journals", ["type"], {:name=>"index_journals_on_type"})
-> 0.0555s
-- add_index("journals", ["user_id"], {:name=>"index_journals_on_user_id"})
-> 0.0531s
-- create_table("member_roles", {:force=>true})
-> 0.0911s
-- add_index("member_roles", ["member_id"], {:name=>"index_member_roles_on_member_id"})
-> 0.0555s
-- add_index("member_roles", ["role_id"], {:name=>"index_member_roles_on_role_id"})
-> 0.0558s
-- create_table("members", {:force=>true})
-> 0.0890s
-- add_index("members", ["project_id"], {:name=>"index_members_on_project_id"})
-> 0.0533s
-- add_index("members", ["user_id", "project_id"], {:name=>"index_members_on_user_id_and_project_id", :unique=>true})
-> 0.0551s
-- add_index("members", ["user_id"], {:name=>"index_members_on_user_id"})
-> 0.0556s
-- create_table("messages", {:force=>true})
-> 0.0900s
-- add_index("messages", ["author_id"], {:name=>"index_messages_on_author_id"})
-> 0.0525s
-- add_index("messages", ["board_id"], {:name=>"messages_board_id"})
-> 0.0547s
-- add_index("messages", ["created_on"], {:name=>"index_messages_on_created_on"})
-> 0.0546s
-- add_index("messages", ["last_reply_id"], {:name=>"index_messages_on_last_reply_id"})
-> 0.0542s
-- add_index("messages", ["parent_id"], {:name=>"messages_parent_id"})
-> 0.0522s
-- create_table("news", {:force=>true})
-> 0.0912s
-- add_index("news", ["author_id"], {:name=>"index_news_on_author_id"})
-> 0.0524s
-- add_index("news", ["created_on"], {:name=>"index_news_on_created_on"})
-> 0.0533s
-- add_index("news", ["project_id"], {:name=>"news_project_id"})
-> 0.0563s
-- create_table("open_id_authentication_associations", {:force=>true})
-> 0.0621s
-- create_table("open_id_authentication_nonces", {:force=>true})
-> 0.0607s
-- create_table("projects", {:force=>true})
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails: DROP TABLE `projects`
/usr/local/bundle/gems/mysql2-0.4.9/lib/mysql2/client.rb:120:in `_query'
/usr/local/bundle/gems/mysql2-0.4.9/lib/mysql2/client.rb:120:in `block in query'
/usr/local/bundle/gems/mysql2-0.4.9/lib/mysql2/client.rb:119:in `handle_interrupt'
/usr/local/bundle/gems/mysql2-0.4.9/lib/mysql2/client.rb:119:in `query'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:218:in `block in execute'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_adapter.rb:590:in `block in log'
/usr/local/bundle/gems/activesupport-5.0.6/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_adapter.rb:583:in `log'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:218:in `execute'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/mysql/database_statements.rb:31:in `execute'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:466:in `drop_table'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/schema_statements.rb:275:in `create_table'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:423:in `create_table'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:846:in `block in method_missing'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:815:in `block in say_with_time'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:815:in `say_with_time'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:835:in `method_missing'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration/compatibility.rb:32:in `create_table'
/usr/src/app/db/migrate/000_aggregated_migrations.rb:625:in `run_aggregated_migrations'
/usr/src/app/db/migrate/000_aggregated_migrations.rb:241:in `up'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:792:in `exec_migration'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:773:in `block (2 levels) in migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:772:in `block in migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in `with_connection'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:771:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:951:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1232:in `block in execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1302:in `ddl_transaction'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1231:in `execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1203:in `block in migrate_without_lock'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1202:in `each'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1202:in `migrate_without_lock'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1150:in `block in migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1319:in `with_advisory_lock'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1150:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1006:in `up'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:984:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/tasks/database_tasks.rb:163:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
/usr/local/bundle/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/usr/local/bundle/bin/bundle:23:in `load'
/usr/local/bundle/bin/bundle:23:in `<main>'
ActiveRecord::StatementInvalid: Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails: DROP TABLE `projects`
/usr/local/bundle/gems/mysql2-0.4.9/lib/mysql2/client.rb:120:in `_query'
/usr/local/bundle/gems/mysql2-0.4.9/lib/mysql2/client.rb:120:in `block in query'
/usr/local/bundle/gems/mysql2-0.4.9/lib/mysql2/client.rb:119:in `handle_interrupt'
/usr/local/bundle/gems/mysql2-0.4.9/lib/mysql2/client.rb:119:in `query'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:218:in `block in execute'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_adapter.rb:590:in `block in log'
/usr/local/bundle/gems/activesupport-5.0.6/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_adapter.rb:583:in `log'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:218:in `execute'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/mysql/database_statements.rb:31:in `execute'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:466:in `drop_table'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/schema_statements.rb:275:in `create_table'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:423:in `create_table'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:846:in `block in method_missing'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:815:in `block in say_with_time'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:815:in `say_with_time'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:835:in `method_missing'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration/compatibility.rb:32:in `create_table'
/usr/src/app/db/migrate/000_aggregated_migrations.rb:625:in `run_aggregated_migrations'
/usr/src/app/db/migrate/000_aggregated_migrations.rb:241:in `up'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:792:in `exec_migration'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:773:in `block (2 levels) in migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:772:in `block in migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in `with_connection'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:771:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:951:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1232:in `block in execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1302:in `ddl_transaction'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1231:in `execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1203:in `block in migrate_without_lock'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1202:in `each'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1202:in `migrate_without_lock'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1150:in `block in migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1319:in `with_advisory_lock'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1150:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1006:in `up'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:984:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/tasks/database_tasks.rb:163:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
/usr/local/bundle/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/usr/local/bundle/bin/bundle:23:in `load'
/usr/local/bundle/bin/bundle:23:in `<main>'
Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails
/usr/local/bundle/gems/mysql2-0.4.9/lib/mysql2/client.rb:120:in `_query'
/usr/local/bundle/gems/mysql2-0.4.9/lib/mysql2/client.rb:120:in `block in query'
/usr/local/bundle/gems/mysql2-0.4.9/lib/mysql2/client.rb:119:in `handle_interrupt'
/usr/local/bundle/gems/mysql2-0.4.9/lib/mysql2/client.rb:119:in `query'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:218:in `block in execute'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_adapter.rb:590:in `block in log'
/usr/local/bundle/gems/activesupport-5.0.6/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_adapter.rb:583:in `log'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:218:in `execute'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/mysql/database_statements.rb:31:in `execute'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:466:in `drop_table'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/schema_statements.rb:275:in `create_table'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:423:in `create_table'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:846:in `block in method_missing'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:815:in `block in say_with_time'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:815:in `say_with_time'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:835:in `method_missing'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration/compatibility.rb:32:in `create_table'
/usr/src/app/db/migrate/000_aggregated_migrations.rb:625:in `run_aggregated_migrations'
/usr/src/app/db/migrate/000_aggregated_migrations.rb:241:in `up'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:792:in `exec_migration'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:773:in `block (2 levels) in migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:772:in `block in migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in `with_connection'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:771:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:951:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1232:in `block in execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1302:in `ddl_transaction'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1231:in `execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1203:in `block in migrate_without_lock'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1202:in `each'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1202:in `migrate_without_lock'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1150:in `block in migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1319:in `with_advisory_lock'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1150:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:1006:in `up'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/migration.rb:984:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/tasks/database_tasks.rb:163:in `migrate'
/usr/local/bundle/gems/activerecord-5.0.6/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
/usr/local/bundle/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/usr/local/bundle/bin/bundle:23:in `load'
/usr/local/bundle/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
Could not migrate database
Thanks in advance for your support.
Best Regards
Ming