BigW Consortium Gitlab

Commit 2fdf15dd by Tiago Botelho

Edits create_project_mirror_data to add the new columns when table already exists

parent acdb7435
...@@ -4,13 +4,17 @@ class CreateProjectMirrorData < ActiveRecord::Migration ...@@ -4,13 +4,17 @@ class CreateProjectMirrorData < ActiveRecord::Migration
DOWNTIME = false DOWNTIME = false
def up def up
return if table_exists?(:project_mirror_data) if table_exists?(:project_mirror_data)
add_column :project_mirror_data, :status, :string unless column_exists?(:project_mirror_data, :status)
create_table :project_mirror_data do |t| add_column :project_mirror_data, :jid, :string unless column_exists?(:project_mirror_data, :jid)
t.references :project, index: true, foreign_key: { on_delete: :cascade } add_column :project_mirror_data, :last_error, :text unless column_exists?(:project_mirror_data, :last_error)
t.string :status else
t.string :jid create_table :project_mirror_data do |t|
t.text :last_error t.references :project, index: true, foreign_key: { on_delete: :cascade }
t.string :status
t.string :jid
t.text :last_error
end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment