From 4450c75fdbdc608ec375af774fa3e0ad5c6cacbc Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Fri, 17 Mar 2023 17:10:56 +0100
Subject: [PATCH] Pinned

---
 .../extranets/posts_controller.rb             |   2 +-
 app/models/communication/extranet.rb          |  57 +++++-----
 app/models/communication/extranet/post.rb     |   3 +
 .../extranets/posts/_form.html.erb            |   9 +-
 .../extranets/posts/show.html.erb             |   4 +
 config/locales/communication/en.yml           |   1 +
 config/locales/communication/fr.yml           |   1 +
 ..._pinned_to_communication_extranet_posts.rb |   5 +
 db/schema.rb                                  | 106 ++++++++++--------
 .../fixtures/communication/extranet/posts.yml |   1 +
 test/fixtures/communication/extranets.yml     |  57 +++++-----
 .../communication/extranet/post_test.rb       |   1 +
 test/models/communication/extranet_test.rb    |  57 +++++-----
 13 files changed, 171 insertions(+), 133 deletions(-)
 create mode 100644 db/migrate/20230317160229_add_pinned_to_communication_extranet_posts.rb

diff --git a/app/controllers/admin/communication/extranets/posts_controller.rb b/app/controllers/admin/communication/extranets/posts_controller.rb
index c63ad06a8..50ae86c38 100644
--- a/app/controllers/admin/communication/extranets/posts_controller.rb
+++ b/app/controllers/admin/communication/extranets/posts_controller.rb
@@ -67,7 +67,7 @@ class Admin::Communication::Extranets::PostsController < Admin::Communication::E
     params.require(:communication_extranet_post)
     .permit(
       :title, :summary, :text,
-      :published, :published_at, :slug,
+      :published, :published_at, :pinned, :slug,
       :featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit,
       :author_id, :category_id
     )
diff --git a/app/models/communication/extranet.rb b/app/models/communication/extranet.rb
index 0d499f989..6081c7eb1 100644
--- a/app/models/communication/extranet.rb
+++ b/app/models/communication/extranet.rb
@@ -2,35 +2,34 @@
 #
 # Table name: communication_extranets
 #
-#  id                             :uuid             not null, primary key
-#  about_type                     :string           indexed => [about_id]
-#  allow_experiences_modification :boolean          default(TRUE)
-#  color                          :string
-#  cookies_policy                 :text
-#  css                            :text
-#  feature_alumni                 :boolean          default(FALSE)
-#  feature_contacts               :boolean          default(FALSE)
-#  feature_jobs                   :boolean          default(FALSE)
-#  feature_library                :boolean          default(FALSE)
-#  feature_posts                  :boolean          default(FALSE)
-#  has_sso                        :boolean          default(FALSE)
-#  home_sentence                  :text
-#  host                           :string
-#  name                           :string
-#  privacy_policy                 :text
-#  registration_contact           :string
-#  sass                           :text
-#  sso_button_label               :string
-#  sso_cert                       :text
-#  sso_mapping                    :jsonb
-#  sso_name_identifier_format     :string
-#  sso_provider                   :integer          default("saml")
-#  sso_target_url                 :string
-#  terms                          :text
-#  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]
+#  color                      :string
+#  cookies_policy             :text
+#  css                        :text
+#  feature_alumni             :boolean          default(FALSE)
+#  feature_contacts           :boolean          default(FALSE)
+#  feature_jobs               :boolean          default(FALSE)
+#  feature_library            :boolean          default(FALSE)
+#  feature_posts              :boolean          default(FALSE)
+#  has_sso                    :boolean          default(FALSE)
+#  home_sentence              :text
+#  host                       :string
+#  name                       :string
+#  privacy_policy             :text
+#  registration_contact       :string
+#  sass                       :text
+#  sso_button_label           :string
+#  sso_cert                   :text
+#  sso_mapping                :jsonb
+#  sso_name_identifier_format :string
+#  sso_provider               :integer          default("saml")
+#  sso_target_url             :string
+#  terms                      :text
+#  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/extranet/post.rb b/app/models/communication/extranet/post.rb
index 9161c7721..bfd250d7a 100644
--- a/app/models/communication/extranet/post.rb
+++ b/app/models/communication/extranet/post.rb
@@ -5,6 +5,7 @@
 #  id                    :uuid             not null, primary key
 #  featured_image_alt    :string
 #  featured_image_credit :text
