[obs-commits] [openSUSE/open-build-service] 249273: [db] Hardcode encoding in old migrations
Branch: refs/heads/revert-5491-revert-5419-fix_3547 Home: https://github.com/openSUSE/open-build-service Commit: 249273e79c637801e43665f658940af10c0fb899 https://github.com/openSUSE/open-build-service/commit/249273e79c637801e43665... Author: Stephan Kulow <coolo@suse.de> Date: 2018-07-26 (Thu, 26 Jul 2018) Changed paths: M src/api/.rubocop.yml M src/api/db/migrate/20140624101042_add_package_tracking.rb M src/api/db/migrate/20140627071042_product_media_tracking.rb M src/api/db/migrate/20140709071042_product_medium_tracking.rb M src/api/db/migrate/20140717101042_add_updateinfo_tracking.rb M src/api/db/migrate/20140729101042_updateinfo_tracking_second_attempt.rb M src/api/db/migrate/20140801071042_product_version_tracking.rb M src/api/db/migrate/20140903125426_add_generic_operation_history.rb M src/api/db/migrate/20141110105426_fix_product_media_uniq_index.rb M src/api/db/migrate/20170306084558_change_repositories_remote_project_name_to_not_null.rb M src/api/db/migrate/20170619111734_alter_notifications_to_use_polymorphic.rb M src/api/db/migrate/20171218160607_create_ec2_configuration.rb Log Message: ----------- [db] Hardcode encoding in old migrations The old migrations are tested on current database and database settings. This makes it bound to the current encoding - and that is utf8mb4. But without Barracuda tables you can't have varchars. So hardcode the encoding used in 2017 by using execute instead of rails helpers On create it's easy to add, but renames and other column changes need to be changed to executes as they otherwise drop the charset Commit: 854bf09be991e67f99a3b0caaa5afba9aaf39448 https://github.com/openSUSE/open-build-service/commit/854bf09be991e67f99a3b0... Author: Stephan Kulow <coolo@suse.de> Date: 2018-07-26 (Thu, 26 Jul 2018) Changed paths: M ReleaseNotes-2.10 M src/api/config/database.yml.example A src/api/db/migrate/20180720082742_switch_to_utf8mb4.rb M src/api/db/structure.sql M src/api/script/api_test_in_spec.sh M src/api/spec/models/comment_spec.rb Log Message: ----------- [frontend] Store comments.body as utf8mb4 Allows emojis and fixes #3547 This charset change requires mysql 5.5, which was released 2012 but is still not the default. See more details about the problem on https://railsmachine.com/articles/2017/05/19/converting-a-rails-database-to-... I borrowed the migration from there - but limited it to comments, the charset is backward compatible, but requires changes to database.yml in production (to store emojis not to apply the migration) Compare: https://github.com/openSUSE/open-build-service/compare/841230217109...854bf0... **NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.
participants (1)
-
Stephan Kulow