From b6948c1559ec4aed192120270efbe28b7a0ea91d Mon Sep 17 00:00:00 2001
From: pabois <pierreandre.boissinot@noesya.coop>
Date: Thu, 17 Feb 2022 19:33:49 +0100
Subject: [PATCH] remove home & structure

---
 .../website/index_page/administrators.rb      | 26 +++++++++
 .../website/index_page/authors.rb             | 26 +++++++++
 .../website/index_page/communication_posts.rb | 26 +++++++++
 .../website/index_page/education_programs.rb  | 26 +++++++++
 .../communication/website/index_page/home.rb  | 26 +++++++++
 .../website/index_page/persons.rb             | 26 +++++++++
 .../website/index_page/research_articles.rb   | 26 +++++++++
 .../website/index_page/research_volumes.rb    | 26 +++++++++
 .../website/index_page/researchers.rb         | 26 +++++++++
 .../website/index_page/teachers.rb            | 26 +++++++++
 .../20220217183218_remove_unused_tables.rb    |  6 ++
 db/schema.rb                                  | 56 +------------------
 12 files changed, 267 insertions(+), 55 deletions(-)
 create mode 100644 db/migrate/20220217183218_remove_unused_tables.rb

diff --git a/app/models/communication/website/index_page/administrators.rb b/app/models/communication/website/index_page/administrators.rb
index 6663997ec..7d4b0191d 100644
--- a/app/models/communication/website/index_page/administrators.rb
+++ b/app/models/communication/website/index_page/administrators.rb
@@ -1,3 +1,29 @@
+# == Schema Information
+#
+# Table name: communication_website_index_pages
+#
+#  id                       :uuid             not null, primary key
+#  description              :text
+#  featured_image_alt       :string
+#  kind                     :integer
+#  path                     :string
+#  text                     :text
+#  title                    :string
+#  created_at               :datetime         not null
+#  updated_at               :datetime         not null
+#  communication_website_id :uuid             not null, indexed
+#  university_id            :uuid             not null, indexed
+#
+# Indexes
+#
+#  idx_comm_website_index_page_on_communication_website_id   (communication_website_id)
+#  index_communication_website_index_pages_on_university_id  (university_id)
+#
+# Foreign Keys
+#
+#  fk_rails_5cd2482227  (communication_website_id => communication_websites.id)
+#  fk_rails_7eb45227ae  (university_id => universities.id)
+#
 class Communication::Website::IndexPage::Administrators < Communication::Website::IndexPage
   def self.polymorphic_name
     'Communication::Website::IndexPage::Administrators'
diff --git a/app/models/communication/website/index_page/authors.rb b/app/models/communication/website/index_page/authors.rb
index 0153feea3..3dbde4e04 100644
--- a/app/models/communication/website/index_page/authors.rb
+++ b/app/models/communication/website/index_page/authors.rb
@@ -1,3 +1,29 @@
+# == Schema Information
+#
+# Table name: communication_website_index_pages
+#
+#  id                       :uuid             not null, primary key
+#  description              :text
+#  featured_image_alt       :string
+#  kind                     :integer
+#  path                     :string
+#  text                     :text
+#  title                    :string
+#  created_at               :datetime         not null
+#  updated_at               :datetime         not null
+#  communication_website_id :uuid             not null, indexed
+#  university_id            :uuid             not null, indexed
+#
+# Indexes
+#
+#  idx_comm_website_index_page_on_communication_website_id   (communication_website_id)
+#  index_communication_website_index_pages_on_university_id  (university_id)
+#
+# Foreign Keys
+#
+#  fk_rails_5cd2482227  (communication_website_id => communication_websites.id)
+#  fk_rails_7eb45227ae  (university_id => universities.id)
+#
 class Communication::Website::IndexPage::Authors < Communication::Website::IndexPage
   def self.polymorphic_name
     'Communication::Website::IndexPage::Authors'