+#  pinned                :boolean          default(FALSE)
 #  published             :boolean          default(FALSE)
 #  published_at          :datetime
 #  slug                  :string
@@ -46,6 +47,8 @@ class Communication::Extranet::Post < ApplicationRecord
 
   validates :title, presence: true
 
+  scope :ordered, -> { order(pinned: :desc, published_at: :desc, created_at: :desc) }
+
   def to_s
     "#{title}"
   end
diff --git a/app/views/admin/communication/extranets/posts/_form.html.erb b/app/views/admin/communication/extranets/posts/_form.html.erb
index b47a22d4d..36b4fca73 100644
--- a/app/views/admin/communication/extranets/posts/_form.html.erb
+++ b/app/views/admin/communication/extranets/posts/_form.html.erb
@@ -12,7 +12,14 @@
     <div class="col-md-4">
       <%= osuny_panel t('metadata') do %>
         <% if can? :publish, post %>
-          <%= f.input :published %>
+          <div class="row pure__row--small">
+            <div class="col-6">
+              <%= f.input :published %>
+            </div>
+            <div class="col-6">
+              <%= f.input :pinned %>
+            </div>
+          </div>
           <%= f.input :published_at, html5: true, as: :date %>
         <% end %>
         <%= f.association :category,
diff --git a/app/views/admin/communication/extranets/posts/show.html.erb b/app/views/admin/communication/extranets/posts/show.html.erb
index 4895b36dc..5332d5d25 100644
--- a/app/views/admin/communication/extranets/posts/show.html.erb
+++ b/app/views/admin/communication/extranets/posts/show.html.erb
@@ -24,6 +24,10 @@
               <% end %>
             </p>
           </div>
+          <div class="col-6">
+            <%= osuny_label Communication::Extranet::Post.human_attribute_name('pinned') %>
+            <p><%= t @post.pinned %></p>
+          </div>
         </div>
         <% if @post.category %>
           <%= osuny_label Communication::Extranet::Post.human_attribute_name('category') %>
diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml
index 62bf1cfef..30696959a 100644
--- a/config/locales/communication/en.yml
+++ b/config/locales/communication/en.yml
@@ -110,6 +110,7 @@ en:
         featured_image: Featured image
         featured_image_alt: Alt text
         featured_image_credit: Credit
+        pinned: Pinned
         published: Published?
         published_at: Publication date
         slug: Slug
diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml
index 84d8a6c0d..046e1d967 100644
--- a/config/locales/communication/fr.yml
+++ b/config/locales/communication/fr.yml
@@ -110,6 +110,7 @@ fr:
         featured_image: Image à la une
         featured_image_alt: Texte alternatif
         featured_image_credit: Crédit
+        pinned: Mis en avant
         published: Publié ?
         published_at: Date de publication
         slug: Identifiant
diff --git a/db/migrate/20230317160229_add_pinned_to_communication_extranet_posts.rb b/db/migrate/20230317160229_add_pinned_to_communication_extranet_posts.rb
new file mode 100644
index 000000000..bac562ba7
--- /dev/null
+++ b/db/migrate/20230317160229_add_pinned_to_communication_extranet_posts.rb
@@ -0,0 +1,5 @@
+class AddPinnedToCommunicationExtranetPosts < ActiveRecord::Migration[7.0]
+  def change
+    add_column :communication_extranet_posts, :pinned, :boolean, default: false
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index e242ea067..f7806b056 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,13 +10,13 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
+ActiveRecord::Schema[7.0].define(version: 2023_03_17_160229) do
   # These are extensions that must be enabled in order to support this database
   enable_extension "pgcrypto"
   enable_extension "plpgsql"
   enable_extension "unaccent"
 
-  create_table "action_text_rich_texts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "action_text_rich_texts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.string "name", null: false
     t.text "body"
     t.string "record_type", null: false
@@ -26,7 +26,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
   end
 
