Merge branch 'fix_migrations_in_the_future' into 'master'
fix migrations in the future Closes #34832 See merge request !12719
This commit is contained in:
commit
bf23d6c610
|
@ -2,6 +2,8 @@ class AddGroupIdToMilestones < ActiveRecord::Migration
|
|||
DOWNTIME = false
|
||||
|
||||
def up
|
||||
return if column_exists? :milestones, :group_id
|
||||
|
||||
change_column_null :milestones, :project_id, true
|
||||
|
||||
add_column :milestones, :group_id, :integer
|
|
@ -6,6 +6,8 @@ class AddGroupMilestoneIdIndexes < ActiveRecord::Migration
|
|||
DOWNTIME = false
|
||||
|
||||
def up
|
||||
return if index_exists?(:milestones, :group_id)
|
||||
|
||||
add_concurrent_foreign_key :milestones, :namespaces, column: :group_id, on_delete: :cascade
|
||||
|
||||
add_concurrent_index :milestones, :group_id
|
|
@ -0,0 +1,10 @@
|
|||
class RemoveWrongVersionsFromSchemaVersions < ActiveRecord::Migration
|
||||
DOWNTIME = false
|
||||
|
||||
def up
|
||||
execute("DELETE FROM schema_migrations WHERE version IN ('20170723183807', '20170724184243')")
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20170724184243) do
|
||||
ActiveRecord::Schema.define(version: 20170707184244) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
|
Loading…
Reference in New Issue