talia_core 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +4 -0
- data/config/database.yml +19 -0
- data/config/database.yml.example +35 -0
- data/config/rdfstore.yml +13 -0
- data/config/rdfstore.yml.example +13 -0
- data/config/rdfstore.yml.rdflite_example +16 -0
- data/config/rdfstore.yml.redland_example +46 -0
- data/config/talia_core.yml +14 -0
- data/config/talia_core.yml.example +42 -0
- data/generators/generator_helpers.rb +49 -0
- data/generators/talia_admin/USAGE +1 -0
- data/generators/talia_admin/talia_admin_generator.rb +19 -0
- data/generators/talia_admin/templates/controllers/admin/background_controller.rb +50 -0
- data/generators/talia_admin/templates/controllers/admin/custom_templates_controller.rb +25 -0
- data/generators/talia_admin/templates/controllers/admin/locales_controller.rb +15 -0
- data/generators/talia_admin/templates/controllers/admin/sources_controller.rb +71 -0
- data/generators/talia_admin/templates/controllers/admin/translations_controller.rb +61 -0
- data/generators/talia_admin/templates/controllers/admin/users_controller.rb +48 -0
- data/generators/talia_admin/templates/controllers/admin_controller.rb +7 -0
- data/generators/talia_admin/templates/helpers/admin/background_helper.rb +60 -0
- data/generators/talia_admin/templates/helpers/admin/custom_templates_helper.rb +5 -0
- data/generators/talia_admin/templates/helpers/admin/locales_helper.rb +2 -0
- data/generators/talia_admin/templates/helpers/admin/sources_helper.rb +65 -0
- data/generators/talia_admin/templates/helpers/admin/translations_helper.rb +51 -0
- data/generators/talia_admin/templates/helpers/admin/users_helper.rb +2 -0
- data/generators/talia_admin/templates/helpers/admin_helper.rb +11 -0
- data/generators/talia_admin/templates/public/images/backend/body_bg.gif +0 -0
- data/generators/talia_admin/templates/public/images/backend/footer_bg.gif +0 -0
- data/generators/talia_admin/templates/public/images/backend/header.jpg +0 -0
- data/generators/talia_admin/templates/public/images/backend/header_bg.gif +0 -0
- data/generators/talia_admin/templates/public/images/backend/menu.jpg +0 -0
- data/generators/talia_admin/templates/public/images/backend/menu_bg.gif +0 -0
- data/generators/talia_admin/templates/public/images/backend/opednid.gif +0 -0
- data/generators/talia_admin/templates/public/images/backend/page_bg.jpg +0 -0
- data/generators/talia_admin/templates/public/images/backend/triangolino.gif +0 -0
- data/generators/talia_admin/templates/public/images/backend/triangolino_full.gif +0 -0
- data/generators/talia_admin/templates/public/javascripts/backend.js +24 -0
- data/generators/talia_admin/templates/public/javascripts/lowpro.js +321 -0
- data/generators/talia_admin/templates/public/stylesheets/backend.css +466 -0
- data/generators/talia_admin/templates/test/fixtures/users.yml +32 -0
- data/generators/talia_admin/templates/test/functional/admin/custom_templates_controller_test.rb +8 -0
- data/generators/talia_admin/templates/test/functional/admin/locales_controller_test.rb +35 -0
- data/generators/talia_admin/templates/test/functional/admin/sources_controller_test.rb +109 -0
- data/generators/talia_admin/templates/test/functional/admin/translations_controller_test.rb +93 -0
- data/generators/talia_admin/templates/test/functional/admin/users_controller_test.rb +67 -0
- data/generators/talia_admin/templates/test/functional/admin_controller_test.rb +15 -0
- data/generators/talia_admin/templates/test/unit/user_test.rb +134 -0
- data/generators/talia_admin/templates/views/admin/background/_finished.html.erb +9 -0
- data/generators/talia_admin/templates/views/admin/background/_pending.html.erb +1 -0
- data/generators/talia_admin/templates/views/admin/background/_progress.html.erb +15 -0
- data/generators/talia_admin/templates/views/admin/background/_running.html.erb +11 -0
- data/generators/talia_admin/templates/views/admin/background/environment.html.erb +12 -0
- data/generators/talia_admin/templates/views/admin/background/show.html.erb +17 -0
- data/generators/talia_admin/templates/views/admin/background/stderr.html.erb +6 -0
- data/generators/talia_admin/templates/views/admin/background/stdin.html.erb +6 -0
- data/generators/talia_admin/templates/views/admin/background/stdout.html.erb +6 -0
- data/generators/talia_admin/templates/views/admin/custom_templates/_content_form_column.rhtml +2 -0
- data/generators/talia_admin/templates/views/admin/custom_templates/_template_type_form_column.rhtml +2 -0
- data/generators/talia_admin/templates/views/admin/index.html.erb +5 -0
- data/generators/talia_admin/templates/views/admin/locales/new.html.erb +9 -0
- data/generators/talia_admin/templates/views/admin/sources/_data.html.erb +6 -0
- data/generators/talia_admin/templates/views/admin/sources/_data_form.html.erb +15 -0
- data/generators/talia_admin/templates/views/admin/sources/_form.html.erb +7 -0
- data/generators/talia_admin/templates/views/admin/sources/_list.html.erb +3 -0
- data/generators/talia_admin/templates/views/admin/sources/_notice.html.erb +1 -0
- data/generators/talia_admin/templates/views/admin/sources/_predicate.html.erb +22 -0
- data/generators/talia_admin/templates/views/admin/sources/_predicates.html.erb +15 -0
- data/generators/talia_admin/templates/views/admin/sources/_sources.html.erb +17 -0
- data/generators/talia_admin/templates/views/admin/sources/_upload.html.erb +6 -0
- data/generators/talia_admin/templates/views/admin/sources/edit.html.erb +6 -0
- data/generators/talia_admin/templates/views/admin/sources/index.html.erb +5 -0
- data/generators/talia_admin/templates/views/admin/translations/_new_translation.html.erb +7 -0
- data/generators/talia_admin/templates/views/admin/translations/_translation.html.erb +10 -0
- data/generators/talia_admin/templates/views/admin/translations/edit.html.erb +16 -0
- data/generators/talia_admin/templates/views/admin/users/_form.html.erb +10 -0
- data/generators/talia_admin/templates/views/admin/users/_form_roles.html.erb +8 -0
- data/generators/talia_admin/templates/views/admin/users/edit.html.erb +12 -0
- data/generators/talia_admin/templates/views/admin/users/index.html.erb +22 -0
- data/generators/talia_admin/templates/views/admin/users/new.html.erb +5 -0
- data/generators/talia_admin/templates/views/admin/users/show.html.erb +6 -0
- data/generators/talia_admin/templates/views/layouts/admin.html.erb +56 -0
- data/generators/talia_base/USAGE +5 -0
- data/generators/talia_base/talia_base_generator.rb +62 -0
- data/generators/talia_base/templates/app/controllers/custom_templates_controller.rb +27 -0
- data/generators/talia_base/templates/app/controllers/ontologies_controller.rb +13 -0
- data/generators/talia_base/templates/app/controllers/sessions_controller.rb +90 -0
- data/generators/talia_base/templates/app/controllers/source_data/show.html.erb +2 -0
- data/generators/talia_base/templates/app/controllers/source_data_controller.rb +43 -0
- data/generators/talia_base/templates/app/controllers/sources_controller.rb +62 -0
- data/generators/talia_base/templates/app/controllers/types_controller.rb +23 -0
- data/generators/talia_base/templates/app/helpers/custom_templates_helper.rb +2 -0
- data/generators/talia_base/templates/app/helpers/ontologies_helper.rb +2 -0
- data/generators/talia_base/templates/app/helpers/sessions_helper.rb +2 -0
- data/generators/talia_base/templates/app/helpers/source_data/show.html.erb +2 -0
- data/generators/talia_base/templates/app/helpers/source_data_helper.rb +2 -0
- data/generators/talia_base/templates/app/helpers/sources_helper.rb +39 -0
- data/generators/talia_base/templates/app/helpers/types_helper.rb +2 -0
- data/generators/talia_base/templates/app/views/ontologies/index.builder +10 -0
- data/generators/talia_base/templates/app/views/ontologies/show.builder +7 -0
- data/generators/talia_base/templates/app/views/sessions/new.html.erb +33 -0
- data/generators/talia_base/templates/app/views/source_data/show.html.erb +2 -0
- data/generators/talia_base/templates/app/views/sources/_form.html.erb +15 -0
- data/generators/talia_base/templates/app/views/sources/edit.html.erb +9 -0
- data/generators/talia_base/templates/app/views/sources/index.html.erb +2 -0
- data/generators/talia_base/templates/app/views/sources/new.html.erb +8 -0
- data/generators/talia_base/templates/app/views/sources/show.html.erb +19 -0
- data/generators/talia_base/templates/app/views/types/index.html.erb +4 -0
- data/generators/talia_base/templates/app/views/types/show.html.erb +3 -0
- data/generators/talia_base/templates/config/routes.rb +83 -0
- data/generators/talia_base/templates/config/talia_initializer.rb +8 -0
- data/generators/talia_base/templates/migrations/bj_migration.rb +10 -0
- data/generators/talia_base/templates/migrations/constraint_migration.rb +24 -0
- data/generators/talia_base/templates/migrations/create_active_sources.rb +15 -0
- data/generators/talia_base/templates/migrations/create_custom_templates.rb +17 -0
- data/generators/talia_base/templates/migrations/create_data_records.rb +27 -0
- data/generators/talia_base/templates/migrations/create_open_id.rb +26 -0
- data/generators/talia_base/templates/migrations/create_progress_jobs.rb +18 -0
- data/generators/talia_base/templates/migrations/create_roles.rb +20 -0
- data/generators/talia_base/templates/migrations/create_semantic_properties.rb +14 -0
- data/generators/talia_base/templates/migrations/create_semantic_relations.rb +17 -0
- data/generators/talia_base/templates/migrations/create_sessions.rb +16 -0
- data/generators/talia_base/templates/migrations/create_users.rb +20 -0
- data/generators/talia_base/templates/migrations/create_workflows.rb +28 -0
- data/generators/talia_base/templates/migrations/populate_users.rb +11 -0
- data/generators/talia_base/templates/migrations/upgrade_relations.rb +12 -0
- data/generators/talia_base/templates/ontologies/hyper_ontology.owl +1462 -0
- data/generators/talia_base/templates/ontologies/hyper_ontology.pprj +9351 -0
- data/generators/talia_base/templates/ontologies/hyper_ontology.repository +6 -0
- data/generators/talia_base/templates/ontologies/scholar_0.1.owl +109 -0
- data/generators/talia_base/templates/script/configure_talia +292 -0
- data/generators/talia_base/templates/script/prepare_images +100 -0
- data/generators/talia_base/templates/talia.sh +51 -0
- data/generators/talia_base/templates/tasks/talia_core.rk +1 -0
- data/lib/loader_helper.rb +9 -0
- data/lib/talia_core.rb +0 -2
- data/lib/talia_dependencies.rb +5 -0
- data/lib/talia_util/rake_tasks.rb +223 -0
- data/tasks/talia_core_tasks.rake +2 -0
- metadata +138 -13
@@ -0,0 +1,83 @@
|
|
1
|
+
ActionController::Routing::Routes.draw do |map|
|
2
|
+
# The priority is based upon order of creation: first created -> highest priority.
|
3
|
+
|
4
|
+
# Sample of regular route:
|
5
|
+
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
|
6
|
+
# Keep in mind you can assign values other than :controller and :action
|
7
|
+
|
8
|
+
# Sample of named route:
|
9
|
+
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
|
10
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
11
|
+
|
12
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
13
|
+
# map.resources :products
|
14
|
+
|
15
|
+
# Sample resource route with options:
|
16
|
+
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
|
17
|
+
|
18
|
+
# Sample resource route with sub-resources:
|
19
|
+
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
|
20
|
+
|
21
|
+
# Sample resource route within a namespace:
|
22
|
+
# map.namespace :admin do |admin|
|
23
|
+
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
|
24
|
+
# admin.resources :products
|
25
|
+
# end
|
26
|
+
|
27
|
+
# See how all your routes lay out with "rake routes"
|
28
|
+
|
29
|
+
# Default route
|
30
|
+
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
|
31
|
+
|
32
|
+
map.namespace :admin do |admin|
|
33
|
+
admin.resources :translations, :collection => { :search => :get }
|
34
|
+
admin.resources :users
|
35
|
+
admin.resources :sources
|
36
|
+
admin.resources :locales
|
37
|
+
admin.resources :background, :active_scaffold => true
|
38
|
+
admin.resources :custom_templates, :active_scaffold => true
|
39
|
+
end
|
40
|
+
|
41
|
+
# Routes for login and users handling
|
42
|
+
map.resources :users
|
43
|
+
map.login 'login', :controller => 'sessions', :action => 'create'
|
44
|
+
map.logout 'logout', :controller => 'sessions', :action => 'destroy'
|
45
|
+
map.admin 'admin', :controller => 'admin', :action => 'index'
|
46
|
+
map.open_id_complete 'session', :controller => 'sessions', :action => 'create', :requirements => { :method => :get }
|
47
|
+
map.resource :session
|
48
|
+
map.resources :languages, :member => { :change => :get }
|
49
|
+
|
50
|
+
# Routes for the ontologies
|
51
|
+
map.resources :ontologies
|
52
|
+
|
53
|
+
# Routes for the sources
|
54
|
+
map.resources :sources, :requirements => { :id => /.+/ }
|
55
|
+
|
56
|
+
# Routes for types
|
57
|
+
map.resources :types
|
58
|
+
|
59
|
+
# Routes for hyperedition previews
|
60
|
+
map.connect '/preview', :controller => 'preview'
|
61
|
+
|
62
|
+
# Routes for the source data
|
63
|
+
map.connect 'source_data/:id', :controller => 'source_data',
|
64
|
+
:action => 'show'
|
65
|
+
map.connect 'source_data/:type/:location', :controller => 'source_data',
|
66
|
+
:action => 'show_tloc',
|
67
|
+
:requirements => { :location => /[^\/]+/ } # Force the location to match also filenames with points etc.
|
68
|
+
|
69
|
+
map.resources :data_records, :controller => 'source_data'
|
70
|
+
|
71
|
+
# Routes for the widget engine
|
72
|
+
# map.resources :widgeon, :collection => { :callback => :all } do |widgets|
|
73
|
+
# widgets.connect ':file', :controller => 'widgeon', :action => 'load_file', :requirements => { :file => %r([^;,?]+) }
|
74
|
+
# end
|
75
|
+
|
76
|
+
# Routes for import
|
77
|
+
map.connect 'import/:action', :controller => 'import', :action => 'start_import'
|
78
|
+
|
79
|
+
map.connect ':controller/:action/:id.:format'
|
80
|
+
map.connect ':controller/:action/:id'
|
81
|
+
|
82
|
+
|
83
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class ConstraintMigration < ActiveRecord::Migration
|
2
|
+
|
3
|
+
# Creates a foreign key constraint
|
4
|
+
def self.create_constraint(table, foreign_table, local_key = nil, foreign_key = nil)
|
5
|
+
local_key ||= "#{foreign_table.singularize}_id"
|
6
|
+
foreign_key ||= "id"
|
7
|
+
if(ENV['noconstraints'] != 'yes')
|
8
|
+
puts "Creating foreign key constraint on #{table}. Try 'noconstraints=yes' if this fails."
|
9
|
+
execute "alter table #{table} add constraint #{table}_to_#{foreign_table} foreign key (#{local_key}) references #{foreign_table}(#{foreign_key})"
|
10
|
+
else
|
11
|
+
puts "Ignoring foreign key constraint"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# Removes a foreign key constraint
|
16
|
+
def self.remove_constraint(table, foreign_table)
|
17
|
+
if(ENV['noconstraints'] != 'yes')
|
18
|
+
puts "Removing foreign key constraint on #{table}. Try 'noconstraints=yes' if this fails."
|
19
|
+
execute "alter table #{table} drop foreign key #{table}_to_#{foreign_table}"
|
20
|
+
else
|
21
|
+
puts "Not removing foreign key constraint for #{table}"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateActiveSources < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :active_sources do |t|
|
4
|
+
t.timestamps
|
5
|
+
t.string :uri, :null => false
|
6
|
+
t.string :type
|
7
|
+
end
|
8
|
+
|
9
|
+
add_index :active_sources, :uri, :unique => true
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.down
|
13
|
+
drop_table :active_sources
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateCustomTemplates < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :custom_templates do |t|
|
4
|
+
|
5
|
+
t.timestamps
|
6
|
+
t.string :name, :null => false
|
7
|
+
t.string :template_type, :null => false
|
8
|
+
t.text :content, :null => false
|
9
|
+
end
|
10
|
+
|
11
|
+
add_index :custom_templates, :name, :unique => true
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
drop_table :custom_templates
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), "constraint_migration")
|
2
|
+
|
3
|
+
class CreateDataRecords < ConstraintMigration
|
4
|
+
def self.up
|
5
|
+
create_table "data_records", :force => true do |t|
|
6
|
+
t.string :type
|
7
|
+
t.string :location, :null => false
|
8
|
+
t.string :mime
|
9
|
+
t.references :source, :null => false
|
10
|
+
end
|
11
|
+
|
12
|
+
# Create the index
|
13
|
+
add_index :data_records, :source_id, :unique => false
|
14
|
+
|
15
|
+
# Create the foreign key
|
16
|
+
create_constraint("data_records", "active_sources", 'source_id')
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.down
|
20
|
+
# drop the foreign key
|
21
|
+
remove_constraint("data_records", "active_sources")
|
22
|
+
|
23
|
+
# drop the table
|
24
|
+
drop_table "data_records"
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class CreateOpenId < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :open_id_authentication_associations, :force => true do |t|
|
4
|
+
t.integer :issued, :lifetime
|
5
|
+
t.string :handle, :assoc_type
|
6
|
+
t.binary :server_url, :secret
|
7
|
+
end
|
8
|
+
|
9
|
+
create_table :open_id_authentication_nonces, :force => true do |t|
|
10
|
+
t.integer :timestamp, :null => false
|
11
|
+
t.string :server_url, :null => true
|
12
|
+
t.string :salt, :null => false
|
13
|
+
end
|
14
|
+
|
15
|
+
# add open_id column to users
|
16
|
+
add_column :users, :open_id, :string, :default => nil
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.down
|
20
|
+
# remove open_id column from users
|
21
|
+
remove_column :users, :open_id
|
22
|
+
|
23
|
+
drop_table :open_id_authentication_associations
|
24
|
+
drop_table :open_id_authentication_nonces
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateProgressJobs < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table "progress_jobs", :force => true do |t|
|
4
|
+
t.integer :job_id
|
5
|
+
t.integer :processed_count, :null => false
|
6
|
+
t.integer :item_count, :null => false
|
7
|
+
t.timestamp :started_at
|
8
|
+
t.string :progress_message
|
9
|
+
end
|
10
|
+
|
11
|
+
# Create the index
|
12
|
+
add_index :progress_jobs, :job_id, :unique => true
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.down
|
16
|
+
drop_table "progress_jobs"
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CreateRoles < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table "roles" do |t|
|
4
|
+
t.column :name, :string
|
5
|
+
end
|
6
|
+
|
7
|
+
# generate the join table
|
8
|
+
create_table "roles_users", :id => false do |t|
|
9
|
+
t.column "role_id", :integer
|
10
|
+
t.column "user_id", :integer
|
11
|
+
end
|
12
|
+
add_index "roles_users", "role_id"
|
13
|
+
add_index "roles_users", "user_id"
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.down
|
17
|
+
drop_table "roles"
|
18
|
+
drop_table "roles_users"
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateSemanticProperties < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :semantic_properties do |t|
|
4
|
+
t.timestamps
|
5
|
+
t.text :value, :null => false
|
6
|
+
end
|
7
|
+
|
8
|
+
# add_index :semantic_properties, :value, :unique => false
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.down
|
12
|
+
drop_table :semantic_properties
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateSemanticRelations < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :semantic_relations do |t|
|
4
|
+
t.timestamps
|
5
|
+
t.references :object, :polymorphic => true, :null => false
|
6
|
+
t.references :subject, :class_name => 'ActiveSource', :null => false
|
7
|
+
t.string :predicate_uri, :null => false
|
8
|
+
end
|
9
|
+
|
10
|
+
add_index :semantic_relations, :predicate_uri, :unique => false
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
drop_table :semantic_relations
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateSessions < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :sessions do |t|
|
4
|
+
t.string :session_id, :null => false
|
5
|
+
t.text :data
|
6
|
+
t.timestamps
|
7
|
+
end
|
8
|
+
|
9
|
+
add_index :sessions, :session_id
|
10
|
+
add_index :sessions, :updated_at
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :sessions
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CreateUsers < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table "users", :force => true do |t|
|
4
|
+
t.column :login, :string
|
5
|
+
t.column :email, :string
|
6
|
+
t.column :crypted_password, :string, :limit => 40
|
7
|
+
t.column :salt, :string, :limit => 40
|
8
|
+
t.column :created_at, :datetime
|
9
|
+
t.column :updated_at, :datetime
|
10
|
+
t.column :remember_token, :string
|
11
|
+
t.column :remember_token_expires_at, :datetime
|
12
|
+
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.down
|
18
|
+
drop_table "users"
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), "constraint_migration")
|
2
|
+
|
3
|
+
class CreateWorkflows < ConstraintMigration
|
4
|
+
|
5
|
+
def self.up
|
6
|
+
create_table "workflows", :force => true do |t|
|
7
|
+
t.string :state, :null => false
|
8
|
+
t.string :arguments, :null => false
|
9
|
+
t.string :type
|
10
|
+
t.references :source, :null => false
|
11
|
+
end
|
12
|
+
|
13
|
+
# Create the index
|
14
|
+
add_index :workflows, :source_id, :unique => true
|
15
|
+
|
16
|
+
# Create the foreign key
|
17
|
+
create_constraint("workflows", "active_sources", "source_id")
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.down
|
21
|
+
# drop the foreign key
|
22
|
+
remove_constraint("workflows", "active_sources")
|
23
|
+
|
24
|
+
# drop the table
|
25
|
+
drop_table "workflows"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class PopulateUsers < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
admins = Role.create :name => 'admin'
|
4
|
+
Role.create :name => 'user'
|
5
|
+
admin = User.create :login => 'admin', :email => 'admin@admins.foob', :password => 'admin', :password_confirmation => 'admin'
|
6
|
+
admin.roles << admins
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.down
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class UpgradeRelations < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :semantic_relations, :rel_order, :integer, :null => true
|
4
|
+
# Preparing to have the values in the same table
|
5
|
+
add_column :semantic_relations, :value, :string, :null => true
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.down
|
9
|
+
remove_column :semantic_relations, :rel_order
|
10
|
+
remove_column :semantic_relations, :value
|
11
|
+
end
|
12
|
+
end
|