-  create_table "active_storage_attachments", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "active_storage_attachments", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.string "name", null: false
     t.string "record_type", null: false
     t.uuid "record_id", null: false
@@ -36,7 +36,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
   end
 
-  create_table "active_storage_blobs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "active_storage_blobs", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.string "key", null: false
     t.string "filename", null: false
     t.string "content_type"
@@ -50,13 +50,13 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_active_storage_blobs_on_university_id"
   end
 
-  create_table "active_storage_variant_records", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "active_storage_variant_records", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "blob_id", null: false
     t.string "variation_digest", null: false
     t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
   end
 
-  create_table "administration_qualiopi_criterions", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "administration_qualiopi_criterions", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.integer "number"
     t.text "name"
     t.text "description"
@@ -64,7 +64,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.datetime "updated_at", null: false
   end
 
-  create_table "administration_qualiopi_indicators", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "administration_qualiopi_indicators", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "criterion_id", null: false
     t.integer "number"
     t.text "name"
@@ -78,7 +78,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["criterion_id"], name: "index_administration_qualiopi_indicators_on_criterion_id"
   end
 
-  create_table "communication_blocks", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_blocks", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.string "about_type"
     t.uuid "about_id"
@@ -168,13 +168,14 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.uuid "category_id"
+    t.boolean "pinned", default: false
     t.index ["author_id"], name: "index_communication_extranet_posts_on_author_id"
     t.index ["category_id"], name: "index_communication_extranet_posts_on_category_id"
     t.index ["extranet_id"], name: "index_communication_extranet_posts_on_extranet_id"
     t.index ["university_id"], name: "index_communication_extranet_posts_on_university_id"
   end
 
-  create_table "communication_extranets", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_extranets", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.string "name"
     t.uuid "university_id", null: false
     t.string "host"
@@ -206,7 +207,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_communication_extranets_on_university_id"
   end
 
-  create_table "communication_website_categories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_website_categories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "communication_website_id", null: false
     t.string "name"
@@ -240,7 +241,22 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["communication_website_post_id", "communication_website_category_id"], name: "post_category"
   end
 
-  create_table "communication_website_git_files", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_website_connections", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+    t.uuid "university_id", null: false
+    t.uuid "website_id", null: false
+    t.string "object_type", null: false
+    t.uuid "object_id", null: false
+    t.datetime "created_at", null: false
+    t.datetime "updated_at", null: false
+    t.string "source_type"
+    t.uuid "source_id"
+    t.index ["object_type", "object_id"], name: "index_communication_website_connections_on_object"
+    t.index ["source_type", "source_id"], name: "index_communication_website_connections_on_source"
+    t.index ["university_id"], name: "index_communication_website_connections_on_university_id"
+    t.index ["website_id"], name: "index_communication_website_connections_on_website_id"
+  end
+
+  create_table "communication_website_git_files", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.string "previous_path"
     t.string "about_type", null: false
     t.uuid "about_id", null: false
@@ -252,7 +268,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["website_id"], name: "index_communication_website_git_files_on_website_id"
   end
 
-  create_table "communication_website_imported_authors", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_website_imported_authors", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "website_id", null: false
     t.uuid "author_id"
@@ -268,7 +284,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["website_id"], name: "idx_communication_website_imported_auth_on_website"
   end
 
-  create_table "communication_website_imported_categories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_website_imported_categories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "website_id", null: false
     t.uuid "category_id"
@@ -286,7 +302,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["website_id"], name: "idx_communication_website_imported_cat_on_website"
   end
 
-  create_table "communication_website_imported_media", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_website_imported_media", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.string "identifier"
     t.jsonb "data"
     t.text "file_url"
@@ -301,7 +317,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["website_id"], name: "index_communication_website_imported_media_on_website_id"
   end
 
-  create_table "communication_website_imported_pages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_website_imported_pages", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "website_id", null: false
     t.uuid "page_id"
@@ -325,7 +341,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["website_id"], name: "index_communication_website_imported_pages_on_website_id"
   end
 
-  create_table "communication_website_imported_posts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_website_imported_posts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "website_id", null: false
     t.uuid "post_id"