diff --git a/app/models/communication/website/index_page/communication_posts.rb b/app/models/communication/website/index_page/communication_posts.rb
index ac3e62853..a4fa2e93c 100644
--- a/app/models/communication/website/index_page/communication_posts.rb
+++ b/app/models/communication/website/index_page/communication_posts.rb
@@ -1,3 +1,29 @@
+# == Schema Information
+#
+# Table name: communication_website_index_pages
+#
+#  id                       :uuid             not null, primary key
+#  description              :text
+#  featured_image_alt       :string
+#  kind                     :integer
+#  path                     :string
+#  text                     :text
+#  title                    :string
+#  created_at               :datetime         not null
+#  updated_at               :datetime         not null
+#  communication_website_id :uuid             not null, indexed
+#  university_id            :uuid             not null, indexed
+#
+# Indexes
+#
+#  idx_comm_website_index_page_on_communication_website_id   (communication_website_id)
+#  index_communication_website_index_pages_on_university_id  (university_id)
+#
+# Foreign Keys
+#
+#  fk_rails_5cd2482227  (communication_website_id => communication_websites.id)
+#  fk_rails_7eb45227ae  (university_id => universities.id)
+#
 class Communication::Website::IndexPage::CommunicationPosts < Communication::Website::IndexPage
   def self.polymorphic_name
     'Communication::Website::IndexPage::CommunicationPosts'
diff --git a/app/models/communication/website/index_page/education_programs.rb b/app/models/communication/website/index_page/education_programs.rb
index fd6fa1571..e37b33724 100644
--- a/app/models/communication/website/index_page/education_programs.rb
+++ b/app/models/communication/website/index_page/education_programs.rb
@@ -1,3 +1,29 @@
+# == Schema Information
+#
+# Table name: communication_website_index_pages
+#
+#  id                       :uuid             not null, primary key
+#  description              :text
+#  featured_image_alt       :string
+#  kind                     :integer
+#  path                     :string
+#  text                     :text
+#  title                    :string
+#  created_at               :datetime         not null
+#  updated_at               :datetime         not null
+#  communication_website_id :uuid             not null, indexed
+#  university_id            :uuid             not null, indexed
+#
+# Indexes
+#
+#  idx_comm_website_index_page_on_communication_website_id   (communication_website_id)
+#  index_communication_website_index_pages_on_university_id  (university_id)
+#
+# Foreign Keys
+#
+#  fk_rails_5cd2482227  (communication_website_id => communication_websites.id)
+#  fk_rails_7eb45227ae  (university_id => universities.id)
+#
 class Communication::Website::IndexPage::EducationPrograms < Communication::Website::IndexPage
   def self.polymorphic_name
     'Communication::Website::IndexPage::EducationPrograms'
diff --git a/app/models/communication/website/index_page/home.rb b/app/models/communication/website/index_page/home.rb
index 55f211f50..0cd4a282e 100644
--- a/app/models/communication/website/index_page/home.rb
+++ b/app/models/communication/website/index_page/home.rb
@@ -1,3 +1,29 @@
+# == Schema Information
+#
+# Table name: communication_website_index_pages
+#
+#  id                       :uuid             not null, primary key
+#  description              :text
+#  featured_image_alt       :string
+#  kind                     :integer
+#  path                     :string
+#  text                     :text
+#  title                    :string
+#  created_at               :datetime         not null
+#  updated_at               :datetime         not null
+#  communication_website_id :uuid             not null, indexed
+#  university_id            :uuid             not null, indexed
+#
+# Indexes
+#
+#  idx_comm_website_index_page_on_communication_website_id   (communication_website_id)
+#  index_communication_website_index_pages_on_university_id  (university_id)
+#
+# Foreign Keys
+#
+#  fk_rails_5cd2482227  (communication_website_id => communication_websites.id)
+#  fk_rails_7eb45227ae  (university_id => universities.id)
+#
 class Communication::Website::IndexPage::Home < Communication::Website::IndexPage
   def self.polymorphic_name
     'Communication::Website::IndexPage::Home'
