enju_bookmark 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/bookmark_sweeper.rb +1 -0
- data/app/views/bookmark_stat_has_manifestations/index.html.erb +1 -1
- data/app/views/bookmark_stats/index.html.erb +1 -1
- data/app/views/bookmarks/_index.html.erb +1 -1
- data/app/views/bookmarks/_index_user.html.erb +1 -1
- data/app/views/bookmarks/show.html.erb +1 -1
- data/lib/enju_bookmark.rb +2 -2
- data/lib/enju_bookmark/calculate_stat.rb +30 -0
- data/lib/enju_bookmark/expire_tag_cloud.rb +10 -0
- data/lib/enju_bookmark/version.rb +1 -1
- data/spec/dummy/app/models/user_has_role.rb +18 -0
- data/spec/dummy/config/application.rb +3 -0
- data/spec/dummy/config/initializers/mime_types.rb +0 -1
- data/spec/dummy/db/migrate/001_create_patrons.rb +1 -10
- data/spec/dummy/db/migrate/005_create_manifestations.rb +4 -16
- data/spec/dummy/db/migrate/006_create_items.rb +1 -9
- data/spec/dummy/db/migrate/012_create_owns.rb +12 -0
- data/spec/dummy/db/migrate/015_create_creates.rb +12 -0
- data/spec/dummy/db/migrate/047_create_produces.rb +12 -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/073_create_carrier_types.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 +1 -6
- data/spec/dummy/db/migrate/112_create_frequencies.rb +12 -0
- data/spec/dummy/db/migrate/117_create_form_of_works.rb +12 -0
- data/spec/dummy/db/migrate/124_create_bookstores.rb +17 -0
- data/spec/dummy/db/migrate/125_create_donates.rb +12 -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/20080830154109_create_realizes.rb +13 -0
- data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +1 -7
- data/spec/dummy/db/migrate/20080905191442_create_patron_types.rb +1 -5
- 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/20081025083323_create_countries.rb +28 -0
- data/spec/dummy/db/migrate/20081025083905_create_languages.rb +1 -5
- data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +15 -0
- data/spec/dummy/db/migrate/20081028083142_create_patron_import_files.rb +22 -0
- data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +22 -0
- data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +15 -0
- data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +15 -0
- data/spec/dummy/db/migrate/20090719201843_create_extents.rb +12 -0
- data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +12 -0
- data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +1 -5
- data/spec/dummy/db/migrate/20090812151902_create_patron_relationship_types.rb +12 -0
- data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +27 -0
- data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +12 -0
- data/spec/dummy/db/migrate/20091202124834_create_versions.rb +18 -0
- data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +2 -8
- data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +15 -0
- data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +13 -0
- data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +13 -0
- data/spec/dummy/db/migrate/20100606073747_create_patron_relationships.rb +13 -0
- data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +12 -0
- data/spec/dummy/db/migrate/20100814091104_add_position_to_patron_relationship.rb +11 -0
- data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +15 -0
- data/spec/dummy/db/migrate/20100925074559_create_patron_import_results.rb +12 -0
- data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +9 -0
- data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +11 -0
- data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +9 -0
- data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +11 -0
- data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +9 -0
- data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +12 -0
- data/spec/dummy/db/migrate/20110820131417_create_series_has_manifestations.rb +1 -5
- data/spec/dummy/db/migrate/20111009183423_add_ndc_to_manifestation.rb +9 -0
- data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +7 -0
- data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +5 -0
- data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +6 -0
- data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +12 -0
- data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +6 -0
- data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +6 -0
- data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_patron_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413170720_add_error_message_to_patron_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +9 -0
- data/spec/dummy/db/migrate/20120415060323_rename_patron_import_file_imported_at_to_executed_at.rb +9 -0
- data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +5 -0
- data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_patron_import_file.rb +5 -0
- data/spec/dummy/db/schema.rb +520 -106
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/fixtures/libraries.yml +0 -5
- metadata +141 -139
- data/lib/enju_bookmark/master_model.rb +0 -41
- data/lib/enju_bookmark/url_validator.rb +0 -10
- data/spec/dummy/app/models/bookstore.rb +0 -31
- data/spec/dummy/app/models/carrier_type.rb +0 -33
- data/spec/dummy/app/models/exemplify.rb +0 -45
- data/spec/dummy/app/models/item.rb +0 -121
- data/spec/dummy/app/models/language.rb +0 -4
- data/spec/dummy/app/models/library.rb +0 -128
- data/spec/dummy/app/models/library_group.rb +0 -86
- data/spec/dummy/app/models/manifestation.rb +0 -396
- data/spec/dummy/app/models/patron.rb +0 -168
- data/spec/dummy/app/models/patron_type.rb +0 -19
- data/spec/dummy/app/models/series_has_manifestation.rb +0 -35
- data/spec/dummy/app/models/series_statement.rb +0 -88
- data/spec/dummy/app/models/shelf.rb +0 -54
@@ -16,7 +16,7 @@
|
|
16
16
|
<td><%= bookmark_stat_has_manifestation.bookmarks_count -%></td>
|
17
17
|
<td><%= link_to t('page.show'), bookmark_stat_has_manifestation -%></td>
|
18
18
|
<td><%= link_to t('page.edit'), edit_bookmark_stat_has_manifestation_path(bookmark_stat_has_manifestation) -%></td>
|
19
|
-
<td><%= link_to t('page.destroy'), bookmark_stat_has_manifestation, :confirm => t('page.are_you_sure'), :method => :delete -%></td>
|
19
|
+
<td><%= link_to t('page.destroy'), bookmark_stat_has_manifestation, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%></td>
|
20
20
|
</tr>
|
21
21
|
<%- end -%>
|
22
22
|
</table>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<td>
|
19
19
|
<%= link_to t('page.show'), bookmark_stat -%>
|
20
20
|
<%= link_to t('page.edit'), edit_bookmark_stat_path(bookmark_stat) -%>
|
21
|
-
<%= link_to t('page.destroy'), bookmark_stat, :confirm => t('page.are_you_sure'), :method => :delete -%>
|
21
|
+
<%= link_to t('page.destroy'), bookmark_stat, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
|
22
22
|
</td>
|
23
23
|
</tr>
|
24
24
|
<%- end -%>
|
@@ -29,7 +29,7 @@
|
|
29
29
|
<td>
|
30
30
|
<%- if can? :destroy, bookmark -%>
|
31
31
|
<%= link_to t('page.show'), bookmark_path(bookmark) -%>
|
32
|
-
<%= link_to t('page.destroy'), bookmark_path(bookmark), :confirm => t('page.are_you_sure'), :method => :delete -%>
|
32
|
+
<%= link_to t('page.destroy'), bookmark_path(bookmark), :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
|
33
33
|
<%- end -%>
|
34
34
|
</td>
|
35
35
|
</tr>
|
@@ -31,7 +31,7 @@
|
|
31
31
|
<td><%= l(bookmark.created_at) -%></td>
|
32
32
|
<td>
|
33
33
|
<%- if can? :destroy, bookmark -%>
|
34
|
-
<%= link_to t('page.destroy'), bookmark, :confirm => t('page.are_you_sure'), :method => :delete -%>
|
34
|
+
<%= link_to t('page.destroy'), bookmark, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
|
35
35
|
<%- end -%>
|
36
36
|
</td>
|
37
37
|
</tr>
|
@@ -46,7 +46,7 @@
|
|
46
46
|
<div id="submenu" class="ui-corner-all">
|
47
47
|
<ul>
|
48
48
|
<li><%= link_to t('page.edit'),edit_bookmark_path(@bookmark) -%></li>
|
49
|
-
<li><%= link_to t('page.destroy'), @bookmark, :confirm => t('page.are_you_sure'), :method => :delete -%></li>
|
49
|
+
<li><%= link_to t('page.destroy'), @bookmark, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%></li>
|
50
50
|
<li><%= link_to t('page.back_to', :model => t('activerecord.models.manifestation')), @bookmark.manifestation -%></li>
|
51
51
|
<li><%= link_to t('page.back'), bookmarks_url -%></li>
|
52
52
|
</ul>
|
data/lib/enju_bookmark.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
module CalculateStat
|
2
|
+
|
3
|
+
def self.included(base)
|
4
|
+
base.extend ClassMethods
|
5
|
+
base.send :include, InstanceMethods
|
6
|
+
base.class_eval do
|
7
|
+
validates_presence_of :start_date, :end_date
|
8
|
+
validate :check_date
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module ClassMethods
|
13
|
+
def calculate_stat
|
14
|
+
self.not_calculated.each do |stat|
|
15
|
+
stat.aasm_calculate!
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
module InstanceMethods
|
21
|
+
def check_date
|
22
|
+
if self.start_date and self.end_date
|
23
|
+
if self.start_date >= self.end_date
|
24
|
+
errors.add(:start_date)
|
25
|
+
errors.add(:end_date)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module ExpireTagCloud
|
2
|
+
def expire_tag_cloud(bookmark)
|
3
|
+
I18n.available_locales.each do |locale|
|
4
|
+
Role.all_cache.each do |role|
|
5
|
+
expire_fragment(:controller => :tags, :action => :index, :page => 'user_tag_cloud', :user_id => bookmark.user.username, :locale => locale, :role => role.name, :user_id => nil)
|
6
|
+
expire_fragment(:controller => :tags, :action => :index, :page => 'public_tag_cloud', :locale => locale, :role => role.name, :user_id => nil)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -1,4 +1,22 @@
|
|
1
1
|
class UserHasRole < ActiveRecord::Base
|
2
|
+
attr_accessible :user_id, :role_id
|
3
|
+
attr_accessible :user_id, :role_id, :as => :admin
|
2
4
|
belongs_to :user
|
3
5
|
belongs_to :role
|
6
|
+
accepts_nested_attributes_for :role
|
7
|
+
|
8
|
+
# validates_uniqueness_of :role_id, :scope => :user_id
|
9
|
+
# validates_presence_of :role_id, :user_id
|
4
10
|
end
|
11
|
+
|
12
|
+
# == Schema Information
|
13
|
+
#
|
14
|
+
# Table name: user_has_roles
|
15
|
+
#
|
16
|
+
# id :integer not null, primary key
|
17
|
+
# user_id :integer
|
18
|
+
# role_id :integer
|
19
|
+
# created_at :datetime
|
20
|
+
# updated_at :datetime
|
21
|
+
#
|
22
|
+
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class CreatePatrons < ActiveRecord::Migration
|
2
|
-
def
|
2
|
+
def change
|
3
3
|
create_table :patrons do |t|
|
4
4
|
t.integer :user_id
|
5
5
|
t.string :last_name
|
@@ -38,11 +38,6 @@ class CreatePatrons < ActiveRecord::Migration
|
|
38
38
|
t.integer :patron_type_id, :default => 1, :null => false
|
39
39
|
t.integer :lock_version, :default => 0, :null => false
|
40
40
|
t.text :note
|
41
|
-
t.integer :creates_count, :default => 0, :null => false
|
42
|
-
t.integer :realizes_count, :default => 0, :null => false
|
43
|
-
t.integer :produces_count, :default => 0, :null => false
|
44
|
-
t.integer :owns_count, :default => 0, :null => false
|
45
|
-
#t.integer :resource_has_subjects_count, :default => 0, :null => false
|
46
41
|
t.integer :required_role_id, :default => 1, :null => false
|
47
42
|
t.integer :required_score, :default => 0, :null => false
|
48
43
|
t.string :state
|
@@ -55,8 +50,4 @@ class CreatePatrons < ActiveRecord::Migration
|
|
55
50
|
add_index :patrons, :required_role_id
|
56
51
|
add_index :patrons, :full_name
|
57
52
|
end
|
58
|
-
|
59
|
-
def self.down
|
60
|
-
drop_table :patrons
|
61
|
-
end
|
62
53
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class CreateManifestations < ActiveRecord::Migration
|
2
|
-
def
|
2
|
+
def change
|
3
3
|
create_table :manifestations do |t|
|
4
4
|
t.text :original_title, :null => false
|
5
5
|
t.text :title_alternative
|
@@ -16,9 +16,9 @@ class CreateManifestations < ActiveRecord::Migration
|
|
16
16
|
t.integer :extent_id, :default => 1, :null => false
|
17
17
|
t.integer :start_page
|
18
18
|
t.integer :end_page
|
19
|
-
t.
|
20
|
-
t.
|
21
|
-
t.
|
19
|
+
t.integer :height
|
20
|
+
t.integer :width
|
21
|
+
t.integer :depth
|
22
22
|
t.string :isbn
|
23
23
|
t.string :isbn10
|
24
24
|
t.string :wrong_isbn
|
@@ -27,20 +27,12 @@ class CreateManifestations < ActiveRecord::Migration
|
|
27
27
|
t.string :oclc_number
|
28
28
|
t.string :issn
|
29
29
|
t.integer :price # TODO: 通貨単位
|
30
|
-
#t.text :filename
|
31
|
-
#t.string :content_type
|
32
|
-
#t.integer :size
|
33
30
|
t.text :fulltext
|
34
31
|
t.string :volume_number_list
|
35
32
|
t.string :issue_number_list
|
36
33
|
t.string :serial_number_list
|
37
34
|
t.integer :edition
|
38
35
|
t.text :note
|
39
|
-
t.integer :produces_count, :default => 0, :null => false
|
40
|
-
t.integer :exemplifies_count, :default => 0, :null => false
|
41
|
-
t.integer :embodies_count, :default => 0, :null => false
|
42
|
-
t.integer :exemplifies_count, :default => 0, :null => false
|
43
|
-
t.integer :work_has_subjects_count, :default => 0, :null => false
|
44
36
|
t.boolean :repository_content, :default => false, :null => false
|
45
37
|
t.integer :lock_version, :default => 0, :null => false
|
46
38
|
t.integer :required_role_id, :default => 1, :null => false
|
@@ -61,8 +53,4 @@ class CreateManifestations < ActiveRecord::Migration
|
|
61
53
|
add_index :manifestations, :manifestation_identifier
|
62
54
|
add_index :manifestations, :updated_at
|
63
55
|
end
|
64
|
-
|
65
|
-
def self.down
|
66
|
-
drop_table :manifestations
|
67
|
-
end
|
68
56
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class CreateItems < ActiveRecord::Migration
|
2
|
-
def
|
2
|
+
def change
|
3
3
|
create_table :items do |t|
|
4
4
|
#t.integer :manifestation_id
|
5
5
|
t.string :call_number
|
@@ -9,11 +9,7 @@ class CreateItems < ActiveRecord::Migration
|
|
9
9
|
t.timestamps
|
10
10
|
t.datetime :deleted_at
|
11
11
|
t.integer :shelf_id, :default => 1, :null => false
|
12
|
-
t.integer :basket_id
|
13
12
|
t.boolean :include_supplements, :default => false, :null => false
|
14
|
-
t.integer :checkouts_count, :default => 0, :null => false
|
15
|
-
t.integer :owns_count, :default => 0, :null => false
|
16
|
-
t.integer :resource_has_subjects_count, :default => 0, :null => false
|
17
13
|
t.text :note
|
18
14
|
t.string :url
|
19
15
|
t.integer :price
|
@@ -29,8 +25,4 @@ class CreateItems < ActiveRecord::Migration
|
|
29
25
|
add_index :items, :item_identifier
|
30
26
|
add_index :items, :required_role_id
|
31
27
|
end
|
32
|
-
|
33
|
-
def self.down
|
34
|
-
drop_table :items
|
35
|
-
end
|
36
28
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateOwns < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :owns do |t|
|
4
|
+
t.references :patron, :null => false
|
5
|
+
t.references :item, :null => false
|
6
|
+
t.integer :position
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :owns, :patron_id
|
10
|
+
add_index :owns, :item_id
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateCreates < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :creates do |t|
|
4
|
+
t.references :patron, :null => false
|
5
|
+
t.references :work, :null => false
|
6
|
+
t.integer :position
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :creates, :patron_id
|
10
|
+
add_index :creates, :work_id
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateProduces < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :produces do |t|
|
4
|
+
t.references :patron, :null => false
|
5
|
+
t.references :manifestation, :null => false
|
6
|
+
t.integer :position
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :produces, :patron_id
|
10
|
+
add_index :produces, :manifestation_id
|
11
|
+
end
|
12
|
+
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 :patron, :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, :patron_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
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class CreateCarrierTypes < ActiveRecord::Migration
|
2
|
-
def
|
2
|
+
def change
|
3
3
|
create_table :carrier_types do |t|
|
4
4
|
t.string :name, :null => false
|
5
5
|
t.text :display_name
|
@@ -8,8 +8,4 @@ class CreateCarrierTypes < ActiveRecord::Migration
|
|
8
8
|
t.timestamps
|
9
9
|
end
|
10
10
|
end
|
11
|
-
|
12
|
-
def self.down
|
13
|
-
drop_table :carrier_types
|
14
|
-
end
|
15
11
|
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,5 +1,5 @@
|
|
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
|
@@ -11,15 +11,10 @@ class CreateLibraryGroups < ActiveRecord::Migration
|
|
11
11
|
t.text :login_banner
|
12
12
|
t.text :note
|
13
13
|
t.integer :valid_period_for_new_user, :default => 365, :null => false
|
14
|
-
t.boolean :post_to_union_catalog, :default => false, :null => false
|
15
14
|
t.integer :country_id
|
16
15
|
|
17
16
|
t.timestamps
|
18
17
|
end
|
19
18
|
add_index :library_groups, :short_name
|
20
19
|
end
|
21
|
-
|
22
|
-
def self.down
|
23
|
-
drop_table :library_groups
|
24
|
-
end
|
25
20
|
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
|