From d8a8f7e553ed0a838b303b426d8b887e351e930d Mon Sep 17 00:00:00 2001 From: pabois <pierreandre.boissinot@noesya.coop> Date: Thu, 3 Mar 2022 14:00:28 +0100 Subject: [PATCH] close #235 --- app/models/communication/website.rb | 33 +++++++------------ .../communication/website/configs/base_url.rb | 33 +++++++------------ .../website/configs/permalinks.rb | 33 +++++++------------ ...9_remove_unused_static_paths_in_website.rb | 13 ++++++++ db/schema.rb | 11 +------ test/fixtures/communication/websites.yml | 33 +++++++------------ 6 files changed, 62 insertions(+), 94 deletions(-) create mode 100644 db/migrate/20220303125819_remove_unused_static_paths_in_website.rb diff --git a/app/models/communication/website.rb b/app/models/communication/website.rb index b72ab03ad..34d1eb1cf 100644 --- a/app/models/communication/website.rb +++ b/app/models/communication/website.rb @@ -2,27 +2,18 @@ # # Table name: communication_websites # -# id :uuid not null, primary key -# about_type :string indexed => [about_id] -# access_token :string -# git_endpoint :string -# git_provider :integer default("github") -# name :string -# repository :string -# static_pathname_administrators :string default("administrators") -# static_pathname_authors :string default("authors") -# static_pathname_posts :string default("posts") -# static_pathname_programs :string default("programs") -# static_pathname_research_articles :string default("articles") -# static_pathname_research_volumes :string default("volumes") -# static_pathname_researchers :string default("researchers") -# static_pathname_staff :string default("staff") -# static_pathname_teachers :string default("teachers") -# url :string -# created_at :datetime not null -# updated_at :datetime not null -# about_id :uuid indexed => [about_type] -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# about_type :string indexed => [about_id] +# access_token :string +# git_endpoint :string +# git_provider :integer default("github") +# name :string +# repository :string +# url :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid indexed => [about_type] +# university_id :uuid not null, indexed # # Indexes # diff --git a/app/models/communication/website/configs/base_url.rb b/app/models/communication/website/configs/base_url.rb index ffae45935..a2510c716 100644 --- a/app/models/communication/website/configs/base_url.rb +++ b/app/models/communication/website/configs/base_url.rb @@ -2,27 +2,18 @@ # # Table name: communication_websites # -# id :uuid not null, primary key -# about_type :string indexed => [about_id] -# access_token :string -# git_endpoint :string -# git_provider :integer default("github") -# name :string -# repository :string -# static_pathname_administrators :string default("administrators") -# static_pathname_authors :string default("authors") -# static_pathname_posts :string default("posts") -# static_pathname_programs :string default("programs") -# static_pathname_research_articles :string default("articles") -# static_pathname_research_volumes :string default("volumes") -# static_pathname_researchers :string default("researchers") -# static_pathname_staff :string default("staff") -# static_pathname_teachers :string default("teachers") -# url :string -# created_at :datetime not null -# updated_at :datetime not null -# about_id :uuid indexed => [about_type] -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# about_type :string indexed => [about_id] +# access_token :string +# git_endpoint :string +# git_provider :integer default("github") +# name :string +# repository :string +# url :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid indexed => [about_type] +# university_id :uuid not null, indexed # # Indexes # diff --git a/app/models/communication/website/configs/permalinks.rb b/app/models/communication/website/configs/permalinks.rb index 0f269522a..04a9cc323 100644 --- a/app/models/communication/website/configs/permalinks.rb +++ b/app/models/communication/website/configs/permalinks.rb @@ -2,27 +2,18 @@ # # Table name: communication_websites # -# id :uuid not null, primary key -# about_type :string indexed => [about_id] -# access_token :string -# git_endpoint :string -# git_provider :integer default("github") -# name :string -# repository :string -# static_pathname_administrators :string default("administrators") -# static_pathname_authors :string default("authors") -# static_pathname_posts :string default("posts") -# static_pathname_programs :string default("programs") -# static_pathname_research_articles :string default("articles") -# static_pathname_research_volumes :string default("volumes") -# static_pathname_researchers :string default("researchers") -# static_pathname_staff :string default("staff") -# static_pathname_teachers :string default("teachers") -# url :string -# created_at :datetime not null -# updated_at :datetime not null -# about_id :uuid indexed => [about_type] -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# about_type :string indexed => [about_id] +# access_token :string +# git_endpoint :string +# git_provider :integer default("github") +# name :string +# repository :string +# url :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid indexed => [about_type] +# university_id :uuid not null, indexed # # Indexes # diff --git a/db/migrate/20220303125819_remove_unused_static_paths_in_website.rb b/db/migrate/20220303125819_remove_unused_static_paths_in_website.rb new file mode 100644 index 000000000..ec18acb2f --- /dev/null +++ b/db/migrate/20220303125819_remove_unused_static_paths_in_website.rb @@ -0,0 +1,13 @@ +class RemoveUnusedStaticPathsInWebsite < ActiveRecord::Migration[6.1] + def change + remove_column :communication_websites, :static_pathname_administrators + remove_column :communication_websites, :static_pathname_authors + remove_column :communication_websites, :static_pathname_posts + remove_column :communication_websites, :static_pathname_programs + remove_column :communication_websites, :static_pathname_research_articles + remove_column :communication_websites, :static_pathname_research_volumes + remove_column :communication_websites, :static_pathname_researchers + remove_column :communication_websites, :static_pathname_staff + remove_column :communication_websites, :static_pathname_teachers + end +end diff --git a/db/schema.rb b/db/schema.rb index 8afbdb0f0..0c898ee22 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_03_02_140425) do +ActiveRecord::Schema.define(version: 2022_03_03_125819) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -356,15 +356,6 @@ ActiveRecord::Schema.define(version: 2022_03_02_140425) do t.string "repository" t.string "about_type" t.uuid "about_id" - t.string "static_pathname_authors", default: "authors" - t.string "static_pathname_posts", default: "posts" - t.string "static_pathname_programs", default: "programs" - t.string "static_pathname_staff", default: "staff" - t.string "static_pathname_research_volumes", default: "volumes" - t.string "static_pathname_research_articles", default: "articles" - t.string "static_pathname_administrators", default: "administrators" - t.string "static_pathname_researchers", default: "researchers" - t.string "static_pathname_teachers", default: "teachers" t.integer "git_provider", default: 0 t.string "git_endpoint" t.index ["about_type", "about_id"], name: "index_communication_websites_on_about" diff --git a/test/fixtures/communication/websites.yml b/test/fixtures/communication/websites.yml index 33965b28a..aea91b89a 100644 --- a/test/fixtures/communication/websites.yml +++ b/test/fixtures/communication/websites.yml @@ -2,27 +2,18 @@ # # Table name: communication_websites # -# id :uuid not null, primary key -# about_type :string indexed => [about_id] -# access_token :string -# git_endpoint :string -# git_provider :integer default("github") -# name :string -# repository :string -# static_pathname_administrators :string default("administrators") -# static_pathname_authors :string default("authors") -# static_pathname_posts :string default("posts") -# static_pathname_programs :string default("programs") -# static_pathname_research_articles :string default("articles") -# static_pathname_research_volumes :string default("volumes") -# static_pathname_researchers :string default("researchers") -# static_pathname_staff :string default("staff") -# static_pathname_teachers :string default("teachers") -# url :string -# created_at :datetime not null -# updated_at :datetime not null -# about_id :uuid indexed => [about_type] -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# about_type :string indexed => [about_id] +# access_token :string +# git_endpoint :string +# git_provider :integer default("github") +# name :string +# repository :string +# url :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid indexed => [about_type] +# university_id :uuid not null, indexed # # Indexes # -- GitLab