Skip to content
Snippets Groups Projects
Commit 4a8383b2 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

wip

parent ea36da7e
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,8 @@ namespace :research do
namespace :hal do
resources :authors, only: [:index, :show, :destroy] do
member do
get :static
post 'researchers/:researcher_id' => 'authors#connect_researcher', as: :researcher
delete 'researchers/:researcher_id' => 'authors#disconnect_researcher'
end
end
resources :publications, only: [:index, :show, :destroy] do
......@@ -11,6 +12,7 @@ namespace :research do
get :static
end
end
root to: 'dashboard#index'
end
resources :journals do
resources :volumes, controller: 'journals/volumes' do
......
class AddIndexToHalAuthors < ActiveRecord::Migration[7.0]
def change
rename_column :research_hal_authors, :doc_identifier, :docid
add_index :research_hal_authors, :docid
end
end
class RenameResearchHalAuthorsUniversityPersons < ActiveRecord::Migration[7.0]
def change
rename_table :research_hal_authors_university_persons, :research_hal_authors_university_people
end
end
class FixJoinTableResearchHalPublicationsUniversityPeople < ActiveRecord::Migration[7.0]
def change
rename_column :research_hal_publications_university_people, :research_publication_id, :research_hal_publication_id
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2023_02_17_205953) do
ActiveRecord::Schema[7.0].define(version: 2023_02_18_074127) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
......@@ -593,7 +593,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_17_205953) do
end
create_table "research_hal_authors", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.string "doc_identifier"
t.string "docid"
t.string "form_identifier"
t.string "person_identifier"
t.string "first_name"
......@@ -601,6 +601,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_17_205953) do
t.string "full_name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["docid"], name: "index_research_hal_authors_on_docid"
end
create_table "research_hal_authors_publications", id: false, force: :cascade do |t|
......@@ -610,7 +611,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_17_205953) do
t.index ["research_hal_publication_id", "research_hal_author_id"], name: "hal_publication_author"
end
create_table "research_hal_authors_university_persons", id: false, force: :cascade do |t|
create_table "research_hal_authors_university_people", id: false, force: :cascade do |t|
t.uuid "research_hal_author_id", null: false
t.uuid "university_person_id", null: false
t.index ["research_hal_author_id", "university_person_id"], name: "hal_author_person"
......@@ -633,10 +634,10 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_17_205953) do
end
create_table "research_hal_publications_university_people", id: false, force: :cascade do |t|
t.uuid "research_publication_id", null: false
t.uuid "research_hal_publication_id", null: false
t.uuid "university_person_id", null: false
t.index ["research_publication_id", "university_person_id"], name: "index_publication_person"
t.index ["university_person_id", "research_publication_id"], name: "index_person_publication"
t.index ["research_hal_publication_id", "university_person_id"], name: "index_publication_person"
t.index ["university_person_id", "research_hal_publication_id"], name: "index_person_publication"
end
create_table "research_journal_paper_kinds", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
......
namespace :auto do
desc 'Update publications from HAL for all researchers'
task update_publications_from_hal: :environment do
Research::Publication.update_from_hal
task update_hal: :environment do
Research::Hal.update_from_api!
end
end
\ No newline at end of file
......@@ -3,7 +3,7 @@
# Table name: research_hal_authors
#
# id :uuid not null, primary key
# doc_identifier :string
# docid :string indexed
# first_name :string
# form_identifier :string
# full_name :string
......@@ -12,6 +12,10 @@
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_research_hal_authors_on_docid (docid)
#
one:
doc_identifier: MyString
......
......@@ -3,7 +3,7 @@
# Table name: research_hal_authors
#
# id :uuid not null, primary key
# doc_identifier :string
# docid :string indexed
# first_name :string
# form_identifier :string
# full_name :string
......@@ -12,6 +12,10 @@
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_research_hal_authors_on_docid (docid)
#
require "test_helper"
class Research::Hal::AuthorTest < ActiveSupport::TestCase
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment