diff --git a/app/models/communication/website/page.rb b/app/models/communication/website/page.rb index f72e9eebaf99fa4c11d186e60c7d9339fcb493a9..6b7f30e7a3488a6d3b7dc0f063342659c56c1ab0 100644 --- a/app/models/communication/website/page.rb +++ b/app/models/communication/website/page.rb @@ -41,6 +41,8 @@ # class Communication::Website::Page < ApplicationRecord + self.ignored_columns = %w(path) + include Accessible include Sanitizable include WithUniversity @@ -98,10 +100,6 @@ class Communication::Website::Page < ApplicationRecord active_storage_blobs end - def language_prefix - "/#{language.iso_code}" if website.languages.any? && language_id - end - def duplicate page = self.dup page.published = false diff --git a/app/models/communication/website/page/with_path.rb b/app/models/communication/website/page/with_path.rb index 9ff256b1287cb2986f1c5486fbccce43dcfb8004..33a22b61031fedc95ca0c944aa2e4759387ee511 100644 --- a/app/models/communication/website/page/with_path.rb +++ b/app/models/communication/website/page/with_path.rb @@ -13,22 +13,19 @@ module Communication::Website::Page::WithPath }, unless: :kind_home? - before_validation :check_slug, :make_path - after_save :update_children_paths, if: :saved_change_to_path? + before_validation :check_slug end - def generated_path - "#{parent&.path}#{slug}/".gsub(/\/+/, '/') + def path + # TODO i18n remplacer le choix de la langue + path = '' + path += "/#{website.languages.first.iso_code}" if website.languages.any? + path += "/#{slug_with_ancestors}/" + path.gsub(/\/+/, '/') end - def path_without_language - if kind_home? - "/" - elsif parent_id.present? - "#{parent&.path_without_language}#{slug}/".gsub(/\/+/, '/') - else - "/#{slug}/".gsub(/\/+/, '/') - end + def slug_with_ancestors + (ancestors.map(&:slug) << slug).reject(&:blank?).join('/') end def git_path(website) @@ -40,7 +37,7 @@ module Communication::Website::Page::WithPath elsif has_special_git_path? path += "#{kind.split('_').last}/_index.html" else - path += "pages/#{path_without_language}/_index.html" + path += "pages/#{slug_with_ancestors}/_index.html" end path @@ -54,13 +51,6 @@ module Communication::Website::Page::WithPath protected - def update_children_paths - children.each do |child| - child.update_column :path, child.generated_path - child.update_children_paths - end - end - def check_slug self.slug = to_s.parameterize if self.slug.blank? && !kind_home? current_slug = self.slug @@ -78,10 +68,6 @@ module Communication::Website::Page::WithPath .exists? end - def make_path - self.path = kind_home? ? "#{language_prefix}/" : generated_path - end - def slug_must_be_unique errors.add(:slug, ActiveRecord::Errors.default_error_messages[:taken]) if slug_unavailable?(slug) end diff --git a/app/models/communication/website/permalink/administrator.rb b/app/models/communication/website/permalink/administrator.rb index a68bdc15eb94c016fb478d7e34a3425461e553e7..a852b130b6b635ad3e2a62c673f4f6da4e1835a9 100644 --- a/app/models/communication/website/permalink/administrator.rb +++ b/app/models/communication/website/permalink/administrator.rb @@ -33,6 +33,6 @@ class Communication::Website::Permalink::Administrator < Communication::Website: # /equipe/:slug/roles/ def self.pattern_in_website(website) - "#{website.special_page(:persons).path_without_language}:slug/roles/" + "#{website.special_page(:persons).path}:slug/roles/" end end diff --git a/app/models/communication/website/permalink/author.rb b/app/models/communication/website/permalink/author.rb index d721a2d341df1af98e5f8061887061801c07137a..d5e2aa061a68fefd6594f99e46571e70bf8463cc 100644 --- a/app/models/communication/website/permalink/author.rb +++ b/app/models/communication/website/permalink/author.rb @@ -34,6 +34,6 @@ class Communication::Website::Permalink::Author < Communication::Website::Permal # /equipe/:slug/actualites/ def self.pattern_in_website(website) - "#{website.special_page(:persons).path_without_language}:slug/#{website.special_page(:communication_posts).slug}/" + "#{website.special_page(:persons).path}:slug/#{website.special_page(:communication_posts).slug}/" end end diff --git a/app/models/communication/website/permalink/category.rb b/app/models/communication/website/permalink/category.rb index 4ed09cfc528ca6c02c708e9fc2c7eb2a2f71a026..baf5ebd30a23bbe255f498736f309dee0dab6489 100644 --- a/app/models/communication/website/permalink/category.rb +++ b/app/models/communication/website/permalink/category.rb @@ -33,7 +33,7 @@ class Communication::Website::Permalink::Category < Communication::Website::Perm # /actualites/:slug/ def self.pattern_in_website(website) - "#{website.special_page(:communication_posts).path_without_language}:slug/" + "#{website.special_page(:communication_posts).path}:slug/" end protected diff --git a/app/models/communication/website/permalink/diploma.rb b/app/models/communication/website/permalink/diploma.rb index 62331308e2906864f7b9774b176638d9c902bed1..0446d7323feb82a218c4174506fb98f235d3e86c 100644 --- a/app/models/communication/website/permalink/diploma.rb +++ b/app/models/communication/website/permalink/diploma.rb @@ -33,6 +33,6 @@ class Communication::Website::Permalink::Diploma < Communication::Website::Perma # /diplomes/:slug/ def self.pattern_in_website(website) - "#{website.special_page(:education_diplomas).path_without_language}:slug/" + "#{website.special_page(:education_diplomas).path}:slug/" end end diff --git a/app/models/communication/website/permalink/organization.rb b/app/models/communication/website/permalink/organization.rb index abfab5cbfa2e82f5526938de9d229df440633a74..00220b12d5632586773ac4d478ed6d0a341633c5 100644 --- a/app/models/communication/website/permalink/organization.rb +++ b/app/models/communication/website/permalink/organization.rb @@ -33,6 +33,6 @@ class Communication::Website::Permalink::Organization < Communication::Website:: # /organisations/:slug/ def self.pattern_in_website(website) - "#{website.special_page(:organizations).path_without_language}:slug/" + "#{website.special_page(:organizations).path}:slug/" end end diff --git a/app/models/communication/website/permalink/person.rb b/app/models/communication/website/permalink/person.rb index 5c800191417bdd23111a608e0e52226a1adeab2c..dbe8b043a6401e717c29fe600adeb7026a53830b 100644 --- a/app/models/communication/website/permalink/person.rb +++ b/app/models/communication/website/permalink/person.rb @@ -33,6 +33,6 @@ class Communication::Website::Permalink::Person < Communication::Website::Permal # /equipe/:slug/ def self.pattern_in_website(website) - "#{website.special_page(:persons).path_without_language}:slug/" + "#{website.special_page(:persons).path}:slug/" end end diff --git a/app/models/communication/website/permalink/post.rb b/app/models/communication/website/permalink/post.rb index 8983505391aa2fec676fb41038e0afba559f8f8a..fdb8fcdf7e857a0922b5ab7eb53fe7471ec68881 100644 --- a/app/models/communication/website/permalink/post.rb +++ b/app/models/communication/website/permalink/post.rb @@ -32,9 +32,8 @@ class Communication::Website::Permalink::Post < Communication::Website::Permalin end # /actualites/2022-10-21-un-article/ - # Pas de /fr au dƩbut, parce qu'Hugo a besoin du permalink sans langue def self.pattern_in_website(website) - "#{website.special_page(:communication_posts).path_without_language}:year-:month-:day-:slug/" + "#{website.special_page(:communication_posts).path}:year-:month-:day-:slug/" end protected diff --git a/app/models/communication/website/permalink/program.rb b/app/models/communication/website/permalink/program.rb index 2fb1ee2effde195a3eb61d205255343a5a7174e8..506696d7e63a4d4fdefe3e5108b19e7c73da39e6 100644 --- a/app/models/communication/website/permalink/program.rb +++ b/app/models/communication/website/permalink/program.rb @@ -33,6 +33,6 @@ class Communication::Website::Permalink::Program < Communication::Website::Perma # /formations/:slug/ def self.pattern_in_website(website) - "#{website.special_page(:education_programs).path_without_language}:slug/" + "#{website.special_page(:education_programs).path}:slug/" end end diff --git a/app/models/communication/website/permalink/researcher.rb b/app/models/communication/website/permalink/researcher.rb index fb03e96b730d7fb92bbfdfe66457eff9ae8c2ca5..e0cbf3c4419720d84f7ec041fcf69ef98f0ec9ed 100644 --- a/app/models/communication/website/permalink/researcher.rb +++ b/app/models/communication/website/permalink/researcher.rb @@ -34,6 +34,6 @@ class Communication::Website::Permalink::Researcher < Communication::Website::Pe # /equipe/:slug/papers/ # FIXME def self.pattern_in_website(website) - "#{website.special_page(:persons).path_without_language}:slug/papers/" + "#{website.special_page(:persons).path}:slug/papers/" end end diff --git a/app/models/communication/website/permalink/teacher.rb b/app/models/communication/website/permalink/teacher.rb index 8d49d2cd7760d860fb4dfd723f3bb86f395f378e..ebd6ed95d8c032b500327f11da575c6a37a4c2c5 100644 --- a/app/models/communication/website/permalink/teacher.rb +++ b/app/models/communication/website/permalink/teacher.rb @@ -34,6 +34,6 @@ class Communication::Website::Permalink::Teacher < Communication::Website::Perma # /equipe/:slug/programs/ # FIXME def self.pattern_in_website(website) - "#{website.special_page(:persons).path_without_language}:slug/programs/" + "#{website.special_page(:persons).path}:slug/programs/" end end diff --git a/db/schema.rb b/db/schema.rb index 55067828b4437ff390a6e0a64e9e8b792c271a76..3b9e215a0e5cebda09bbd8f4399b6dbf17a97770 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -16,7 +16,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do enable_extension "plpgsql" enable_extension "unaccent" - create_table "action_text_rich_texts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "action_text_rich_texts", id: :uuid, default: -> { "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: 2022_12_12_165617) 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: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "active_storage_attachments", id: :uuid, default: -> { "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: 2022_12_12_165617) 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: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "active_storage_blobs", id: :uuid, default: -> { "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: 2022_12_12_165617) do t.index ["university_id"], name: "index_active_storage_blobs_on_university_id" end - create_table "active_storage_variant_records", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "active_storage_variant_records", id: :uuid, default: -> { "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: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "administration_qualiopi_criterions", id: :uuid, default: -> { "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: 2022_12_12_165617) do t.datetime "updated_at", null: false end - create_table "administration_qualiopi_indicators", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "administration_qualiopi_indicators", id: :uuid, default: -> { "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: 2022_12_12_165617) do t.index ["criterion_id"], name: "index_administration_qualiopi_indicators_on_criterion_id" end - create_table "communication_blocks", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_blocks", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "about_type" t.uuid "about_id" @@ -93,7 +93,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_communication_blocks_on_university_id" end - create_table "communication_extranets", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_extranets", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.uuid "university_id", null: false t.string "host" @@ -117,7 +117,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_communication_extranets_on_university_id" end - create_table "communication_website_categories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_categories", 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 "name" @@ -147,7 +147,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["communication_website_post_id", "communication_website_category_id"], name: "post_category" end - create_table "communication_website_git_files", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_git_files", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "previous_path" t.string "about_type", null: false t.uuid "about_id", null: false @@ -159,7 +159,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["website_id"], name: "index_communication_website_git_files_on_website_id" end - create_table "communication_website_imported_authors", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + 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 t.uuid "author_id" @@ -175,7 +175,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["website_id"], name: "idx_communication_website_imported_auth_on_website" end - create_table "communication_website_imported_categories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_categories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.uuid "category_id" @@ -193,7 +193,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["website_id"], name: "idx_communication_website_imported_cat_on_website" end - create_table "communication_website_imported_media", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_media", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "identifier" t.jsonb "data" t.text "file_url" @@ -208,7 +208,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["website_id"], name: "index_communication_website_imported_media_on_website_id" end - create_table "communication_website_imported_pages", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_pages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.uuid "page_id" @@ -232,7 +232,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["website_id"], name: "index_communication_website_imported_pages_on_website_id" end - create_table "communication_website_imported_posts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_posts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.uuid "post_id" @@ -257,7 +257,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["website_id"], name: "index_communication_website_imported_posts_on_website_id" end - create_table "communication_website_imported_websites", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_websites", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.integer "status", default: 0 @@ -267,7 +267,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["website_id"], name: "index_communication_website_imported_websites_on_website_id" end - create_table "communication_website_menu_items", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_menu_items", id: :uuid, default: -> { "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 @@ -287,7 +287,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["website_id"], name: "index_communication_website_menu_items_on_website_id" end - create_table "communication_website_menus", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_menus", 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 "title" @@ -299,7 +299,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_communication_website_menus_on_university_id" end - create_table "communication_website_pages", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_pages", 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 "title" @@ -314,10 +314,10 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.text "github_path" t.string "featured_image_alt" t.text "text" - t.text "description_short" t.string "breadcrumb_title" t.text "header_text" t.integer "kind" + t.text "description_short" t.string "bodyclass" t.uuid "language_id" t.text "featured_image_credit" @@ -341,7 +341,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["website_id"], name: "index_communication_website_permalinks_on_website_id" end - create_table "communication_website_posts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_posts", 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 "title" @@ -365,7 +365,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_communication_website_posts_on_university_id" end - create_table "communication_websites", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_websites", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "url" @@ -414,7 +414,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["priority", "run_at"], name: "delayed_jobs_priority" end - create_table "education_academic_years", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_academic_years", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.integer "year" t.datetime "created_at", null: false @@ -429,7 +429,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_person_id", "education_academic_year_id"], name: "index_person_academic_year" end - create_table "education_cohorts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_cohorts", id: :uuid, default: -> { "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 @@ -450,7 +450,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_person_id", "education_cohort_id"], name: "index_person_cohort" end - create_table "education_diplomas", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_diplomas", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "short_name" t.integer "level", default: 0 @@ -464,7 +464,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_education_diplomas_on_university_id" end - create_table "education_programs", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_programs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.integer "capacity" @@ -524,7 +524,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) 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: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_schools", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "address" @@ -539,7 +539,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_education_schools_on_university_id" end - create_table "imports", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "imports", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.integer "number_of_lines" t.jsonb "processing_errors" t.integer "kind" @@ -552,14 +552,14 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["user_id"], name: "index_imports_on_user_id" end - create_table "languages", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "languages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "iso_code" t.datetime "created_at", null: false t.datetime "updated_at", null: false end - create_table "research_journal_papers", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_journal_papers", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "title" t.datetime "published_at", precision: nil t.uuid "university_id", null: false @@ -589,7 +589,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["researcher_id"], name: "index_research_journal_papers_researchers_on_researcher_id" end - create_table "research_journal_volumes", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_journal_volumes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "research_journal_id", null: false t.string "title" @@ -608,7 +608,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_research_journal_volumes_on_university_id" end - create_table "research_journals", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_journals", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "title" t.text "description" @@ -620,7 +620,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_research_journals_on_university_id" end - create_table "research_laboratories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_laboratories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "address" @@ -632,7 +632,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_research_laboratories_on_university_id" end - create_table "research_laboratory_axes", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_laboratory_axes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "research_laboratory_id", null: false t.string "name" @@ -646,7 +646,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_research_laboratory_axes_on_university_id" end - create_table "research_theses", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_theses", id: :uuid, default: -> { "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 @@ -664,7 +664,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_research_theses_on_university_id" end - create_table "universities", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "universities", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "identifier" t.string "address" @@ -689,7 +689,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.string "sso_button_label" end - create_table "university_organizations", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_organizations", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "long_name" @@ -712,7 +712,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_university_organizations_on_university_id" end - create_table "university_people", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_people", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "user_id" t.string "last_name" @@ -748,7 +748,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["user_id"], name: "index_university_people_on_user_id" end - create_table "university_person_experiences", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_person_experiences", id: :uuid, default: -> { "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 @@ -762,7 +762,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_university_person_experiences_on_university_id" end - create_table "university_person_involvements", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_person_involvements", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "person_id", null: false t.integer "kind" @@ -777,7 +777,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_university_person_involvements_on_university_id" end - create_table "university_roles", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_roles", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "target_type" t.uuid "target_id" @@ -789,7 +789,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do t.index ["university_id"], name: "index_university_roles_on_university_id" end - create_table "users", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "users", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "first_name" t.string "last_name"