diff --git a/app/models/communication/website/index_page/persons.rb b/app/models/communication/website/index_page/persons.rb
index f6685bfb7..68de15506 100644
--- a/app/models/communication/website/index_page/persons.rb
+++ b/app/models/communication/website/index_page/persons.rb
@@ -1,3 +1,29 @@
+# == Schema Information
+#
+# Table name: communication_website_index_pages
+#
+#  id                       :uuid             not null, primary key
+#  description              :text
+#  featured_image_alt       :string
+#  kind                     :integer
+#  path                     :string
+#  text                     :text
+#  title                    :string
+#  created_at               :datetime         not null
+#  updated_at               :datetime         not null
+#  communication_website_id :uuid             not null, indexed
+#  university_id            :uuid             not null, indexed
+#
+# Indexes
+#
+#  idx_comm_website_index_page_on_communication_website_id   (communication_website_id)
+#  index_communication_website_index_pages_on_university_id  (university_id)
+#
+# Foreign Keys
+#
+#  fk_rails_5cd2482227  (communication_website_id => communication_websites.id)
+#  fk_rails_7eb45227ae  (university_id => universities.id)
+#
 class Communication::Website::IndexPage::Persons < Communication::Website::IndexPage
   def self.polymorphic_name
     'Communication::Website::IndexPage::Persons'
diff --git a/app/models/communication/website/index_page/research_articles.rb b/app/models/communication/website/index_page/research_articles.rb
index 28c257651..2fb5905fd 100644
--- a/app/models/communication/website/index_page/research_articles.rb
+++ b/app/models/communication/website/index_page/research_articles.rb
@@ -1,3 +1,29 @@
+# == Schema Information
+#
+# Table name: communication_website_index_pages
+#
+#  id                       :uuid             not null, primary key
+#  description              :text
+#  featured_image_alt       :string
+#  kind                     :integer
+#  path                     :string
+#  text                     :text
+#  title                    :string
+#  created_at               :datetime         not null
+#  updated_at               :datetime         not null
+#  communication_website_id :uuid             not null, indexed
+#  university_id            :uuid             not null, indexed
+#
+# Indexes
+#
+#  idx_comm_website_index_page_on_communication_website_id   (communication_website_id)
+#  index_communication_website_index_pages_on_university_id  (university_id)
+#
+# Foreign Keys
+#
+#  fk_rails_5cd2482227  (communication_website_id => communication_websites.id)
+#  fk_rails_7eb45227ae  (university_id => universities.id)
+#
 class Communication::Website::IndexPage::ResearchArticles < Communication::Website::IndexPage
   def self.polymorphic_name
     'Communication::Website::IndexPage::ResearchArticles'
diff --git a/app/models/communication/website/index_page/research_volumes.rb b/app/models/communication/website/index_page/research_volumes.rb
index 5f7845d01..c240e4a0a 100644
--- a/app/models/communication/website/index_page/research_volumes.rb
+++ b/app/models/communication/website/index_page/research_volumes.rb
@@ -1,3 +1,29 @@
+# == Schema Information
+#
+# Table name: communication_website_index_pages
+#
+#  id                       :uuid             not null, primary key
+#  description              :text
+#  featured_image_alt       :string
+#  kind                     :integer
+#  path                     :string
+#  text                     :text
+#  title                    :string
+#  created_at               :datetime         not null
+#  updated_at               :datetime         not null
+#  communication_website_id :uuid             not null, indexed
+#  university_id            :uuid             not null, indexed
+#
+# Indexes
+#
+#  idx_comm_website_index_page_on_communication_website_id   (communication_website_id)
+#  index_communication_website_index_pages_on_university_id  (university_id)
+#
+# Foreign Keys
+#
+#  fk_rails_5cd2482227  (communication_website_id => communication_websites.id)
+#  fk_rails_7eb45227ae  (university_id => universities.id)
+#
 class Communication::Website::IndexPage::ResearchVolumes < Communication::Website::IndexPage
   def self.polymorphic_name
     'Communication::Website::IndexPage::ResearchVolumes'
