【问题标题】:gitlab migrate DB but db/schema.rb not changegitlab 迁移数据库但 db/schema.rb 没有改变
【发布时间】:2016-02-14 00:16:39
【问题描述】:

我刚刚将 gitlab(源代码)从 7.6 更新到 7.7.2,但出现了问题。

我点击了这个链接:https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/7.6-to-7.7.md

有步骤:

  1. 结帐版本:7-7-stable(之前,我运行结帐 -- db/schema.rb)

结帐版本完成后,我在 db/schema.rb 中看到有版本:

ActiveRecord::Schema.define(version: 20150116234544) do

和表:protected_branches 的列如下:

create_table "protected_branches", force: true do |t|
    t.integer  "project_id",                          null: false
    t.string   "name",                                null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.boolean  "developers_can_push", default: false, null: false
  end

  add_index "protected_branches", ["project_id"], name: "index_protected_branches_on_project_id", using: :btree
  1. 运行命令迁移数据库

bundle exec rake db:migrate RAILS_ENV=production

当我运行上面的命令时,我看到这个文件 db/schema.rb 在这个表 protected_branches 中不包含列 developers_can_push。这个文件的版本是:

ActiveRecord::Schema.define(version: 20150812080800) do

所以,当我再次启动 gitlab、nginx 时,我不会推送到 gitlab 服务器,因为出了点问题 - 此列 developer_can_push 不存在。

请帮我解决这个问题。

谢谢!

【问题讨论】:

    标签: ruby-on-rails git postgresql centos gitlab


    【解决方案1】:

    在这里,检查这是否可行。

    clipchamp.com/transcode

    在再次尝试 db:migrate:status 之后,它显示所有迁移为 'up' 在 gitlab-ctr 停止并启动 gitlab 现在正在工作!

    【讨论】:

    • 我已经尝试过 db:migrate:status - 一切都完成了,但是当启动 gitlab 时,什么都没有。 up 20141217125223 将所有者添加到应用程序 up 20141223135007 将导入数据添加到项目表 up 20141226080412 添加开发人员可以推送到受保护的分支 up 20150108073740 创建应用程序设置 up 20150116234544 添加应用程序设置的主页网址
    • 是的。我确实重启了 gitlab。
    猜你喜欢
    • 2013-12-26
    • 2018-03-11
    • 2017-02-28
    • 2014-04-17
    • 2015-08-03
    • 2016-05-21
    • 2018-11-11
    • 2023-04-01
    • 1970-01-01
    相关资源
    最近更新 更多