diff --git a/db/migrate/20230823155806_create_decidim_initiatives_settings.decidim_initiatives.rb b/db/migrate/20230823155806_create_decidim_initiatives_settings.decidim_initiatives.rb index 7a3ee440..ae37d125 100644 --- a/db/migrate/20230823155806_create_decidim_initiatives_settings.decidim_initiatives.rb +++ b/db/migrate/20230823155806_create_decidim_initiatives_settings.decidim_initiatives.rb @@ -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 diff --git a/db/migrate/20230829123904_create_decidim_templates.decidim_templates.rb b/db/migrate/20230829123904_create_decidim_templates.decidim_templates.rb index 1eac5dd8..ea0d2779 100644 --- a/db/migrate/20230829123904_create_decidim_templates.decidim_templates.rb +++ b/db/migrate/20230829123904_create_decidim_templates.decidim_templates.rb @@ -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 diff --git a/db/migrate/20230922150353_add_main_image_to_decidim_budgets_budgets.decidim_budgets_booth.rb b/db/migrate/20230922150353_add_main_image_to_decidim_budgets_budgets.decidim_budgets_booth.rb index f5ce0089..12527fa0 100644 --- a/db/migrate/20230922150353_add_main_image_to_decidim_budgets_budgets.decidim_budgets_booth.rb +++ b/db/migrate/20230922150353_add_main_image_to_decidim_budgets_budgets.decidim_budgets_booth.rb @@ -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 diff --git a/db/migrate/20230922150354_create_decidim_budgets_user_data.decidim_budgets_booth.rb b/db/migrate/20230922150354_create_decidim_budgets_user_data.decidim_budgets_booth.rb index 24a44403..34cae9bc 100644 --- a/db/migrate/20230922150354_create_decidim_budgets_user_data.decidim_budgets_booth.rb +++ b/db/migrate/20230922150354_create_decidim_budgets_user_data.decidim_budgets_booth.rb @@ -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 @@ -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