diff --git a/app/models/communication/website/index_page/researchers.rb b/app/models/communication/website/index_page/researchers.rb
index 37fe8b782..727c395dd 100644
--- a/app/models/communication/website/index_page/researchers.rb
+++ b/app/models/communication/website/index_page/researchers.rb
@@ -1,3 +1,29 @@
+# == Schema Information
+#
+# Table name: communication_website_index_pages
+#
+#  id                       :uuid             not null, primary key
+#  description              :text
+#  featured_image_alt       :string
+#  kind                     :integer
+#  path                     :string
+#  text                     :text
+#  title                    :string
+#  created_at               :datetime         not null
+#  updated_at               :datetime         not null
+#  communication_website_id :uuid             not null, indexed
+#  university_id            :uuid             not null, indexed
+#
+# Indexes
+#
+#  idx_comm_website_index_page_on_communication_website_id   (communication_website_id)
+#  index_communication_website_index_pages_on_university_id  (university_id)
+#
+# Foreign Keys
+#
+#  fk_rails_5cd2482227  (communication_website_id => communication_websites.id)
+#  fk_rails_7eb45227ae  (university_id => universities.id)
+#
 class Communication::Website::IndexPage::Researchers < Communication::Website::IndexPage
   def self.polymorphic_name
     'Communication::Website::IndexPage::Researchers'
diff --git a/app/models/communication/website/index_page/teachers.rb b/app/models/communication/website/index_page/teachers.rb
index 1679da753..f979e22f5 100644
--- a/app/models/communication/website/index_page/teachers.rb
+++ b/app/models/communication/website/index_page/teachers.rb
@@ -1,3 +1,29 @@
+# == Schema Information
+#
+# Table name: communication_website_index_pages
+#
+#  id                       :uuid             not null, primary key
+#  description              :text
+#  featured_image_alt       :string
+#  kind                     :integer
+#  path                     :string
+#  text                     :text
+#  title                    :string
+#  created_at               :datetime         not null
+#  updated_at               :datetime         not null
+#  communication_website_id :uuid             not null, indexed
+#  university_id            :uuid             not null, indexed
+#
+# Indexes
+#
+#  idx_comm_website_index_page_on_communication_website_id   (communication_website_id)
+#  index_communication_website_index_pages_on_university_id  (university_id)
+#
+# Foreign Keys
+#
+#  fk_rails_5cd2482227  (communication_website_id => communication_websites.id)
+#  fk_rails_7eb45227ae  (university_id => universities.id)
+#
 class Communication::Website::IndexPage::Teachers < Communication::Website::IndexPage
   def self.polymorphic_name
     'Communication::Website::IndexPage::Teachers'
diff --git a/db/migrate/20220217183218_remove_unused_tables.rb b/db/migrate/20220217183218_remove_unused_tables.rb
new file mode 100644
index 000000000..18ff66efd
--- /dev/null
+++ b/db/migrate/20220217183218_remove_unused_tables.rb
@@ -0,0 +1,6 @@
+class RemoveUnusedTables < ActiveRecord::Migration[6.1]
+  def change
+    drop_table :communication_website_homes
+    drop_table :communication_website_structures
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index e310ee7e9..362101367 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 2022_02_15_142845) do
+ActiveRecord::Schema.define(version: 2022_02_17_183218) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "pgcrypto"
@@ -133,19 +133,6 @@ ActiveRecord::Schema.define(version: 2022_02_15_142845) do
     t.index ["website_id"], name: "index_communication_website_git_files_on_website_id"
   end
 
-  create_table "communication_website_homes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
-    t.uuid "university_id", null: false
-    t.uuid "communication_website_id", null: false
-    t.datetime "created_at", precision: 6, null: false
-    t.datetime "updated_at", precision: 6, null: false
-    t.text "github_path"
-    t.string "featured_image_alt"
-    t.text "description"
-    t.text "text"
-    t.index ["communication_website_id"], name: "idx_comm_website_homes_on_communication_website_id"
-    t.index ["university_id"], name: "index_communication_website_homes_on_university_id"
-  end
-
   create_table "communication_website_imported_authors", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "website_id", null: false
