enju_event 0.1.17.pre17 → 0.1.17.pre18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/event_import_files_controller.rb +7 -2
- data/app/controllers/event_import_results_controller.rb +1 -1
- data/app/models/event.rb +11 -13
- data/app/models/event_import_file.rb +52 -73
- data/app/models/event_import_file_state_machine.rb +19 -0
- data/app/models/event_import_file_transition.rb +20 -0
- data/app/views/calendar/index.html.erb +2 -2
- data/app/views/event_categories/edit.html.erb +2 -2
- data/app/views/event_categories/index.html.erb +2 -2
- data/app/views/event_categories/new.html.erb +2 -2
- data/app/views/event_categories/show.html.erb +2 -2
- data/app/views/event_import_files/edit.html.erb +2 -2
- data/app/views/event_import_files/index.html.erb +4 -4
- data/app/views/event_import_files/new.html.erb +17 -4
- data/app/views/event_import_files/show.html.erb +13 -3
- data/app/views/event_import_results/index.html.erb +6 -6
- data/app/views/event_import_results/{index.csv.erb → index.tsv.erb} +0 -0
- data/app/views/event_import_results/show.html.erb +2 -2
- data/app/views/events/edit.html.erb +2 -2
- data/app/views/events/index.html.erb +2 -2
- data/app/views/events/new.html.erb +2 -2
- data/app/views/events/show.html.erb +8 -3
- data/app/views/participates/edit.html.erb +2 -2
- data/app/views/participates/index.html.erb +2 -2
- data/app/views/participates/new.html.erb +2 -2
- data/app/views/participates/show.html.erb +2 -2
- data/app/workers/event_import_file_queue.rb +7 -0
- data/config/locales/translation_en.yml +1 -0
- data/config/locales/translation_ja.yml +1 -0
- data/db/migrate/20081028093607_create_event_import_files.rb +0 -2
- data/db/migrate/20140523171309_create_event_import_file_transitions.rb +14 -0
- data/db/migrate/20140628071719_add_user_encoding_to_event_import_file.rb +5 -0
- data/lib/enju_event/engine.rb +1 -1
- data/lib/enju_event/version.rb +1 -1
- data/spec/dummy/db/migrate/005_create_manifestations.rb +0 -12
- data/spec/dummy/db/migrate/006_create_items.rb +2 -2
- data/spec/dummy/db/migrate/029_create_subjects.rb +27 -0
- data/spec/dummy/db/migrate/032_create_checkins.rb +17 -0
- data/spec/dummy/db/migrate/033_create_checkouts.rb +25 -0
- data/spec/dummy/db/migrate/035_create_reserves.rb +27 -0
- data/spec/dummy/db/migrate/059_create_libraries.rb +1 -7
- data/spec/dummy/db/migrate/069_create_shelves.rb +1 -5
- data/spec/dummy/db/migrate/{20111201163342_create_user_groups.rb → 077_create_user_groups.rb} +2 -2
- data/spec/dummy/db/migrate/080_create_library_groups.rb +2 -9
- data/spec/dummy/db/migrate/120_create_baskets.rb +12 -0
- data/spec/dummy/db/migrate/121_create_checked_items.rb +17 -0
- data/spec/dummy/db/migrate/124_create_bookstores.rb +17 -0
- data/spec/dummy/db/migrate/127_create_use_restrictions.rb +16 -0
- data/spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb +16 -0
- data/spec/dummy/db/migrate/130_create_request_status_types.rb +12 -0
- data/spec/dummy/db/migrate/131_create_request_types.rb +12 -0
- data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +16 -0
- data/spec/dummy/db/migrate/142_create_classifications.rb +19 -0
- data/spec/dummy/db/migrate/143_create_subject_has_classifications.rb +16 -0
- data/spec/dummy/db/migrate/144_create_classification_types.rb +16 -0
- data/spec/dummy/db/migrate/145_create_subject_heading_types.rb +16 -0
- data/spec/dummy/db/migrate/146_create_subject_types.rb +16 -0
- data/spec/dummy/db/migrate/149_create_message_templates.rb +18 -0
- data/spec/dummy/db/migrate/154_create_messages.rb +24 -0
- data/spec/dummy/db/migrate/20080606052544_create_work_has_subjects.rb +18 -0
- data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +20 -0
- data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +17 -0
- data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +14 -0
- data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +17 -0
- data/spec/dummy/db/migrate/20081030023412_create_checkout_types.rb +17 -0
- data/spec/dummy/db/migrate/20081030023518_create_user_group_has_checkout_types.rb +25 -0
- data/spec/dummy/db/migrate/20081030023615_create_carrier_type_has_checkout_types.rb +18 -0
- data/spec/dummy/db/migrate/20081212075554_create_checkout_stat_has_manifestations.rb +17 -0
- data/spec/dummy/db/migrate/20081212080038_create_manifestation_checkout_stats.rb +16 -0
- data/spec/dummy/db/migrate/20081215094302_create_user_checkout_stats.rb +16 -0
- data/spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb +17 -0
- data/spec/dummy/db/migrate/20081216190517_create_reserve_stat_has_manifestations.rb +17 -0
- data/spec/dummy/db/migrate/20081216190724_create_manifestation_reserve_stats.rb +16 -0
- data/spec/dummy/db/migrate/20081220023628_create_user_reserve_stats.rb +16 -0
- data/spec/dummy/db/migrate/20081220034117_create_reserve_stat_has_users.rb +17 -0
- data/spec/dummy/db/migrate/20090208044541_create_subject_heading_type_has_subjects.rb +16 -0
- data/spec/dummy/db/migrate/20090321130448_add_completed_at_to_user_checkout_stat.rb +27 -0
- data/spec/dummy/db/migrate/20090831220301_create_lending_policies.rb +21 -0
- data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +9 -0
- data/spec/dummy/db/migrate/20110301134521_add_expire_date_to_reserve.rb +9 -0
- data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +11 -0
- data/spec/dummy/db/migrate/20110328130826_add_current_checkout_count_to_user_group_has_checkout_type.rb +9 -0
- data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +9 -0
- data/spec/dummy/db/migrate/20110621093332_remove_expire_date_from_reserve.rb +9 -0
- data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +13 -0
- data/spec/dummy/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +11 -0
- data/spec/dummy/db/migrate/20110913120629_add_lft_and_rgt_to_classification.rb +11 -0
- data/spec/dummy/db/migrate/20111201155456_devise_create_users.rb +42 -0
- data/spec/dummy/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +5 -0
- data/spec/dummy/db/migrate/20111218002349_add_checkout_icalendar_token_to_user.rb +6 -0
- data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +6 -0
- data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +12 -0
- data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +14 -0
- data/spec/dummy/db/migrate/20120406020752_add_url_to_subject.rb +5 -0
- data/spec/dummy/db/migrate/20120424103932_add_librarian_id_to_checked_item.rb +5 -0
- data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +5 -0
- data/spec/dummy/db/migrate/20121116033446_add_doi_to_manifestation.rb +6 -0
- data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +26 -0
- data/spec/dummy/db/migrate/20130303104849_add_state_index_to_reserve.rb +5 -0
- data/spec/dummy/db/migrate/20130303124821_add_retained_at_to_reserve.rb +5 -0
- data/spec/dummy/db/migrate/20130304015019_add_postponed_at_to_reserve.rb +5 -0
- data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +6 -0
- data/spec/dummy/db/migrate/20130416054135_add_circulation_status_id_to_item.rb +8 -0
- data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +7 -0
- data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +5 -0
- data/spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +6 -0
- data/spec/dummy/db/migrate/20130504133816_add_manifestation_id_to_subject.rb +6 -0
- data/spec/dummy/db/migrate/20130504143515_add_manifestation_id_to_classification.rb +6 -0
- data/spec/dummy/db/migrate/20130504195916_add_subject_heading_type_id_to_subject.rb +5 -0
- data/spec/dummy/db/migrate/20130506175303_create_identifier_types.rb +12 -0
- data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +15 -0
- data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20130519065638_add_lock_version_to_reserve.rb +5 -0
- data/spec/dummy/db/migrate/20130519065837_add_lock_version_to_checkin.rb +5 -0
- data/spec/dummy/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +11 -0
- data/spec/dummy/db/schema.rb +613 -92
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/private/system/event_import_files/event_imports/000/000/004/original/event_import_file_sample1.tsv +7 -7
- data/spec/dummy/solr/default/data/index/_b2.fdt +0 -0
- data/spec/dummy/solr/default/data/index/{_14y.fdx → _b2.fdx} +0 -0
- data/spec/dummy/solr/default/data/index/{_14y.fnm → _b2.fnm} +0 -0
- data/spec/dummy/solr/default/data/index/{_14y.nvd → _b2.nvd} +0 -0
- data/spec/dummy/solr/default/data/index/{_14y.nvm → _b2.nvm} +0 -0
- data/spec/dummy/solr/default/data/index/{_14y.si → _b2.si} +0 -0
- data/spec/dummy/solr/default/data/index/{_14y_Lucene41_0.doc → _b2_Lucene41_0.doc} +0 -0
- data/spec/dummy/solr/default/data/index/{_14y_Lucene41_0.pos → _b2_Lucene41_0.pos} +0 -0
- data/spec/dummy/solr/default/data/index/{_14y_Lucene41_0.tim → _b2_Lucene41_0.tim} +0 -0
- data/spec/dummy/solr/default/data/index/{_14y_Lucene41_0.tip → _b2_Lucene41_0.tip} +0 -0
- data/spec/dummy/solr/default/data/index/_b3.fdt +0 -0
- data/spec/dummy/solr/default/data/index/{_14z.fdx → _b3.fdx} +0 -0
- data/spec/dummy/solr/default/data/index/{_14z.fnm → _b3.fnm} +0 -0
- data/spec/dummy/solr/default/data/index/{_14z.nvd → _b3.nvd} +0 -0
- data/spec/dummy/solr/default/data/index/{_14z.nvm → _b3.nvm} +0 -0
- data/spec/dummy/solr/default/data/index/{_14z.si → _b3.si} +0 -0
- data/spec/dummy/solr/default/data/index/{_14z_Lucene41_0.doc → _b3_Lucene41_0.doc} +0 -0
- data/spec/dummy/solr/default/data/index/_b3_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/default/data/index/_b3_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/default/data/index/_b3_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/default/data/index/segments.gen +0 -0
- data/spec/dummy/solr/default/data/index/segments_ht +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000630 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000631 +0 -0
- data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000002010 → tlog.0000000000000000632} +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000633 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000634 +0 -0
- data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000002013 → tlog.0000000000000000635} +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000636 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000637 +0 -0
- data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000002016 → tlog.0000000000000000638} +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000639 +0 -0
- data/spec/dummy/solr/test/data/index/segments.gen +0 -0
- data/spec/dummy/solr/test/data/index/segments_1 +0 -0
- data/spec/fixtures/event_import_files.yml +1 -4
- data/spec/fixtures/libraries.yml +0 -5
- data/spec/models/event_import_file_spec.rb +14 -6
- data/spec/models/event_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- data/spec/support/resque.rb +32 -0
- metadata +271 -140
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20100222124420_add_allow_bookmark_external_url_to_library_group.rb +0 -9
- data/spec/dummy/db/migrate/20100527113752_create_delayed_jobs.rb +0 -21
- data/spec/dummy/db/migrate/20110115022329_add_position_to_library_group.rb +0 -9
- data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +0 -9
- data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +0 -12
- data/spec/dummy/db/migrate/20111020063828_remove_dsbl_from_library_group.rb +0 -11
- data/spec/dummy/db/migrate/20111201155456_create_users.rb +0 -14
- data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +0 -52
- data/spec/dummy/solr/default/data/index/_14y.fdt +0 -0
- data/spec/dummy/solr/default/data/index/_14z.fdt +0 -0
- data/spec/dummy/solr/default/data/index/_14z_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/default/data/index/_14z_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/default/data/index/_14z_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/default/data/index/segments_1k3 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002008 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002009 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002011 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002012 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002014 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002015 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000002017 +0 -0
- data/spec/dummy/solr/test/data/index/_a.fdt +0 -0
- data/spec/dummy/solr/test/data/index/_a.fdx +0 -0
- data/spec/dummy/solr/test/data/index/_a.fnm +0 -0
- data/spec/dummy/solr/test/data/index/_a.nvd +0 -0
- data/spec/dummy/solr/test/data/index/_a.nvm +0 -0
- data/spec/dummy/solr/test/data/index/_a.si +0 -0
- data/spec/dummy/solr/test/data/index/_a_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/test/data/index/_a_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/test/data/index/_a_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/test/data/index/_a_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/test/data/index/segments_n +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000000013 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000000014 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000000015 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000000016 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000000017 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000000018 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000000019 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000000020 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000000021 +0 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateCheckins < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :checkins do |t|
|
4
|
+
t.integer :item_id, :null => false
|
5
|
+
t.integer :librarian_id
|
6
|
+
t.integer :basket_id
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :checkins, :item_id
|
10
|
+
add_index :checkins, :librarian_id
|
11
|
+
add_index :checkins, :basket_id
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
drop_table :checkins
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class CreateCheckouts < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :checkouts do |t|
|
4
|
+
t.integer :user_id
|
5
|
+
t.integer :item_id, :null => false
|
6
|
+
t.integer :checkin_id
|
7
|
+
t.integer :librarian_id
|
8
|
+
t.integer :basket_id
|
9
|
+
t.datetime :due_date
|
10
|
+
t.integer :checkout_renewal_count, :default => 0, :null => false
|
11
|
+
t.integer :lock_version, :default => 0, :null => false
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
add_index :checkouts, :user_id
|
15
|
+
add_index :checkouts, :item_id
|
16
|
+
add_index :checkouts, :basket_id
|
17
|
+
add_index :checkouts, [:item_id, :basket_id], :unique => true
|
18
|
+
add_index :checkouts, :librarian_id
|
19
|
+
add_index :checkouts, :checkin_id
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.down
|
23
|
+
drop_table :checkouts
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class CreateReserves < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :reserves do |t|
|
4
|
+
t.integer :user_id, :null => false
|
5
|
+
t.integer :manifestation_id, :null => false
|
6
|
+
t.integer :item_id
|
7
|
+
t.integer :request_status_type_id, :null => false
|
8
|
+
t.datetime :checked_out_at
|
9
|
+
t.timestamps
|
10
|
+
t.datetime :canceled_at
|
11
|
+
t.datetime :expired_at
|
12
|
+
t.datetime :deleted_at
|
13
|
+
t.string :state
|
14
|
+
t.boolean :expiration_notice_to_patron, :default => false
|
15
|
+
t.boolean :expiration_notice_to_library, :default => false
|
16
|
+
end
|
17
|
+
|
18
|
+
add_index :reserves, :user_id
|
19
|
+
add_index :reserves, :manifestation_id
|
20
|
+
add_index :reserves, :item_id
|
21
|
+
add_index :reserves, :request_status_type_id
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.down
|
25
|
+
drop_table :reserves
|
26
|
+
end
|
27
|
+
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
class CreateLibraries < ActiveRecord::Migration
|
2
|
-
def
|
2
|
+
def change
|
3
3
|
create_table :libraries do |t|
|
4
|
-
t.references :agent, :polymorphic => true
|
5
4
|
t.string :name, :null => false
|
6
5
|
t.text :display_name
|
7
6
|
t.string :short_display_name, :null => false
|
@@ -23,12 +22,7 @@ class CreateLibraries < ActiveRecord::Migration
|
|
23
22
|
t.timestamps
|
24
23
|
t.datetime :deleted_at
|
25
24
|
end
|
26
|
-
add_index :libraries, :agent_id, :unique => true
|
27
25
|
add_index :libraries, :library_group_id
|
28
26
|
add_index :libraries, :name, :unique => true
|
29
27
|
end
|
30
|
-
|
31
|
-
def self.down
|
32
|
-
drop_table :libraries
|
33
|
-
end
|
34
28
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class CreateShelves < ActiveRecord::Migration
|
2
|
-
def
|
2
|
+
def change
|
3
3
|
create_table :shelves do |t|
|
4
4
|
t.string :name, :null => false
|
5
5
|
t.text :display_name
|
@@ -12,8 +12,4 @@ class CreateShelves < ActiveRecord::Migration
|
|
12
12
|
end
|
13
13
|
add_index :shelves, :library_id
|
14
14
|
end
|
15
|
-
|
16
|
-
def self.down
|
17
|
-
drop_table :shelves
|
18
|
-
end
|
19
15
|
end
|
data/spec/dummy/db/migrate/{20111201163342_create_user_groups.rb → 077_create_user_groups.rb}
RENAMED
@@ -1,12 +1,12 @@
|
|
1
1
|
class CreateUserGroups < ActiveRecord::Migration
|
2
2
|
def change
|
3
3
|
create_table :user_groups do |t|
|
4
|
-
t.string :name
|
4
|
+
t.string :name, :not_null => true
|
5
5
|
t.text :display_name
|
6
6
|
t.text :note
|
7
7
|
t.integer :position
|
8
|
-
|
9
8
|
t.timestamps
|
9
|
+
t.datetime :deleted_at
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -1,25 +1,18 @@
|
|
1
1
|
class CreateLibraryGroups < ActiveRecord::Migration
|
2
|
-
def
|
2
|
+
def change
|
3
3
|
create_table :library_groups do |t|
|
4
4
|
t.string :name, :null => false
|
5
5
|
t.text :display_name
|
6
6
|
t.string :short_name, :null => false
|
7
7
|
t.string :email
|
8
8
|
t.text :my_networks
|
9
|
-
t.boolean :use_dsbl, :default => false, :null => false
|
10
|
-
t.text :dsbl_list
|
11
9
|
t.text :login_banner
|
12
10
|
t.text :note
|
13
|
-
t.integer :valid_period_for_new_user, :default => 365, :null => false
|
14
|
-
t.boolean :post_to_union_catalog, :default => false, :null => false
|
15
11
|
t.integer :country_id
|
12
|
+
t.integer :position
|
16
13
|
|
17
14
|
t.timestamps
|
18
15
|
end
|
19
16
|
add_index :library_groups, :short_name
|
20
17
|
end
|
21
|
-
|
22
|
-
def self.down
|
23
|
-
drop_table :library_groups
|
24
|
-
end
|
25
18
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateCheckedItems < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :checked_items do |t|
|
4
|
+
t.integer :item_id, :null => false
|
5
|
+
t.integer :basket_id, :null => false
|
6
|
+
t.datetime :due_date, :null => false
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
add_index :checked_items, :item_id
|
11
|
+
add_index :checked_items, :basket_id
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
drop_table :checked_items
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateBookstores < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :bookstores do |t|
|
4
|
+
t.text :name, :null => false
|
5
|
+
t.string :zip_code
|
6
|
+
t.text :address
|
7
|
+
t.text :note
|
8
|
+
t.string :telephone_number
|
9
|
+
t.string :fax_number
|
10
|
+
t.string :url
|
11
|
+
t.integer :position
|
12
|
+
t.datetime :deleted_at
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateUseRestrictions < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :use_restrictions do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.text :note
|
7
|
+
t.integer :position
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :use_restrictions
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateItemHasUseRestrictions < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :item_has_use_restrictions do |t|
|
4
|
+
t.integer :item_id, :null => false
|
5
|
+
t.integer :use_restriction_id, :null => false
|
6
|
+
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :item_has_use_restrictions, :item_id
|
10
|
+
add_index :item_has_use_restrictions, :use_restriction_id
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :item_has_use_restrictions
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateCirculationStatuses < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :circulation_statuses do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.text :note
|
7
|
+
t.integer :position
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :circulation_statuses
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreateClassifications < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :classifications do |t|
|
4
|
+
t.integer :parent_id
|
5
|
+
t.string :category, :null => false
|
6
|
+
t.text :note
|
7
|
+
t.integer :classification_type_id, :null => false
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
add_index :classifications, :parent_id
|
12
|
+
add_index :classifications, :category
|
13
|
+
add_index :classifications, :classification_type_id
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.down
|
17
|
+
drop_table :classifications
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateSubjectHasClassifications < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :subject_has_classifications do |t|
|
4
|
+
t.references :subject, :polymorphic => true
|
5
|
+
t.integer :classification_id, :null => false
|
6
|
+
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :subject_has_classifications, :subject_id
|
10
|
+
add_index :subject_has_classifications, :classification_id
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :subject_has_classifications
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateClassificationTypes < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :classification_types do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.text :note
|
7
|
+
t.integer :position
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :classification_types
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateSubjectHeadingTypes < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :subject_heading_types do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.text :note
|
7
|
+
t.integer :position
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :subject_heading_types
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateSubjectTypes < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :subject_types do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.text :note
|
7
|
+
t.integer :position
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :subject_types
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateMessageTemplates < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :message_templates do |t|
|
4
|
+
t.string :status, :null => false
|
5
|
+
t.text :title, :null => false
|
6
|
+
t.text :body, :null => false
|
7
|
+
t.integer :position
|
8
|
+
t.string :locale, :default => I18n.default_locale.to_s
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
add_index :message_templates, :status, :unique => true
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.down
|
16
|
+
drop_table :message_templates
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class CreateMessages < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :messages, :force => true do |t|
|
4
|
+
t.datetime :read_at
|
5
|
+
t.integer :receiver_id, :sender_id
|
6
|
+
t.string :subject, :null => false
|
7
|
+
t.text :body
|
8
|
+
t.integer :message_request_id
|
9
|
+
t.string :state
|
10
|
+
t.integer :parent_id
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
|
15
|
+
add_index :messages, :sender_id
|
16
|
+
add_index :messages, :receiver_id
|
17
|
+
add_index :messages, :message_request_id
|
18
|
+
add_index :messages, :parent_id
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.down
|
22
|
+
drop_table :messages
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateWorkHasSubjects < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :work_has_subjects do |t|
|
4
|
+
t.references :subject, :polymorphic => true
|
5
|
+
#t.references :subjectable, :polymorphic => true
|
6
|
+
t.integer :work_id #, :null => false
|
7
|
+
t.integer :position
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
add_index :work_has_subjects, :subject_id
|
12
|
+
add_index :work_has_subjects, :work_id
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.down
|
16
|
+
drop_table :work_has_subjects
|
17
|
+
end
|
18
|
+
end
|