enju_circulation 0.3.9 → 0.4.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -3
- data/app/controllers/checkins_controller.rb +2 -2
- data/app/controllers/user_group_has_checkout_types_controller.rb +1 -1
- data/app/helpers/items_helper.rb +3 -3
- data/app/models/checked_item.rb +7 -17
- data/app/models/checkin.rb +3 -2
- data/app/models/checkout.rb +2 -2
- data/app/models/checkout_stat_has_user.rb +1 -1
- data/app/models/checkout_type.rb +9 -7
- data/app/models/circulation_status.rb +9 -8
- data/app/models/concerns/enju_circulation/enju_item.rb +2 -46
- data/app/models/concerns/enju_circulation/enju_user_group.rb +0 -1
- data/app/models/concerns/enju_circulation/enju_withdraw.rb +1 -7
- data/app/models/manifestation_checkout_stat_transition.rb +1 -1
- data/app/models/manifestation_reserve_stat_transition.rb +1 -1
- data/app/models/reserve.rb +5 -5
- data/app/models/reserve_state_machine.rb +3 -2
- data/app/models/reserve_transition.rb +1 -1
- data/app/models/retain.rb +15 -0
- data/app/models/user_checkout_stat_transition.rb +1 -1
- data/app/models/user_group_has_checkout_type.rb +15 -37
- data/app/models/user_reserve_stat_transition.rb +1 -1
- data/app/views/carrier_type_has_checkout_types/_form.html.erb +2 -2
- data/app/views/carrier_type_has_checkout_types/index.html.erb +2 -2
- data/app/views/carrier_type_has_checkout_types/show.html.erb +2 -2
- data/app/views/carrier_types/_carrier_type_has_checkout_type_fields.html.erb +1 -1
- data/app/views/checked_items/new.html.erb +1 -1
- data/app/views/checkins/_checkin.html.erb +1 -1
- data/app/views/checkout_types/_form.html.erb +1 -1
- data/app/views/checkout_types/index.html.erb +1 -1
- data/app/views/checkout_types/show.html.erb +2 -2
- data/app/views/checkouts/_index_user.html.erb +1 -1
- data/app/views/checkouts/_list.html.erb +2 -9
- data/app/views/checkouts/index.atom.builder +1 -1
- data/app/views/checkouts/index.ics.erb +1 -1
- data/app/views/checkouts/index.rss.builder +1 -1
- data/app/views/circulation_statuses/_form.html.erb +1 -1
- data/app/views/circulation_statuses/index.html.erb +1 -1
- data/app/views/circulation_statuses/show.html.erb +1 -1
- data/app/views/item_has_use_restrictions/index.html.erb +1 -1
- data/app/views/item_has_use_restrictions/show.html.erb +1 -1
- data/app/views/manifestation_checkout_stats/_group_by_carrier_type.html.erb +3 -3
- data/app/views/manifestation_checkout_stats/_group_by_checkout_type.html.erb +3 -3
- data/app/views/manifestations/_circulation_status.html.erb +3 -3
- data/app/views/profiles/_submenu_checkout.html.erb +1 -1
- data/app/views/reserves/_new.html.erb +1 -1
- data/app/views/reserves/_new_user.html.erb +1 -1
- data/app/views/reserves/edit.html.erb +1 -1
- data/app/views/reserves/index.atom.builder +1 -1
- data/app/views/reserves/index.html.erb +1 -1
- data/app/views/reserves/index.rss.builder +1 -1
- data/app/views/reserves/show.html.erb +1 -1
- data/app/views/use_restrictions/_form.html.erb +1 -1
- data/app/views/use_restrictions/index.html.erb +1 -1
- data/app/views/use_restrictions/show.html.erb +1 -1
- data/app/views/user_group_has_checkout_types/edit.html.erb +4 -4
- data/app/views/user_group_has_checkout_types/index.html.erb +2 -2
- data/app/views/user_group_has_checkout_types/new.html.erb +4 -4
- data/app/views/user_group_has_checkout_types/show.html.erb +4 -4
- data/app/views/user_groups/_user_group_has_checkout_type_fields.html.erb +2 -2
- data/config/locales/translation_en.yml +1 -14
- data/config/locales/translation_ja.yml +1 -14
- data/config/routes.rb +1 -2
- data/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +3 -3
- data/db/migrate/20190508160525_create_retains.rb +10 -0
- data/db/migrate/20190629134017_rename_user_group_has_checkout_type_due_date_before_to_due_date_after.rb +5 -0
- data/db/migrate/20190706052525_add_display_name_translations_to_circulation_status.rb +5 -0
- data/db/migrate/20190713114724_add_checkout_id_to_checkin.rb +5 -0
- data/db/migrate/20190814120827_add_display_name_translations_to_checkout_type.rb +5 -0
- data/lib/enju_circulation/version.rb +1 -1
- data/lib/generators/enju_circulation/setup/templates/db/fixtures/checkout_types.yml +3 -5
- data/lib/generators/enju_circulation/setup/templates/db/fixtures/circulation_statuses.yml +16 -48
- data/lib/tasks/enju_circulation_tasks.rake +7 -1
- data/spec/concerns/enju_accept_spec.rb +14 -14
- data/spec/controllers/accepts_controller_spec.rb +294 -0
- data/spec/controllers/baskets_controller_spec.rb +379 -0
- data/spec/controllers/checkins_controller_spec.rb +8 -130
- data/spec/controllers/items_controller_spec.rb +23 -43
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/user.rb +1 -1
- data/spec/dummy/bin/bundle +1 -1
- data/spec/dummy/bin/setup +1 -3
- data/spec/dummy/bin/update +4 -2
- data/spec/dummy/bin/yarn +3 -3
- data/spec/dummy/config/database.yml +70 -9
- data/spec/dummy/config/initializers/assets.rb +1 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/113_create_events.rb +2 -4
- data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +2 -4
- data/spec/dummy/db/migrate/20090519203307_create_participates.rb +2 -4
- data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +2 -2
- data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +1 -1
- data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20151128142913_create_places.rb +14 -0
- data/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb +5 -0
- data/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb +5 -0
- data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
- data/spec/dummy/db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb +6 -0
- data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
- data/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
- data/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
- data/spec/dummy/db/migrate/20190713114940_add_profile_id_to_user.rb +5 -0
- data/spec/dummy/db/migrate/20190713115451_add_full_name_translations_to_profile.rb +5 -0
- data/spec/dummy/db/schema.rb +221 -184
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/private/system/carrier_types/attachments/000/000/001/original/book.png +0 -0
- data/spec/dummy/private/system/carrier_types/attachments/000/000/001/thumb/book.png +0 -0
- data/spec/factories/accept.rb +1 -1
- data/spec/factories/item.rb +4 -4
- data/spec/factories/reserve.rb +1 -5
- data/spec/fixtures/carrier_types.yml +16 -15
- data/spec/fixtures/checkins.yml +2 -1
- data/spec/fixtures/checkout_stat_has_users.yml +1 -1
- data/spec/fixtures/checkout_types.yml +11 -10
- data/spec/fixtures/checkouts.yml +2 -2
- data/spec/fixtures/circulation_statuses.yml +26 -34
- data/spec/fixtures/content_types.yml +20 -31
- data/spec/fixtures/event_categories.yml +23 -23
- data/spec/fixtures/frequencies.yml +17 -25
- data/spec/fixtures/items.yml +1 -1
- data/spec/fixtures/libraries.yml +30 -31
- data/spec/fixtures/library_groups.yml +43 -20
- data/spec/fixtures/request_status_types.yml +14 -14
- data/spec/fixtures/request_types.yml +13 -13
- data/spec/fixtures/reserve_transitions.yml +1 -1
- data/spec/fixtures/reserves.yml +3 -3
- data/spec/fixtures/roles.yml +22 -5
- data/spec/fixtures/shelves.yml +16 -15
- data/spec/fixtures/user_group_has_checkout_types.yml +24 -24
- data/spec/fixtures/user_groups.yml +23 -3
- data/spec/helpers/items_helper_spec.rb +1 -1
- data/spec/models/checkin_spec.rb +2 -1
- data/spec/models/checkout_spec.rb +2 -2
- data/spec/models/checkout_stat_has_user_spec.rb +1 -1
- data/spec/models/checkout_type_spec.rb +8 -7
- data/spec/models/circulation_status_spec.rb +8 -7
- data/spec/models/item_spec.rb +6 -8
- data/spec/models/manifestation_spec.rb +15 -18
- data/spec/models/reserve_spec.rb +3 -3
- data/spec/models/resource_export_file_spec.rb +0 -15
- data/spec/models/retain_spec.rb +16 -0
- data/spec/models/user_group_has_checkout_type_spec.rb +15 -32
- data/spec/models/withdraw_spec.rb +4 -6
- data/spec/policies/manifestation_policy_spec.rb +2 -1
- data/spec/rails_helper.rb +10 -3
- data/spec/views/items/index.html.erb_spec.rb +1 -4
- metadata +396 -446
- data/app/controllers/lending_policies_controller.rb +0 -106
- data/app/models/lending_policy.rb +0 -30
- data/app/views/lending_policies/_form.html.erb +0 -41
- data/app/views/lending_policies/edit.html.erb +0 -13
- data/app/views/lending_policies/index.html.erb +0 -42
- data/app/views/lending_policies/new.html.erb +0 -12
- data/app/views/lending_policies/show.html.erb +0 -50
- data/db/migrate/20090831220301_create_lending_policies.rb +0 -21
- data/spec/controllers/lending_policies_controller_spec.rb +0 -444
- data/spec/controllers/withdraws_controller_spec.rb +0 -26
- data/spec/dummy/config/locales/en.yml +0 -208
- data/spec/dummy/config/locales/ja.yml +0 -200
- data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
- data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
- data/spec/dummy/db/migrate/20200425072340_create_manifestation_custom_properties.rb +0 -12
- data/spec/dummy/db/migrate/20200425072349_create_item_custom_properties.rb +0 -12
- data/spec/dummy/db/migrate/20200425074758_create_manifestation_custom_values.rb +0 -12
- data/spec/dummy/db/migrate/20200425074822_create_item_custom_values.rb +0 -12
- data/spec/fixtures/accepts.yml +0 -9
- data/spec/fixtures/bookstores.yml +0 -99
- data/spec/fixtures/budget_types.yml +0 -30
- data/spec/fixtures/exemplifies.yml +0 -168
- data/spec/fixtures/lending_policies.yml +0 -98
- data/spec/models/lending_policy_spec.rb +0 -23
- data/spec/system/items_spec.rb +0 -21
- data/spec/system/user_group_has_checkout_types.rb +0 -14
data/spec/dummy/bin/setup
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require 'pathname'
|
3
2
|
require 'fileutils'
|
4
3
|
include FileUtils
|
5
4
|
|
6
5
|
# path to your application root.
|
7
|
-
APP_ROOT =
|
6
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
8
7
|
|
9
8
|
def system!(*args)
|
10
9
|
system(*args) || abort("\n== Command #{args} failed ==")
|
@@ -21,7 +20,6 @@ chdir APP_ROOT do
|
|
21
20
|
# Install JavaScript dependencies if using Yarn
|
22
21
|
# system('bin/yarn')
|
23
22
|
|
24
|
-
|
25
23
|
# puts "\n== Copying sample files =="
|
26
24
|
# unless File.exist?('config/database.yml')
|
27
25
|
# cp 'config/database.yml.sample', 'config/database.yml'
|
data/spec/dummy/bin/update
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require 'pathname'
|
3
2
|
require 'fileutils'
|
4
3
|
include FileUtils
|
5
4
|
|
6
5
|
# path to your application root.
|
7
|
-
APP_ROOT =
|
6
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
8
7
|
|
9
8
|
def system!(*args)
|
10
9
|
system(*args) || abort("\n== Command #{args} failed ==")
|
@@ -18,6 +17,9 @@ chdir APP_ROOT do
|
|
18
17
|
system! 'gem install bundler --conservative'
|
19
18
|
system('bundle check') || system!('bundle install')
|
20
19
|
|
20
|
+
# Install JavaScript dependencies if using Yarn
|
21
|
+
# system('bin/yarn')
|
22
|
+
|
21
23
|
puts "\n== Updating database =="
|
22
24
|
system! 'bin/rails db:migrate'
|
23
25
|
|
data/spec/dummy/bin/yarn
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
Dir.chdir(
|
2
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
3
|
+
Dir.chdir(APP_ROOT) do
|
4
4
|
begin
|
5
|
-
exec "yarnpkg
|
5
|
+
exec "yarnpkg", *ARGV
|
6
6
|
rescue Errno::ENOENT
|
7
7
|
$stderr.puts "Yarn executable was not detected in the system."
|
8
8
|
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
@@ -1,25 +1,86 @@
|
|
1
|
-
#
|
2
|
-
# gem install sqlite3
|
1
|
+
# PostgreSQL. Versions 9.1 and up are supported.
|
3
2
|
#
|
4
|
-
#
|
5
|
-
# gem
|
3
|
+
# Install the pg driver:
|
4
|
+
# gem install pg
|
5
|
+
# On OS X with Homebrew:
|
6
|
+
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
|
7
|
+
# On OS X with MacPorts:
|
8
|
+
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
|
9
|
+
# On Windows:
|
10
|
+
# gem install pg
|
11
|
+
# Choose the win32 build.
|
12
|
+
# Install PostgreSQL and put its /bin directory on your path.
|
13
|
+
#
|
14
|
+
# Configure Using Gemfile
|
15
|
+
# gem 'pg'
|
6
16
|
#
|
7
17
|
default: &default
|
8
|
-
adapter:
|
18
|
+
adapter: postgresql
|
19
|
+
encoding: unicode
|
20
|
+
# For details on connection pooling, see Rails configuration guide
|
21
|
+
# http://guides.rubyonrails.org/configuring.html#database-pooling
|
9
22
|
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
10
|
-
|
23
|
+
username: postgres
|
11
24
|
|
12
25
|
development:
|
13
26
|
<<: *default
|
14
|
-
database:
|
27
|
+
database: enju_circulation_dummy_development
|
28
|
+
|
29
|
+
# The specified database role being used to connect to postgres.
|
30
|
+
# To create additional roles in postgres see `$ createuser --help`.
|
31
|
+
# When left blank, postgres will use the default role. This is
|
32
|
+
# the same name as the operating system user that initialized the database.
|
33
|
+
#username: enju_circulation_dummy
|
34
|
+
|
35
|
+
# The password associated with the postgres role (username).
|
36
|
+
#password:
|
37
|
+
|
38
|
+
# Connect on a TCP socket. Omitted by default since the client uses a
|
39
|
+
# domain socket that doesn't need configuration. Windows does not have
|
40
|
+
# domain sockets, so uncomment these lines.
|
41
|
+
#host: localhost
|
42
|
+
|
43
|
+
# The TCP port the server listens on. Defaults to 5432.
|
44
|
+
# If your server runs on a different port number, change accordingly.
|
45
|
+
#port: 5432
|
46
|
+
|
47
|
+
# Schema search path. The server defaults to $user,public
|
48
|
+
#schema_search_path: myapp,sharedapp,public
|
49
|
+
|
50
|
+
# Minimum log levels, in increasing order:
|
51
|
+
# debug5, debug4, debug3, debug2, debug1,
|
52
|
+
# log, notice, warning, error, fatal, and panic
|
53
|
+
# Defaults to warning.
|
54
|
+
#min_messages: notice
|
15
55
|
|
16
56
|
# Warning: The database defined as "test" will be erased and
|
17
57
|
# re-generated from your development database when you run "rake".
|
18
58
|
# Do not set this db to the same as development or production.
|
19
59
|
test:
|
20
60
|
<<: *default
|
21
|
-
database:
|
61
|
+
database: enju_circulation_dummy_test
|
22
62
|
|
63
|
+
# As with config/secrets.yml, you never want to store sensitive information,
|
64
|
+
# like your database password, in your source code. If your source code is
|
65
|
+
# ever seen by anyone, they now have access to your database.
|
66
|
+
#
|
67
|
+
# Instead, provide the password as a unix environment variable when you boot
|
68
|
+
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
|
69
|
+
# for a full rundown on how to provide these environment variables in a
|
70
|
+
# production deployment.
|
71
|
+
#
|
72
|
+
# On Heroku and other platform providers, you may have a full connection URL
|
73
|
+
# available as an environment variable. For example:
|
74
|
+
#
|
75
|
+
# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
|
76
|
+
#
|
77
|
+
# You can use this database configuration with:
|
78
|
+
#
|
79
|
+
# production:
|
80
|
+
# url: <%= ENV['DATABASE_URL'] %>
|
81
|
+
#
|
23
82
|
production:
|
24
83
|
<<: *default
|
25
|
-
database:
|
84
|
+
database: enju_circulation_dummy_production
|
85
|
+
username: enju_circulation_dummy
|
86
|
+
password: <%= ENV['DUMMY_DATABASE_PASSWORD'] %>
|
@@ -5,6 +5,7 @@ Rails.application.config.assets.version = '1.0'
|
|
5
5
|
|
6
6
|
# Add additional assets to the asset load path
|
7
7
|
# Rails.application.config.assets.paths << Emoji.images_path
|
8
|
+
Rails.application.config.assets.paths << Rails.root.join('../../', 'node_modules')
|
8
9
|
|
9
10
|
# Precompile additional assets.
|
10
11
|
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
File without changes
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateEvents < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :events do |t|
|
4
|
-
t.
|
5
|
-
t.
|
4
|
+
t.references :library, index: true, null: false
|
5
|
+
t.references :event_category, index: true, null: false
|
6
6
|
t.string :name
|
7
7
|
t.text :note
|
8
8
|
t.datetime :start_at
|
@@ -13,8 +13,6 @@ class CreateEvents < ActiveRecord::Migration[4.2]
|
|
13
13
|
|
14
14
|
t.timestamps
|
15
15
|
end
|
16
|
-
add_index :events, :library_id
|
17
|
-
add_index :events, :event_category_id
|
18
16
|
end
|
19
17
|
|
20
18
|
def self.down
|
@@ -1,10 +1,10 @@
|
|
1
1
|
class CreateEventImportFiles < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :event_import_files do |t|
|
4
|
-
t.
|
4
|
+
t.references :parent, index: true
|
5
5
|
t.string :content_type
|
6
6
|
t.integer :size
|
7
|
-
t.
|
7
|
+
t.references :user, index: true
|
8
8
|
t.text :note
|
9
9
|
t.datetime :imported_at
|
10
10
|
t.string :event_import_file_name
|
@@ -15,8 +15,6 @@ class CreateEventImportFiles < ActiveRecord::Migration[4.2]
|
|
15
15
|
|
16
16
|
t.timestamps
|
17
17
|
end
|
18
|
-
add_index :event_import_files, :parent_id
|
19
|
-
add_index :event_import_files, :user_id
|
20
18
|
end
|
21
19
|
|
22
20
|
def self.down
|
@@ -1,14 +1,12 @@
|
|
1
1
|
class CreateParticipates < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :participates do |t|
|
4
|
-
t.
|
5
|
-
t.
|
4
|
+
t.references :agent, index: true, null: false
|
5
|
+
t.references :event, index: true, null: false
|
6
6
|
t.integer :position
|
7
7
|
|
8
8
|
t.timestamps
|
9
9
|
end
|
10
|
-
add_index :participates, :event_id
|
11
|
-
add_index :participates, :agent_id
|
12
10
|
end
|
13
11
|
|
14
12
|
def self.down
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateEventImportResults < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :event_import_results do |t|
|
4
|
-
t.
|
5
|
-
t.
|
4
|
+
t.references :event_import_file
|
5
|
+
t.references :event
|
6
6
|
t.text :body
|
7
7
|
|
8
8
|
t.timestamps
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreatePlaces < ActiveRecord::Migration[4.2]
|
2
|
+
def change
|
3
|
+
create_table :places do |t|
|
4
|
+
t.string :term
|
5
|
+
t.text :city
|
6
|
+
t.references :country, index: true
|
7
|
+
t.float :latitude
|
8
|
+
t.float :longitude
|
9
|
+
|
10
|
+
t.timestamps null: false
|
11
|
+
end
|
12
|
+
add_index :places, :term
|
13
|
+
end
|
14
|
+
end
|
@@ -2,7 +2,7 @@ class AddConstraintsToMostRecentForUserImportFileTransitions < ActiveRecord::Mig
|
|
2
2
|
disable_ddl_transaction!
|
3
3
|
|
4
4
|
def up
|
5
|
-
add_index :user_import_file_transitions, [:user_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_user_import_file_transitions_parent_most_recent"
|
5
|
+
add_index :user_import_file_transitions, [:user_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_user_import_file_transitions_parent_most_recent" #, algorithm: :concurrently
|
6
6
|
change_column_null :user_import_file_transitions, :most_recent, false
|
7
7
|
end
|
8
8
|
|
@@ -2,7 +2,7 @@ class AddConstraintsToMostRecentForUserExportFileTransitions < ActiveRecord::Mig
|
|
2
2
|
disable_ddl_transaction!
|
3
3
|
|
4
4
|
def up
|
5
|
-
add_index :user_export_file_transitions, [:user_export_file_id, :most_recent], unique: true, where: "most_recent", name: "index_user_export_file_transitions_parent_most_recent"
|
5
|
+
add_index :user_export_file_transitions, [:user_export_file_id, :most_recent], unique: true, where: "most_recent", name: "index_user_export_file_transitions_parent_most_recent" #, algorithm: :concurrently
|
6
6
|
change_column_null :user_export_file_transitions, :most_recent, false
|
7
7
|
end
|
8
8
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddConstraintsToMostRecentForEventImportFileTransitions < ActiveRecord::Migration[4.2]
|
2
|
+
disable_ddl_transaction!
|
3
|
+
|
4
|
+
def up
|
5
|
+
add_index :event_import_file_transitions, [:event_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_event_import_file_transitions_parent_most_recent" #, algorithm: :concurrently
|
6
|
+
change_column_null :event_import_file_transitions, :most_recent, false
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_index :event_import_file_transitions, name: "index_event_import_file_transitions_parent_most_recent"
|
11
|
+
change_column_null :event_import_file_transitions, :most_recent, true
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddConstraintsToMostRecentForEventExportFileTransitions < ActiveRecord::Migration[4.2]
|
2
|
+
disable_ddl_transaction!
|
3
|
+
|
4
|
+
def up
|
5
|
+
add_index :event_export_file_transitions, [:event_export_file_id, :most_recent], unique: true, where: "most_recent", name: "index_event_export_file_transitions_parent_most_recent" #, algorithm: :concurrently
|
6
|
+
change_column_null :event_export_file_transitions, :most_recent, false
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_index :event_export_file_transitions, name: "index_event_export_file_transitions_parent_most_recent"
|
11
|
+
change_column_null :event_export_file_transitions, :most_recent, true
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class AddDisplayNameTranslationsToLibraryGroup < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
add_column :budget_types, :display_name_translations, :jsonb, default: {}, null: false
|
4
|
+
add_column :libraries, :display_name_translations, :jsonb, default: {}, null: false
|
5
|
+
add_column :library_groups, :display_name_translations, :jsonb, default: {}, null: false
|
6
|
+
add_column :request_status_types, :display_name_translations, :jsonb, default: {}, null: false
|
7
|
+
add_column :request_types, :display_name_translations, :jsonb, default: {}, null: false
|
8
|
+
add_column :search_engines, :display_name_translations, :jsonb, default: {}, null: false
|
9
|
+
add_column :shelves, :display_name_translations, :jsonb, default: {}, null: false
|
10
|
+
add_column :user_groups, :display_name_translations, :jsonb, default: {}, null: false
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
class AddLoginBannerTranslationsToLibraryGroup < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
add_column :library_groups, :login_banner_translations, :jsonb, default: {}, null: false
|
4
|
+
add_column :library_groups, :footer_banner_translations, :jsonb, default: {}, null: false
|
5
|
+
end
|
6
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
class AddDisplayNameTranslationsToEvent < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
add_column :event_categories, :display_name_translations, :jsonb, default: {}, null: false
|
4
|
+
add_column :events, :display_name_translations, :jsonb, default: {}, null: false
|
5
|
+
end
|
6
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class AddDisplayNameTranslationsToCarrierType < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
[
|
4
|
+
:agent_relationship_types,
|
5
|
+
:agent_types,
|
6
|
+
:carrier_types,
|
7
|
+
:content_types,
|
8
|
+
:create_types,
|
9
|
+
:form_of_works,
|
10
|
+
:frequencies,
|
11
|
+
:languages,
|
12
|
+
:licenses,
|
13
|
+
:manifestation_relationship_types,
|
14
|
+
:medium_of_performances,
|
15
|
+
:produce_types,
|
16
|
+
:realize_types
|
17
|
+
].each do |table|
|
18
|
+
add_column table, :display_name_translations, :jsonb, default: {}, null: false
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|