Skip to content

Commit

Permalink
Migrations for term customizer
Browse files Browse the repository at this point in the history
  • Loading branch information
HHassig committed Oct 9, 2024
1 parent 90d6786 commit bf0f6e4
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true
# This migration comes from decidim_term_customizer (originally 20190217132503)

class CreateDecidimTermCustomizerTranslationSets < ActiveRecord::Migration[5.2]
def change
create_table :decidim_term_customizer_translation_sets do |t|
t.jsonb :name
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true
# This migration comes from decidim_term_customizer (originally 20190217132654)

class CreateDecidimTermCustomizerTranslations < ActiveRecord::Migration[5.2]
def change
create_table :decidim_term_customizer_translations do |t|
t.string :locale
t.string :key
t.text :value

t.references(
:translation_set,
null: false,
foreign_key: { to_table: :decidim_term_customizer_translation_sets },
index: { name: "decidim_term_customizer_translation_translation_set" }
)
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true
# This migration comes from decidim_term_customizer (originally 20190217132726)

class CreateDecidimTermCustomizerConstraints < ActiveRecord::Migration[5.2]
def change
create_table :decidim_term_customizer_constraints do |t|
t.references :decidim_organization, null: false, foreign_key: true, index: { name: "decidim_term_customizer_constraint_organization" }
t.references :subject, polymorphic: true, index: { name: "decidim_term_customizer_constraint_subject" }

t.references(
:translation_set,
null: false,
foreign_key: { to_table: :decidim_term_customizer_translation_sets },
index: { name: "decidim_term_customizer_constraint_translation_set" }
)
end
end
end
27 changes: 26 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2024_01_11_100756) do
ActiveRecord::Schema.define(version: 2024_10_09_184554) do

# These are extensions that must be enabled in order to support this database
enable_extension "ltree"
Expand Down Expand Up @@ -1743,6 +1743,28 @@
t.index ["templatable_type", "templatable_id"], name: "index_decidim_templates_templatable"
end

create_table "decidim_term_customizer_constraints", force: :cascade do |t|
t.bigint "decidim_organization_id", null: false
t.string "subject_type"
t.bigint "subject_id"
t.bigint "translation_set_id", null: false
t.index ["decidim_organization_id"], name: "decidim_term_customizer_constraint_organization"
t.index ["subject_type", "subject_id"], name: "decidim_term_customizer_constraint_subject"
t.index ["translation_set_id"], name: "decidim_term_customizer_constraint_translation_set"
end

create_table "decidim_term_customizer_translation_sets", force: :cascade do |t|
t.jsonb "name"
end

create_table "decidim_term_customizer_translations", force: :cascade do |t|
t.string "locale"
t.string "key"
t.text "value"
t.bigint "translation_set_id", null: false
t.index ["translation_set_id"], name: "decidim_term_customizer_translation_translation_set"
end

create_table "decidim_user_blocks", force: :cascade do |t|
t.bigint "decidim_user_id"
t.integer "blocking_user_id"
Expand Down Expand Up @@ -2013,6 +2035,9 @@
add_foreign_key "decidim_scopes", "decidim_scope_types", column: "scope_type_id"
add_foreign_key "decidim_scopes", "decidim_scopes", column: "parent_id"
add_foreign_key "decidim_static_pages", "decidim_organizations"
add_foreign_key "decidim_term_customizer_constraints", "decidim_organizations"
add_foreign_key "decidim_term_customizer_constraints", "decidim_term_customizer_translation_sets", column: "translation_set_id"
add_foreign_key "decidim_term_customizer_translations", "decidim_term_customizer_translation_sets", column: "translation_set_id"
add_foreign_key "decidim_user_blocks", "decidim_users"
add_foreign_key "decidim_user_blocks", "decidim_users", column: "blocking_user_id"
add_foreign_key "decidim_user_moderations", "decidim_users"
Expand Down

0 comments on commit bf0f6e4

Please sign in to comment.