Skip to content

Commit

Permalink
fix: Prevent multiple run on migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentinchampenois committed Sep 25, 2023
1 parent 73406db commit 0d1e490
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class CreateDecidimInitiativesSettings < ActiveRecord::Migration[5.2]
def change
create_table :decidim_initiatives_settings do |t|
create_table :decidim_initiatives_settings, if_not_exists: true do |t|
t.string :initiatives_order, default: "random"
t.references :decidim_organization, foreign_key: true, index: true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class CreateDecidimTemplates < ActiveRecord::Migration[5.2]
def change
create_table :decidim_templates_templates do |t|
create_table :decidim_templates_templates, if_not_exists: true do |t|
t.integer :decidim_organization_id, null: false, index: { name: "index_decidim_templates_organization" }
t.references :templatable, polymorphic: true, index: { name: "index_decidim_templates_templatable" }
t.jsonb :name, null: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

class AddMainImageToDecidimBudgetsBudgets < ActiveRecord::Migration[6.1]
def change
add_column :decidim_budgets_budgets, :main_image, :string
add_column :decidim_budgets_budgets, :main_image, :string, if_not_exists: true
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class CreateDecidimBudgetsUserData < ActiveRecord::Migration[6.1]
def change
create_table :decidim_budgets_user_data do |t|
create_table :decidim_budgets_user_data, if_not_exists: true do |t|
t.jsonb :metadata
t.boolean :affirm_statements_are_correct, default: false
t.references :decidim_component, null: false, indec: true
Expand All @@ -12,6 +12,6 @@ def change
t.timestamps
end

add_index :decidim_budgets_user_data, [:decidim_component_id, :decidim_user_id], unique: true, name: "decidim_budgets_user_data_unique_user_and_component"
add_index :decidim_budgets_user_data, [:decidim_component_id, :decidim_user_id], unique: true, name: "decidim_budgets_user_data_unique_user_and_component", if_not_exists: true
end
end

0 comments on commit 0d1e490

Please sign in to comment.