@@ -350,7 +366,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["website_id"], name: "index_communication_website_imported_posts_on_website_id"
   end
 
-  create_table "communication_website_imported_websites", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_website_imported_websites", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "website_id", null: false
     t.integer "status", default: 0
@@ -360,7 +376,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["website_id"], name: "index_communication_website_imported_websites_on_website_id"
   end
 
-  create_table "communication_website_menu_items", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_website_menu_items", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "website_id", null: false
     t.uuid "menu_id", null: false
@@ -380,7 +396,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["website_id"], name: "index_communication_website_menu_items_on_website_id"
   end
 
-  create_table "communication_website_menus", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_website_menus", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "communication_website_id", null: false
     t.string "title"
@@ -396,7 +412,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_communication_website_menus_on_university_id"
   end
 
-  create_table "communication_website_pages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_website_pages", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "communication_website_id", null: false
     t.string "title"
@@ -411,10 +427,10 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.text "github_path"
     t.string "featured_image_alt"
     t.text "text"
+    t.text "summary"
     t.string "breadcrumb_title"
     t.text "header_text"
     t.integer "kind"
-    t.text "summary"
     t.string "bodyclass"
     t.uuid "language_id", null: false
     t.text "featured_image_credit"
@@ -428,7 +444,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_communication_website_pages_on_university_id"
   end
 
-  create_table "communication_website_permalinks", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_website_permalinks", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "website_id", null: false
     t.string "about_type", null: false
@@ -442,7 +458,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["website_id"], name: "index_communication_website_permalinks_on_website_id"
   end
 
-  create_table "communication_website_posts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_website_posts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "communication_website_id", null: false
     t.string "title"
@@ -468,7 +484,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_communication_website_posts_on_university_id"
   end
 
-  create_table "communication_websites", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "communication_websites", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.string "name"
     t.string "url"
@@ -520,7 +536,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["priority", "run_at"], name: "delayed_jobs_priority"
   end
 
-  create_table "education_academic_years", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "education_academic_years", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.integer "year"
     t.datetime "created_at", null: false
@@ -535,7 +551,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_person_id", "education_academic_year_id"], name: "index_person_academic_year"
   end
 
-  create_table "education_cohorts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "education_cohorts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "program_id", null: false
     t.uuid "academic_year_id", null: false
@@ -556,7 +572,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_person_id", "education_cohort_id"], name: "index_person_cohort"
   end
 
-  create_table "education_diplomas", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "education_diplomas", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.string "name"
     t.string "short_name"
     t.integer "level", default: 0
@@ -570,7 +586,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_education_diplomas_on_university_id"
   end
 
-  create_table "education_programs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "education_programs", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.string "name"
     t.integer "capacity"
@@ -630,7 +646,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["education_program_id", "user_id"], name: "index_education_programs_users_on_program_id_and_user_id"
   end
 
-  create_table "education_schools", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "education_schools", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.string "name"
     t.string "address"
@@ -645,7 +661,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_education_schools_on_university_id"
   end
 
-  create_table "imports", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "imports", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.integer "number_of_lines"
     t.jsonb "processing_errors"
     t.integer "kind"
@@ -658,7 +674,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["user_id"], name: "index_imports_on_user_id"
   end
 
-  create_table "languages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "languages", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.string "name"
     t.string "iso_code"
     t.datetime "created_at", null: false
@@ -725,7 +741,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_research_journal_paper_kinds_on_university_id"
   end
 
-  create_table "research_journal_papers", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "research_journal_papers", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.string "title"
     t.datetime "published_at", precision: nil
     t.uuid "university_id", null: false
@@ -761,7 +777,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["researcher_id"], name: "index_research_journal_papers_researchers_on_researcher_id"
   end
 
-  create_table "research_journal_volumes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "research_journal_volumes", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "research_journal_id", null: false
     t.string "title"
@@ -781,7 +797,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_research_journal_volumes_on_university_id"
   end
 
-  create_table "research_journals", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "research_journals", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.string "title"
     t.text "meta_description"
@@ -792,7 +808,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_research_journals_on_university_id"
   end
 
-  create_table "research_laboratories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "research_laboratories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.string "name"
     t.string "address"
