diff --git a/app/models/communication/website/permalink.rb b/app/models/communication/website/permalink.rb index e035be88f6148d04a5a92f888b7dfa13ca7f6efa..e26ce4c8255f0c547ea00fc75eebb8305bf4aadd 100644 --- a/app/models/communication/website/permalink.rb +++ b/app/models/communication/website/permalink.rb @@ -3,17 +3,18 @@ # Table name: communication_website_permalinks # # id :uuid not null, primary key -# about_type :string not null +# about_type :string not null, indexed => [about_id] # is_current :boolean default(TRUE) # path :string # created_at :datetime not null # updated_at :datetime not null -# about_id :uuid not null +# about_id :uuid not null, indexed => [about_type] # university_id :uuid not null, indexed # website_id :uuid not null, indexed # # Indexes # +# index_communication_website_permalinks_on_about (about_type,about_id) # index_communication_website_permalinks_on_university_id (university_id) # index_communication_website_permalinks_on_website_id (website_id) # diff --git a/app/models/communication/website/permalink/administrator.rb b/app/models/communication/website/permalink/administrator.rb index 3ae3a90cfe6a3fcaa1abe86a612d13f033a2decb..d7ca0d708e8e4a12a622a296fee6e46db540d580 100644 --- a/app/models/communication/website/permalink/administrator.rb +++ b/app/models/communication/website/permalink/administrator.rb @@ -3,17 +3,18 @@ # Table name: communication_website_permalinks # # id :uuid not null, primary key -# about_type :string not null +# about_type :string not null, indexed => [about_id] # is_current :boolean default(TRUE) # path :string # created_at :datetime not null # updated_at :datetime not null -# about_id :uuid not null +# about_id :uuid not null, indexed => [about_type] # university_id :uuid not null, indexed # website_id :uuid not null, indexed # # Indexes # +# index_communication_website_permalinks_on_about (about_type,about_id) # index_communication_website_permalinks_on_university_id (university_id) # index_communication_website_permalinks_on_website_id (website_id) # diff --git a/app/models/communication/website/permalink/author.rb b/app/models/communication/website/permalink/author.rb index 6f94a1153234aff99986b4d1532aece3a6ed58b5..64417b06ed8162b011c9827c94579ab763a61670 100644 --- a/app/models/communication/website/permalink/author.rb +++ b/app/models/communication/website/permalink/author.rb @@ -3,17 +3,18 @@ # Table name: communication_website_permalinks # # id :uuid not null, primary key -# about_type :string not null +# about_type :string not null, indexed => [about_id] # is_current :boolean default(TRUE) # path :string # created_at :datetime not null # updated_at :datetime not null -# about_id :uuid not null +# about_id :uuid not null, indexed => [about_type] # university_id :uuid not null, indexed # website_id :uuid not null, indexed # # Indexes # +# index_communication_website_permalinks_on_about (about_type,about_id) # index_communication_website_permalinks_on_university_id (university_id) # index_communication_website_permalinks_on_website_id (website_id) # diff --git a/app/models/communication/website/permalink/category.rb b/app/models/communication/website/permalink/category.rb index 933dcd3a9ae1c27d15f7bc686ddb381f5a41432c..44fde9ae12821a6514f74888e27642bbb3e7f435 100644 --- a/app/models/communication/website/permalink/category.rb +++ b/app/models/communication/website/permalink/category.rb @@ -3,17 +3,18 @@ # Table name: communication_website_permalinks # # id :uuid not null, primary key -# about_type :string not null +# about_type :string not null, indexed => [about_id] # is_current :boolean default(TRUE) # path :string # created_at :datetime not null # updated_at :datetime not null -# about_id :uuid not null +# about_id :uuid not null, indexed => [about_type] # university_id :uuid not null, indexed # website_id :uuid not null, indexed # # Indexes # +# index_communication_website_permalinks_on_about (about_type,about_id) # index_communication_website_permalinks_on_university_id (university_id) # index_communication_website_permalinks_on_website_id (website_id) # diff --git a/app/models/communication/website/permalink/diploma.rb b/app/models/communication/website/permalink/diploma.rb index 9df94320c6c38534a276262bcf44cc60552588e1..651855a6b92bf2909ceeb3e2bda1e8deac9d5580 100644 --- a/app/models/communication/website/permalink/diploma.rb +++ b/app/models/communication/website/permalink/diploma.rb @@ -3,17 +3,18 @@ # Table name: communication_website_permalinks # # id :uuid not null, primary key -# about_type :string not null +# about_type :string not null, indexed => [about_id] # is_current :boolean default(TRUE) # path :string # created_at :datetime not null # updated_at :datetime not null -# about_id :uuid not null +# about_id :uuid not null, indexed => [about_type] # university_id :uuid not null, indexed # website_id :uuid not null, indexed # # Indexes # +# index_communication_website_permalinks_on_about (about_type,about_id) # index_communication_website_permalinks_on_university_id (university_id) # index_communication_website_permalinks_on_website_id (website_id) # diff --git a/app/models/communication/website/permalink/organization.rb b/app/models/communication/website/permalink/organization.rb index b1b20dc23dd33178ccf16377d20b6f5c91d911a0..85b3d32692430c03f6205316deb6268c6888ea3b 100644 --- a/app/models/communication/website/permalink/organization.rb +++ b/app/models/communication/website/permalink/organization.rb @@ -3,17 +3,18 @@ # Table name: communication_website_permalinks # # id :uuid not null, primary key -# about_type :string not null +# about_type :string not null, indexed => [about_id] # is_current :boolean default(TRUE) # path :string # created_at :datetime not null # updated_at :datetime not null -# about_id :uuid not null +# about_id :uuid not null, indexed => [about_type] # university_id :uuid not null, indexed # website_id :uuid not null, indexed # # Indexes # +# index_communication_website_permalinks_on_about (about_type,about_id) # index_communication_website_permalinks_on_university_id (university_id) # index_communication_website_permalinks_on_website_id (website_id) # diff --git a/app/models/communication/website/permalink/page.rb b/app/models/communication/website/permalink/page.rb index e615a2b5f6d46629f3b851211616406f1f08ad23..388f562801030b59a79a64bc4542dd0a5c67dc6e 100644 --- a/app/models/communication/website/permalink/page.rb +++ b/app/models/communication/website/permalink/page.rb @@ -3,17 +3,18 @@ # Table name: communication_website_permalinks # # id :uuid not null, primary key -# about_type :string not null +# about_type :string not null, indexed => [about_id] # is_current :boolean default(TRUE) # path :string # created_at :datetime not null # updated_at :datetime not null -# about_id :uuid not null +# about_id :uuid not null, indexed => [about_type] # university_id :uuid not null, indexed # website_id :uuid not null, indexed # # Indexes # +# index_communication_website_permalinks_on_about (about_type,about_id) # index_communication_website_permalinks_on_university_id (university_id) # index_communication_website_permalinks_on_website_id (website_id) # diff --git a/app/models/communication/website/permalink/person.rb b/app/models/communication/website/permalink/person.rb index 95ea4ba4505a53add1a6ccc5d52d7e1a28d98189..034fab57e13be52e241e3657da0b235f5f261e4c 100644 --- a/app/models/communication/website/permalink/person.rb +++ b/app/models/communication/website/permalink/person.rb @@ -3,17 +3,18 @@ # Table name: communication_website_permalinks # # id :uuid not null, primary key -# about_type :string not null +# about_type :string not null, indexed => [about_id] # is_current :boolean default(TRUE) # path :string # created_at :datetime not null # updated_at :datetime not null -# about_id :uuid not null +# about_id :uuid not null, indexed => [about_type] # university_id :uuid not null, indexed # website_id :uuid not null, indexed # # Indexes # +# index_communication_website_permalinks_on_about (about_type,about_id) # index_communication_website_permalinks_on_university_id (university_id) # index_communication_website_permalinks_on_website_id (website_id) # diff --git a/app/models/communication/website/permalink/post.rb b/app/models/communication/website/permalink/post.rb index 43e79fa4f37b78dc6eef1ca9fbe499a3b746aaf9..55d91fb90c11eb1ac1bbaf71ea0d2960566ab868 100644 --- a/app/models/communication/website/permalink/post.rb +++ b/app/models/communication/website/permalink/post.rb @@ -3,17 +3,18 @@ # Table name: communication_website_permalinks # # id :uuid not null, primary key -# about_type :string not null +# about_type :string not null, indexed => [about_id] # is_current :boolean default(TRUE) # path :string # created_at :datetime not null # updated_at :datetime not null -# about_id :uuid not null +# about_id :uuid not null, indexed => [about_type] # university_id :uuid not null, indexed # website_id :uuid not null, indexed # # Indexes # +# index_communication_website_permalinks_on_about (about_type,about_id) # index_communication_website_permalinks_on_university_id (university_id) # index_communication_website_permalinks_on_website_id (website_id) # diff --git a/app/models/communication/website/permalink/program.rb b/app/models/communication/website/permalink/program.rb index 7e4f7fd28eb1971332b6291add9bea34158b297e..309e44aa3513bbf0aad95a1f15fafe369690285a 100644 --- a/app/models/communication/website/permalink/program.rb +++ b/app/models/communication/website/permalink/program.rb @@ -3,17 +3,18 @@ # Table name: communication_website_permalinks # # id :uuid not null, primary key -# about_type :string not null +# about_type :string not null, indexed => [about_id] # is_current :boolean default(TRUE) # path :string # created_at :datetime not null # updated_at :datetime not null -# about_id :uuid not null +# about_id :uuid not null, indexed => [about_type] # university_id :uuid not null, indexed # website_id :uuid not null, indexed # # Indexes # +# index_communication_website_permalinks_on_about (about_type,about_id) # index_communication_website_permalinks_on_university_id (university_id) # index_communication_website_permalinks_on_website_id (website_id) # diff --git a/app/models/communication/website/permalink/researcher.rb b/app/models/communication/website/permalink/researcher.rb index a770f8e2a18d7fef93962e994204e33b206fb8ef..16dae292ff161c10db862c763cc80a8caca88d34 100644 --- a/app/models/communication/website/permalink/researcher.rb +++ b/app/models/communication/website/permalink/researcher.rb @@ -3,17 +3,18 @@ # Table name: communication_website_permalinks # # id :uuid not null, primary key -# about_type :string not null +# about_type :string not null, indexed => [about_id] # is_current :boolean default(TRUE) # path :string # created_at :datetime not null # updated_at :datetime not null -# about_id :uuid not null +# about_id :uuid not null, indexed => [about_type] # university_id :uuid not null, indexed # website_id :uuid not null, indexed # # Indexes # +# index_communication_website_permalinks_on_about (about_type,about_id) # index_communication_website_permalinks_on_university_id (university_id) # index_communication_website_permalinks_on_website_id (website_id) # diff --git a/app/models/communication/website/permalink/teacher.rb b/app/models/communication/website/permalink/teacher.rb index 37783685b5b791e3ee3a03842d945fb4c5659d84..8d464df92ac870584580cabc2976c1ae8798eeb3 100644 --- a/app/models/communication/website/permalink/teacher.rb +++ b/app/models/communication/website/permalink/teacher.rb @@ -3,17 +3,18 @@ # Table name: communication_website_permalinks # # id :uuid not null, primary key -# about_type :string not null +# about_type :string not null, indexed => [about_id] # is_current :boolean default(TRUE) # path :string # created_at :datetime not null # updated_at :datetime not null -# about_id :uuid not null +# about_id :uuid not null, indexed => [about_type] # university_id :uuid not null, indexed # website_id :uuid not null, indexed # # Indexes # +# index_communication_website_permalinks_on_about (about_type,about_id) # index_communication_website_permalinks_on_university_id (university_id) # index_communication_website_permalinks_on_website_id (website_id) # diff --git a/db/migrate/20221229103238_add_about_index_in_communication_website_permalinks.rb b/db/migrate/20221229103238_add_about_index_in_communication_website_permalinks.rb new file mode 100644 index 0000000000000000000000000000000000000000..d16383f3130fdf894458ccdeb03c0c9c55d27814 --- /dev/null +++ b/db/migrate/20221229103238_add_about_index_in_communication_website_permalinks.rb @@ -0,0 +1,5 @@ +class AddAboutIndexInCommunicationWebsitePermalinks < ActiveRecord::Migration[7.0] + def change + add_index :communication_website_permalinks, [:about_type, :about_id], name: :index_communication_website_permalinks_on_about + end +end diff --git a/db/schema.rb b/db/schema.rb index bb15072bff6a3779eac39867efe08e17285c82c3..dd8b5176e102821f5cea9c2fc13f71a3262595cd 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[7.0].define(version: 2022_12_26_160909) do +ActiveRecord::Schema[7.0].define(version: 2022_12_29_103238) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -337,6 +337,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_26_160909) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.boolean "is_current", default: true + t.index ["about_type", "about_id"], name: "index_communication_website_permalinks_on_about" t.index ["university_id"], name: "index_communication_website_permalinks_on_university_id" t.index ["website_id"], name: "index_communication_website_permalinks_on_website_id" end