Feature: JH db migrations (Unselected Plan)
More details: https://gitlab.com/gitlab-jh/gitlab/-/issues/161
Plan One: https://gitlab.com/gitlab-jh/gitlab/-/issues/161#note_661788978
Upstream MR:
-
Refactor database task dir for spec https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69160 -
Update .rubocop.yml for JiHu db files https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70381 -
Refactor DEFAULT_SCHEMA_MIGRATIONS_PATH https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70345 -
Refactor migrations_paths of schema spec https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70455
Goals
Generator
bundle exec rails g migration create_jh_only
-
Created jh/db/migrate/20210826052352_create_jh_only.rb
Migration
bundle exec rails db:migrate
-
Created jh/db/schema_migrations/20210826052352
-
Updated jh/db/structure.sql
CE/EE upgrade to JH
-
Upgrade from a version before 13.10.0 -
Upgrade from a version after 13.10.0 ⚠ ️
Rails source code reference
https://github.com/rails/rails/blob/6-1-stable/activerecord/lib/active_record/migration.rb#L1217
https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/engine/configuration.rb#L64-L66
https://github.com/rails/rails/blob/6-1-stable/activerecord/lib/active_record/railtie.rb#L38-L50
https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/generators/migration.rb#L56-L74
Background Information
由 Qian Zhang (Gary) 编辑于