@@ -348,43 +335,6 @@ ActiveRecord::Schema.define(version: 2022_02_15_142845) do
     t.index ["university_id"], name: "index_communication_website_posts_on_university_id"
   end
 
-  create_table "communication_website_structures", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
-    t.uuid "university_id", null: false
-    t.uuid "communication_website_id", null: false
-    t.string "persons_title", default: "Équipe"
-    t.text "persons_description", default: "Liste des membres de l'équipe"
-    t.string "persons_path", default: "equipe"
-    t.string "authors_title", default: "Équipe éditoriale"
-    t.text "authors_description", default: "Liste des membres de l'équipe éditoriale"
-    t.string "authors_path", default: "equipe-editoriale"
-    t.string "researchers_title", default: "Équipe de recherche"
-    t.text "researchers_description", default: "Liste des membres de l'équipe de recherche"
-    t.string "researchers_path", default: "equipe-de-recherche"
-    t.string "administrators_title", default: "Équipe administrative"
-    t.text "administrators_description", default: "Liste des membres de l'équipe administrative"
-    t.string "administrators_path", default: "equipe-administrative"
-    t.string "teachers_title", default: "Équipe pédagogique"
-    t.text "teachers_description", default: "Liste des membres de l'équipe pédagogique"
-    t.string "teachers_path", default: "equipe-pedagogique"
-    t.string "communication_posts_title", default: "Actualités"
-    t.text "communication_posts_description", default: "Liste des actualités"
-    t.string "communication_posts_path", default: "actualites"
-    t.string "education_programs_title", default: "L'offre de formation"
-    t.text "education_programs_description", default: "Liste des formations proposées"
-    t.string "education_programs_path", default: "offre-de-formation"
-    t.string "research_volumes_title", default: "Volumes"
-    t.text "research_volumes_description", default: "Liste des volumes"
-    t.string "research_volumes_path", default: "volumes"
-    t.string "research_articles_title", default: "Articles"
-    t.text "research_articles_description", default: "Liste des articles"
-    t.string "research_articles_path", default: "articles"
-    t.datetime "created_at", precision: 6, null: false
-    t.datetime "updated_at", precision: 6, null: false
-    t.string "home_title", default: "Accueil"
-    t.index ["communication_website_id"], name: "idx_comm_website_structures_on_communication_website_id"
-    t.index ["university_id"], name: "index_communication_website_structures_on_university_id"
-  end
-
   create_table "communication_websites", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.string "name"
@@ -709,8 +659,6 @@ ActiveRecord::Schema.define(version: 2022_02_15_142845) do
   add_foreign_key "communication_website_categories", "education_programs", column: "program_id"
   add_foreign_key "communication_website_categories", "universities"
   add_foreign_key "communication_website_git_files", "communication_websites", column: "website_id"
-  add_foreign_key "communication_website_homes", "communication_websites"
-  add_foreign_key "communication_website_homes", "universities"
   add_foreign_key "communication_website_imported_authors", "communication_website_imported_websites", column: "website_id"
   add_foreign_key "communication_website_imported_authors", "universities"
   add_foreign_key "communication_website_imported_authors", "university_people", column: "author_id"
@@ -744,8 +692,6 @@ ActiveRecord::Schema.define(version: 2022_02_15_142845) do
   add_foreign_key "communication_website_posts", "communication_websites"
   add_foreign_key "communication_website_posts", "universities"
   add_foreign_key "communication_website_posts", "university_people", column: "author_id"
-  add_foreign_key "communication_website_structures", "communication_websites"
-  add_foreign_key "communication_website_structures", "universities"
   add_foreign_key "communication_websites", "universities"
   add_foreign_key "education_programs", "education_programs", column: "parent_id"
   add_foreign_key "education_programs", "universities"
-- 
GitLab