@@ -804,7 +820,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_research_laboratories_on_university_id"
   end
 
-  create_table "research_laboratory_axes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "research_laboratory_axes", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "research_laboratory_id", null: false
     t.string "name"
@@ -818,7 +834,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_research_laboratory_axes_on_university_id"
   end
 
-  create_table "research_theses", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "research_theses", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "research_laboratory_id", null: false
     t.uuid "author_id", null: false
@@ -836,7 +852,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_research_theses_on_university_id"
   end
 
-  create_table "universities", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "universities", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.string "name"
     t.string "identifier"
     t.string "address"
@@ -875,7 +891,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_university_organization_categories_on_university_id"
   end
 
-  create_table "university_organizations", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "university_organizations", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.string "name"
     t.string "long_name"
@@ -913,7 +929,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["organization_id"], name: "index_university_organizations_categories_on_organization_id"
   end
 
-  create_table "university_people", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "university_people", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "user_id"
     t.string "last_name"
@@ -969,7 +985,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_university_person_categories_on_university_id"
   end
 
-  create_table "university_person_experiences", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "university_person_experiences", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "person_id", null: false
     t.uuid "organization_id", null: false
@@ -983,7 +999,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_university_person_experiences_on_university_id"
   end
 
-  create_table "university_person_involvements", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "university_person_involvements", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.uuid "person_id", null: false
     t.integer "kind"
@@ -998,7 +1014,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_university_person_involvements_on_university_id"
   end
 
-  create_table "university_roles", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "university_roles", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.string "target_type"
     t.uuid "target_id"
@@ -1010,7 +1026,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
     t.index ["university_id"], name: "index_university_roles_on_university_id"
   end
 
-  create_table "users", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
+  create_table "users", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t|
     t.uuid "university_id", null: false
     t.string "first_name"
     t.string "last_name"
@@ -1083,6 +1099,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_15_170508) do
   add_foreign_key "communication_website_categories", "education_programs", column: "program_id"
   add_foreign_key "communication_website_categories", "languages"
   add_foreign_key "communication_website_categories", "universities"
+  add_foreign_key "communication_website_connections", "communication_websites", column: "website_id"
+  add_foreign_key "communication_website_connections", "universities"
   add_foreign_key "communication_website_git_files", "communication_websites", column: "website_id"
   add_foreign_key "communication_website_imported_authors", "communication_website_imported_websites", column: "website_id"
   add_foreign_key "communication_website_imported_authors", "universities"
diff --git a/test/fixtures/communication/extranet/posts.yml b/test/fixtures/communication/extranet/posts.yml
index 0221b5241..d8186038c 100644
--- a/test/fixtures/communication/extranet/posts.yml
+++ b/test/fixtures/communication/extranet/posts.yml
@@ -5,6 +5,7 @@
 #  id                    :uuid             not null, primary key
 #  featured_image_alt    :string
 #  featured_image_credit :text
+#  pinned                :boolean          default(FALSE)
 #  published             :boolean          default(FALSE)
 #  published_at          :datetime
 #  slug                  :string
diff --git a/test/fixtures/communication/extranets.yml b/test/fixtures/communication/extranets.yml
index 5b00f559b..c4a725645 100644
--- a/test/fixtures/communication/extranets.yml
+++ b/test/fixtures/communication/extranets.yml
@@ -2,35 +2,34 @@
 #
 # Table name: communication_extranets
 #
