Skip to content

Feature: JH db migrations (Unselected Plan)

Qian Zhang (Gary)请求将feature/jh_db_migrate合并到main-jh

More details: https://gitlab.com/gitlab-jh/gitlab/-/issues/161

Plan One: https://gitlab.com/gitlab-jh/gitlab/-/issues/161#note_661788978

Upstream MR:

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/tasks/database_tasks.rb#L82-L88

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/activerecord/lib/rails/generators/active_record/migration.rb

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

https://github.com/rails/rails/blob/6-1-stable/activerecord/lib/active_record/railties/databases.rake#L687-L689

Background Information

Issue: Reduce conflicts in database schema

Issue: Conflict-free schema version handling

Qian Zhang (Gary) 编辑于

合并请求报告

加载中