Skip to content
Snippets Groups Projects
Commit b6ddb3b1 authored by Mateus Rambo Strey's avatar Mateus Rambo Strey
Browse files

Merge branch 'update-orientdb-schema'

parents 277ecb9b 4b69d13f
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ class LearningObject
attr_accessor :id, :id_dspace, :rid, :name, :author, :description,
:published_at, :thumbnail, :created_at, :last_modified,
:type, :grade_level, :attachment, :metadata, :score,
:main_bitstream_id
# Relation attrs
:likes, :views, :downloads, :subjects, :attributes, :publisher
......
......@@ -6,6 +6,8 @@ class OrientDb::Migrations::CreateCollection < OrientDb::Migration
c.property 'description', :string
c.link 'learning_objects', :linkset, 'LearningObject'
end
metadata = {:analyzer => "org.apache.lucene.analysis.br.BrazilianAnalyzer"}
add_index 'Collection', ['name', 'description'], "FULLTEXT", "collection_search", "LUCENE", metadata.to_json
end
def down
......
......@@ -2,7 +2,8 @@ class OrientDb::Migrations::CreateLearningObject < OrientDb::Migration
def up
create_class 'LearningObject', 'Object' do |c|
c.property 'id_dspace', :integer, :mandatory => true, :notnull => true
c.property 'id_dspace', :long, :mandatory => true, :notnull => true
c.property 'main_bitstream_id', :long
c.property 'description', :string
c.property 'thumbnail', :string
c.property 'type', :string
......@@ -15,7 +16,7 @@ class OrientDb::Migrations::CreateLearningObject < OrientDb::Migration
end
add_index 'LearningObject', ['id_dspace'], "UNIQUE_HASH_INDEX"
metadata = {:analyzer => "org.apache.lucene.analysis.br.BrazilianAnalyzer"}
add_index 'LearningObject', ['name', 'description'], "FULLTEXT", "learningobject_search", "LUCENE", metadata.to_json
add_index 'LearningObject', ['name', 'description', 'author'], "FULLTEXT", "learningobject_search", "LUCENE", metadata.to_json
end
def down
......
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