-#  id                             :uuid             not null, primary key
-#  about_type                     :string           indexed => [about_id]
-#  allow_experiences_modification :boolean          default(TRUE)
-#  color                          :string
-#  cookies_policy                 :text
-#  css                            :text
-#  feature_alumni                 :boolean          default(FALSE)
-#  feature_contacts               :boolean          default(FALSE)
-#  feature_jobs                   :boolean          default(FALSE)
-#  feature_library                :boolean          default(FALSE)
-#  feature_posts                  :boolean          default(FALSE)
-#  has_sso                        :boolean          default(FALSE)
-#  home_sentence                  :text
-#  host                           :string
-#  name                           :string
-#  privacy_policy                 :text
-#  registration_contact           :string
-#  sass                           :text
-#  sso_button_label               :string
-#  sso_cert                       :text
-#  sso_mapping                    :jsonb
-#  sso_name_identifier_format     :string
-#  sso_provider                   :integer          default("saml")
-#  sso_target_url                 :string
-#  terms                          :text
-#  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]
+#  color                      :string
+#  cookies_policy             :text
+#  css                        :text
+#  feature_alumni             :boolean          default(FALSE)
+#  feature_contacts           :boolean          default(FALSE)
+#  feature_jobs               :boolean          default(FALSE)
+#  feature_library            :boolean          default(FALSE)
+#  feature_posts              :boolean          default(FALSE)
+#  has_sso                    :boolean          default(FALSE)
+#  home_sentence              :text
+#  host                       :string
+#  name                       :string
+#  privacy_policy             :text
+#  registration_contact       :string
+#  sass                       :text
+#  sso_button_label           :string
+#  sso_cert                   :text
+#  sso_mapping                :jsonb
+#  sso_name_identifier_format :string
+#  sso_provider               :integer          default("saml")
+#  sso_target_url             :string
+#  terms                      :text
+#  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/test/models/communication/extranet/post_test.rb b/test/models/communication/extranet/post_test.rb
index 91308df60..282ac6559 100644
--- a/test/models/communication/extranet/post_test.rb
+++ b/test/models/communication/extranet/post_test.rb
@@ -5,6 +5,7 @@
 #  id                    :uuid             not null, primary key
 #  featured_image_alt    :string
 #  featured_image_credit :text
+#  pinned                :boolean          default(FALSE)
 #  published             :boolean          default(FALSE)
 #  published_at          :datetime
 #  slug                  :string
diff --git a/test/models/communication/extranet_test.rb b/test/models/communication/extranet_test.rb
index 0fbfb1c43..72be11939 100644
--- a/test/models/communication/extranet_test.rb
+++ b/test/models/communication/extranet_test.rb
@@ -2,35 +2,34 @@
 #
 # Table name: communication_extranets
 #
-#  id                             :uuid             not null, primary key
-#  about_type                     :string           indexed => [about_id]
-#  allow_experiences_modification :boolean          default(TRUE)
-#  color                          :string
-#  cookies_policy                 :text
-#  css                            :text
-#  feature_alumni                 :boolean          default(FALSE)
-#  feature_contacts               :boolean          default(FALSE)
-#  feature_jobs                   :boolean          default(FALSE)
-#  feature_library                :boolean          default(FALSE)
-#  feature_posts                  :boolean          default(FALSE)
-#  has_sso                        :boolean          default(FALSE)
-#  home_sentence                  :text
-#  host                           :string
-#  name                           :string
-#  privacy_policy                 :text
-#  registration_contact           :string
-#  sass                           :text
-#  sso_button_label               :string
-#  sso_cert                       :text
-#  sso_mapping                    :jsonb
-#  sso_name_identifier_format     :string
-#  sso_provider                   :integer          default("saml")
-#  sso_target_url                 :string
-#  terms                          :text
-#  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]
+#  color                      :string
+#  cookies_policy             :text
+#  css                        :text
+#  feature_alumni             :boolean          default(FALSE)
+#  feature_contacts           :boolean          default(FALSE)
+#  feature_jobs               :boolean          default(FALSE)
+#  feature_library            :boolean          default(FALSE)
+#  feature_posts              :boolean          default(FALSE)
+#  has_sso                    :boolean          default(FALSE)
+#  home_sentence              :text
+#  host                       :string
+#  name                       :string
+#  privacy_policy             :text
+#  registration_contact       :string
+#  sass                       :text
+#  sso_button_label           :string
+#  sso_cert                   :text
+#  sso_mapping                :jsonb
+#  sso_name_identifier_format :string
+#  sso_provider               :integer          default("saml")
+#  sso_target_url             :string
+#  terms                      :text
+#  created_at                 :datetime         not null
+#  updated_at                 :datetime         not null
+#  about_id                   :uuid             indexed => [about_type]
+#  university_id              :uuid             not null, indexed
 #
 # Indexes
 #
-- 
GitLab