enju_message 0.3.4 → 0.4.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -3
  3. data/Rakefile +1 -1
  4. data/app/controllers/message_requests_controller.rb +2 -2
  5. data/app/models/message.rb +2 -2
  6. data/app/models/message_request.rb +3 -2
  7. data/app/models/message_request_transition.rb +2 -2
  8. data/app/models/message_template.rb +2 -2
  9. data/app/models/message_transition.rb +2 -2
  10. data/app/views/message_requests/edit.html.erb +3 -3
  11. data/app/views/message_requests/index.html.erb +2 -2
  12. data/app/views/message_requests/new.html.erb +1 -1
  13. data/app/views/message_requests/show.html.erb +2 -2
  14. data/db/migrate/149_create_message_templates.rb +8 -3
  15. data/db/migrate/154_create_messages.rb +8 -4
  16. data/db/migrate/20080819181903_create_message_requests.rb +7 -2
  17. data/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +7 -2
  18. data/db/migrate/20120125050502_add_depth_to_message.rb +2 -1
  19. data/db/migrate/20140518111006_create_message_transitions.rb +8 -3
  20. data/db/migrate/20140518135713_create_message_request_transitions.rb +8 -3
  21. data/db/migrate/20160703185015_add_most_recent_to_message_transitions.rb +1 -1
  22. data/db/migrate/20160814165332_add_most_recent_to_message_request_transitions.rb +1 -1
  23. data/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +1 -1
  24. data/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +1 -1
  25. data/lib/enju_message/version.rb +1 -1
  26. data/spec/controllers/messages_controller_spec.rb +1 -2
  27. data/spec/dummy/config/database.yml +70 -9
  28. data/spec/dummy/db/development.sqlite3 +0 -0
  29. data/spec/dummy/db/migrate/005_create_manifestations.rb +3 -3
  30. data/spec/dummy/db/migrate/113_create_events.rb +21 -0
  31. data/spec/dummy/db/migrate/114_create_event_categories.rb +16 -0
  32. data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +23 -0
  33. data/spec/dummy/db/migrate/20090519203307_create_participates.rb +15 -0
  34. data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +15 -0
  35. data/spec/dummy/db/migrate/20120413051535_add_event_import_fingerprint_to_event_import_file.rb +5 -0
  36. data/spec/dummy/db/migrate/20120413170734_add_error_message_to_event_import_file.rb +5 -0
  37. data/spec/dummy/db/migrate/20120415060342_rename_event_import_file_imported_at_to_executed_at.rb +9 -0
  38. data/spec/dummy/db/migrate/20140523171309_create_event_import_file_transitions.rb +18 -0
  39. data/spec/dummy/db/migrate/20140628071719_add_user_encoding_to_event_import_file.rb +5 -0
  40. data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +5 -0
  41. data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +11 -0
  42. data/spec/dummy/db/migrate/20140812153137_create_event_export_file_transitions.rb +18 -0
  43. data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +5 -0
  44. data/spec/dummy/db/migrate/20151128142913_create_places.rb +14 -0
  45. data/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb +5 -0
  46. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +8 -0
  47. data/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
  48. data/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
  49. data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +1 -1
  50. data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +1 -1
  51. data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +1 -1
  52. data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +1 -1
  53. data/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb +13 -0
  54. data/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb +13 -0
  55. data/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb +5 -0
  56. data/spec/dummy/db/migrate/20190102034126_create_doi_records.rb +13 -0
  57. data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
  58. data/spec/dummy/db/migrate/{20181026064038_add_login_banner_to_library_group.rb → 20190630115523_add_login_banner_translations_to_library_group.rb} +1 -1
  59. data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
  60. data/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
  61. data/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
  62. data/spec/dummy/db/schema.rb +265 -133
  63. data/spec/dummy/db/test.sqlite3 +0 -0
  64. data/spec/fixtures/agents.yml +29 -30
  65. data/spec/fixtures/libraries.yml +28 -30
  66. data/spec/fixtures/library_groups.yml +36 -19
  67. data/spec/fixtures/message_request_transitions.yml +2 -2
  68. data/spec/fixtures/message_requests.yml +3 -2
  69. data/spec/fixtures/message_templates.yml +2 -2
  70. data/spec/fixtures/messages.yml +3 -3
  71. data/spec/fixtures/roles.yml +22 -5
  72. data/spec/fixtures/shelves.yml +45 -0
  73. data/spec/fixtures/user_groups.yml +23 -5
  74. data/spec/fixtures/users.yml +1 -1
  75. data/spec/models/message_request_spec.rb +13 -3
  76. data/spec/models/message_spec.rb +2 -2
  77. data/spec/models/message_template_spec.rb +2 -2
  78. data/spec/rails_helper.rb +5 -1
  79. metadata +276 -302
  80. data/spec/dummy/app/jobs/application_job.rb +0 -7
  81. data/spec/dummy/db/migrate/20150421023923_create_identities.rb +0 -14
  82. data/spec/dummy/db/migrate/20151126005552_add_provider_to_identity.rb +0 -5
  83. data/spec/dummy/db/migrate/20170114174536_add_profile_id_to_user.rb +0 -5
  84. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
  85. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
  86. data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4a01dcf1557c145aac90d759843b4a851a7df97ce2a3b114e25db6ef1024121
4
- data.tar.gz: 7414f1af426dd3614528d1b13137484baf82f3bc5b6b313366791b1a407f487d
3
+ metadata.gz: 3ce77a0b8f518342c225310c76d21ecfaef0f6e379e2b971ed97b02af0db33ea
4
+ data.tar.gz: dccdb1c462eb0f61733dfd8ad4487b3de116c8dbfe58fbbd4d700ee94d4ed518
5
5
  SHA512:
6
- metadata.gz: 136bd3d4ad842a1e1077163b74fa09d818d231eab0a1c74672f60b8c6b2b7ef641f19328500ceac21a25fc1a77b69581be2f7956ff53fb33290418da9f3e9420
7
- data.tar.gz: '018a510d87fe5218f0354e7486428ddc2c8c259cae83444bc0feb992550b2106621b3a8aef64721c6fac68fef9a68191d89ac4dc18f601132dec42728a464778'
6
+ metadata.gz: 0f389876e3248f3f0d57cf28a552bd31b9ff1c75b5d751cecbe86980db231a001f8a8539e91fa04730b7d522ec63776f8ede31ce969a3f085b0668f9df6072c3
7
+ data.tar.gz: 8e5ac3159cd008be25965f5d862a72a158a8ee65e4b4d50e4c3124039d5d9a27125ef335715497eb515310f7c7f998d591177e8af1b5a4faeea2c26f4a6415cb
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # EnjuMessage
2
- [![Travis CI](https://travis-ci.com/next-l/enju_message.svg?branch=1.3)](https://travis-ci.com/next-l/enju_message)
3
- [![Coverage Status](https://coveralls.io/repos/github/next-l/enju_message/badge.svg?branch=1.3)](https://coveralls.io/github/next-l/enju_message?branch=1.3)
4
- [![security](https://hakiri.io/github/next-l/enju_message/1.3.svg)](https://hakiri.io/github/next-l/enju_message/1.3)
2
+ [![CircleCI](https://circleci.com/gh/next-l/enju_message/tree/2.x.svg?style=svg)](https://circleci.com/gh/next-l/enju_message/tree/2.x)
3
+ [![Coverage Status](https://coveralls.io/repos/github/next-l/enju_message/badge.svg?branch=2.x)](https://coveralls.io/github/next-l/enju_message?branch=2.x)
5
4
 
6
5
  This project rocks and uses MIT-LICENSE.
7
6
 
data/Rakefile CHANGED
@@ -16,7 +16,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
16
16
  rdoc.rdoc_dir = 'rdoc'
17
17
  rdoc.title = 'EnjuMessage'
18
18
  rdoc.options << '--line-numbers'
19
- rdoc.rdoc_files.include('README.rdoc')
19
+ rdoc.rdoc_files.include('README.md')
20
20
  rdoc.rdoc_files.include('lib/**/*.rb')
21
21
  end
22
22
 
@@ -31,7 +31,7 @@ class MessageRequestsController < ApplicationController
31
31
 
32
32
  # GET /message_requests/1/edit
33
33
  def edit
34
- @message_templates = MessageTemplate.order(:position)
34
+ @message_requests = MessageTemplate.order(:position)
35
35
  end
36
36
 
37
37
  # PUT /message_requests/1
@@ -43,7 +43,7 @@ class MessageRequestsController < ApplicationController
43
43
  format.html { redirect_to(@message_request) }
44
44
  format.json { head :no_content }
45
45
  else
46
- @message_templates = MessageTemplate.order(:position)
46
+ @message_requests = MessageTemplate.order(:position)
47
47
  format.html { render action: "edit" }
48
48
  format.json { render json: @message_request.errors, status: :unprocessable_entity }
49
49
  end
@@ -86,8 +86,8 @@ end
86
86
  # body :text
87
87
  # message_request_id :integer
88
88
  # parent_id :integer
89
- # created_at :datetime not null
90
- # updated_at :datetime not null
89
+ # created_at :datetime
90
+ # updated_at :datetime
91
91
  # lft :integer
92
92
  # rgt :integer
93
93
  # depth :integer
@@ -83,7 +83,8 @@ end
83
83
  # receiver_id :integer
84
84
  # message_template_id :integer
85
85
  # sent_at :datetime
86
+ # deleted_at :datetime
86
87
  # body :text
87
- # created_at :datetime not null
88
- # updated_at :datetime not null
88
+ # created_at :datetime
89
+ # updated_at :datetime
89
90
  #
@@ -14,7 +14,7 @@ end
14
14
  # metadata :text default({})
15
15
  # sort_key :integer
16
16
  # message_request_id :integer
17
- # created_at :datetime not null
18
- # updated_at :datetime not null
17
+ # created_at :datetime
18
+ # updated_at :datetime
19
19
  # most_recent :boolean not null
20
20
  #
@@ -31,6 +31,6 @@ end
31
31
  # body :text not null
32
32
  # position :integer
33
33
  # locale :string default("en")
34
- # created_at :datetime not null
35
- # updated_at :datetime not null
34
+ # created_at :datetime
35
+ # updated_at :datetime
36
36
  #
@@ -14,7 +14,7 @@ end
14
14
  # metadata :text default({})
15
15
  # sort_key :integer
16
16
  # message_id :integer
17
- # created_at :datetime not null
18
- # updated_at :datetime not null
17
+ # created_at :datetime
18
+ # updated_at :datetime
19
19
  # most_recent :boolean not null
20
20
  #
@@ -7,11 +7,11 @@
7
7
 
8
8
  <div class="field">
9
9
  <%= f.label t('message.sender') -%><br />
10
- <%= link_to @message_request.sender.username, @message_request.sender.profile -%>
10
+ <%= link_to @message_request.sender.username, @message_request.sender -%>
11
11
  </div>
12
12
  <div class="field">
13
13
  <%= f.label t('message.receiver') -%><br />
14
- <%= link_to @message_request.receiver.username, @message_request.receiver.profile -%>
14
+ <%= link_to @message_request.receiver.username, @message_request.receiver -%>
15
15
  </div>
16
16
  <div class="field">
17
17
  <%= f.label t('activerecord.models.message_template') -%><br />
@@ -23,7 +23,7 @@
23
23
  </div>
24
24
  <div class="field">
25
25
  <%= f.label t('activerecord.attributes.message.body') -%><br />
26
- <%= @message_request.body -%>
26
+ <%= textilize(@message_request.body) -%>
27
27
  </div>
28
28
  <div class="actions">
29
29
  <%= f.submit %>
@@ -20,10 +20,10 @@
20
20
  <%- @message_requests.each do |message_request| -%>
21
21
  <tr class="line<%= cycle("0", "1") -%>">
22
22
  <td>
23
- <%= link_to message_request.sender.username, message_request.sender.profile -%>
23
+ <%= link_to message_request.sender.username, message_request.sender -%>
24
24
  <br />
25
25
  -&gt;
26
- <%= link_to message_request.receiver.username, message_request.receiver.profile -%>
26
+ <%= link_to message_request.receiver.username, message_request.receiver -%>
27
27
  </td>
28
28
  <td><%= link_to message_request.message_template.status, message_template_path(message_request.message_template) -%></td>
29
29
  <td><%= message_request.subject -%></td>
@@ -24,7 +24,7 @@
24
24
  </div>
25
25
  <div class="field">
26
26
  <%= f.label t('activerecord.attributes.message.body') -%><br />
27
- <%= @message_request.body -%>
27
+ <%= textilize(@message_request.body) -%>
28
28
  </div>
29
29
  <div class="actions">
30
30
  <%= f.submit %>
@@ -5,12 +5,12 @@
5
5
 
6
6
  <p>
7
7
  <strong><%= t('message.sender') -%>:</strong>
8
- <%= link_to @message_request.sender.username, @message_request.sender.profile -%>
8
+ <%= link_to @message_request.sender.username, @message_request.sender -%>
9
9
  </p>
10
10
 
11
11
  <p>
12
12
  <strong><%= t('message.receiver') -%>:</strong>
13
- <%= link_to @message_request.receiver.username, @message_request.receiver.profile -%>
13
+ <%= link_to @message_request.receiver.username, @message_request.receiver -%>
14
14
  </p>
15
15
 
16
16
  <p>
@@ -1,7 +1,7 @@
1
- class CreateMessageTemplates < ActiveRecord::Migration[5.2]
2
- def change
1
+ class CreateMessageTemplates < ActiveRecord::Migration[4.2]
2
+ def self.up
3
3
  create_table :message_templates do |t|
4
- t.string :status, null: false, index: {unique: true}
4
+ t.string :status, null: false
5
5
  t.text :title, null: false
6
6
  t.text :body, null: false
7
7
  t.integer :position
@@ -9,5 +9,10 @@ class CreateMessageTemplates < ActiveRecord::Migration[5.2]
9
9
 
10
10
  t.timestamps
11
11
  end
12
+ add_index :message_templates, :status, unique: true
13
+ end
14
+
15
+ def self.down
16
+ drop_table :message_templates
12
17
  end
13
18
  end
@@ -1,15 +1,19 @@
1
- class CreateMessages < ActiveRecord::Migration[5.2]
2
- def change
3
- create_table :messages do |t|
1
+ class CreateMessages < ActiveRecord::Migration[4.2]
2
+ def self.up
3
+ create_table :messages, force: true do |t|
4
4
  t.datetime :read_at
5
5
  t.references :sender, index: true
6
6
  t.references :receiver, index: true
7
7
  t.string :subject, null: false
8
8
  t.text :body
9
9
  t.references :message_request, index: true
10
- t.references :parent, foreign_key: {to_table: :messages}
10
+ t.references :parent, index: true
11
11
 
12
12
  t.timestamps
13
13
  end
14
14
  end
15
+
16
+ def self.down
17
+ drop_table :messages
18
+ end
15
19
  end
@@ -1,13 +1,18 @@
1
- class CreateMessageRequests < ActiveRecord::Migration[5.2]
2
- def change
1
+ class CreateMessageRequests < ActiveRecord::Migration[4.2]
2
+ def self.up
3
3
  create_table :message_requests do |t|
4
4
  t.references :sender
5
5
  t.references :receiver
6
6
  t.references :message_template
7
7
  t.datetime :sent_at
8
+ t.datetime :deleted_at
8
9
  t.text :body
9
10
 
10
11
  t.timestamps
11
12
  end
12
13
  end
14
+
15
+ def self.down
16
+ drop_table :message_requests
17
+ end
13
18
  end
@@ -1,6 +1,11 @@
1
- class AddLftAndRgtToMessage < ActiveRecord::Migration[5.2]
2
- def change
1
+ class AddLftAndRgtToMessage < ActiveRecord::Migration[4.2]
2
+ def self.up
3
3
  add_column :messages, :lft, :integer
4
4
  add_column :messages, :rgt, :integer
5
5
  end
6
+
7
+ def self.down
8
+ remove_column :messages, :rgt
9
+ remove_column :messages, :lft
10
+ end
6
11
  end
@@ -1,5 +1,6 @@
1
- class AddDepthToMessage < ActiveRecord::Migration[5.2]
1
+ class AddDepthToMessage < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :messages, :depth, :integer
4
+
4
5
  end
5
6
  end
@@ -1,13 +1,18 @@
1
- class CreateMessageTransitions < ActiveRecord::Migration[5.2]
1
+ class CreateMessageTransitions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :message_transitions do |t|
4
4
  t.string :to_state
5
- t.text :metadata, default: '{}'
5
+ if ActiveRecord::Base.configurations[Rails.env]["adapter"].try(:match, /mysql/)
6
+ t.text :metadata
7
+ else
8
+ t.text :metadata, default: "{}"
9
+ end
6
10
  t.integer :sort_key
7
- t.references :message
11
+ t.integer :message_id
8
12
  t.timestamps
9
13
  end
10
14
 
15
+ add_index :message_transitions, :message_id
11
16
  add_index :message_transitions, [:sort_key, :message_id], unique: true
12
17
  end
13
18
  end
@@ -1,13 +1,18 @@
1
- class CreateMessageRequestTransitions < ActiveRecord::Migration[5.2]
1
+ class CreateMessageRequestTransitions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :message_request_transitions do |t|
4
4
  t.string :to_state
5
- t.text :metadata, default: '{}'
5
+ if ActiveRecord::Base.configurations[Rails.env]["adapter"].try(:match, /mysql/)
6
+ t.text :metadata
7
+ else
8
+ t.text :metadata, default: "{}"
9
+ end
6
10
  t.integer :sort_key
7
- t.references :message_request
11
+ t.integer :message_request_id
8
12
  t.timestamps
9
13
  end
10
14
 
15
+ add_index :message_request_transitions, :message_request_id
11
16
  add_index :message_request_transitions, [:sort_key, :message_request_id], unique: true, name: "index_message_request_transitions_on_sort_key_and_request_id"
12
17
  end
13
18
  end
@@ -1,4 +1,4 @@
1
- class AddMostRecentToMessageTransitions < ActiveRecord::Migration[5.2]
1
+ class AddMostRecentToMessageTransitions < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_column :message_transitions, :most_recent, :boolean, null: true
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddMostRecentToMessageRequestTransitions < ActiveRecord::Migration[5.2]
1
+ class AddMostRecentToMessageRequestTransitions < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_column :message_request_transitions, :most_recent, :boolean, null: true
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForMessageTransitions < ActiveRecord::Migration[5.2]
1
+ class AddConstraintsToMostRecentForMessageTransitions < ActiveRecord::Migration[4.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForMessageRequestTransitions < ActiveRecord::Migration[5.2]
1
+ class AddConstraintsToMostRecentForMessageRequestTransitions < ActiveRecord::Migration[4.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -1,3 +1,3 @@
1
1
  module EnjuMessage
2
- VERSION = "0.3.4".freeze
2
+ VERSION = "0.4.0.beta.1"
3
3
  end
@@ -264,14 +264,13 @@ describe MessagesController do
264
264
  response.should be_successful
265
265
  end
266
266
  end
267
-
268
267
  describe 'with invalid recipient' do
269
268
  it "re-renders the 'new' template" do
270
269
  post :create, params: { message: @invalid_user_attrs }
271
270
  message = assigns(:message)
272
271
  message.should_not be_valid
273
272
  message.errors.should have_key :receiver
274
- message.errors.added?(:receiver, :blank).should be_truthy
273
+ message.errors[:receiver].empty?.should be_falsy
275
274
  response.should render_template('new')
276
275
  end
277
276
 
@@ -1,25 +1,86 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
1
+ # PostgreSQL. Versions 9.1 and up are supported.
3
2
  #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
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: sqlite3
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
- timeout: 5000
23
+ username: postgres
11
24
 
12
25
  development:
13
26
  <<: *default
14
- database: db/development.sqlite3
27
+ database: enju_message_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_message_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: db/test.sqlite3
61
+ database: enju_message_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: db/production.sqlite3
84
+ database: enju_message_dummy_production
85
+ username: enju_message_dummy
86
+ password: <%= ENV['DUMMY_DATABASE_PASSWORD'] %>
File without changes
@@ -32,10 +32,10 @@ class CreateManifestations < ActiveRecord::Migration[4.2]
32
32
  t.integer :frequency_id, default: 1, null: false
33
33
  t.boolean :subscription_master, default: false, null: false
34
34
  end
35
- #add_index :manifestations, :carrier_type_id
36
- #add_index :manifestations, :required_role_id
35
+ # add_index :manifestations, :carrier_type_id
36
+ # add_index :manifestations, :required_role_id
37
37
  add_index :manifestations, :access_address
38
- #add_index :manifestations, :frequency_id
38
+ # add_index :manifestations, :frequency_id
39
39
  add_index :manifestations, :manifestation_identifier
40
40
  add_index :manifestations, :updated_at
41
41
  add_index :manifestations, :date_of_publication
@@ -0,0 +1,21 @@
1
+ class CreateEvents < ActiveRecord::Migration[4.2]
2
+ def self.up
3
+ create_table :events do |t|
4
+ t.references :library, index: true, null: false
5
+ t.references :event_category, index: true, null: false
6
+ t.string :name
7
+ t.text :note
8
+ t.datetime :start_at
9
+ t.datetime :end_at
10
+ t.boolean :all_day, default: false, null: false
11
+ t.datetime :deleted_at
12
+ t.text :display_name
13
+
14
+ t.timestamps
15
+ end
16
+ end
17
+
18
+ def self.down
19
+ drop_table :events
20
+ end
21
+ end
@@ -0,0 +1,16 @@
1
+ class CreateEventCategories < ActiveRecord::Migration[4.2]
2
+ def self.up
3
+ create_table :event_categories 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 :event_categories
15
+ end
16
+ end
@@ -0,0 +1,23 @@
1
+ class CreateEventImportFiles < ActiveRecord::Migration[4.2]
2
+ def self.up
3
+ create_table :event_import_files do |t|
4
+ t.references :parent, index: true
5
+ t.string :content_type
6
+ t.integer :size
7
+ t.references :user, index: true
8
+ t.text :note
9
+ t.datetime :imported_at
10
+ t.string :event_import_file_name
11
+ t.string :event_import_content_type
12
+ t.integer :event_import_file_size
13
+ t.datetime :event_import_updated_at
14
+ t.string :edit_mode
15
+
16
+ t.timestamps
17
+ end
18
+ end
19
+
20
+ def self.down
21
+ drop_table :event_import_files
22
+ end
23
+ end
@@ -0,0 +1,15 @@
1
+ class CreateParticipates < ActiveRecord::Migration[4.2]
2
+ def self.up
3
+ create_table :participates do |t|
4
+ t.references :agent, index: true, null: false
5
+ t.references :event, index: true, null: false
6
+ t.integer :position
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ drop_table :participates
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ class CreateEventImportResults < ActiveRecord::Migration[4.2]
2
+ def self.up
3
+ create_table :event_import_results do |t|
4
+ t.references :event_import_file
5
+ t.references :event
6
+ t.text :body
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ drop_table :event_import_results
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ class AddEventImportFingerprintToEventImportFile < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :event_import_files, :event_import_fingerprint, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddErrorMessageToEventImportFile < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :event_import_files, :error_message, :text
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class RenameEventImportFileImportedAtToExecutedAt < ActiveRecord::Migration[4.2]
2
+ def up
3
+ rename_column :event_import_files, :imported_at, :executed_at
4
+ end
5
+
6
+ def down
7
+ rename_column :event_import_files, :executed_at, :impored_at
8
+ end
9
+ end
@@ -0,0 +1,18 @@
1
+ class CreateEventImportFileTransitions < ActiveRecord::Migration[4.2]
2
+ def change
3
+ create_table :event_import_file_transitions do |t|
4
+ t.string :to_state
5
+ if ActiveRecord::Base.configurations[Rails.env]["adapter"].try(:match, /mysql/)
6
+ t.text :metadata
7
+ else
8
+ t.text :metadata, default: "{}"
9
+ end
10
+ t.integer :sort_key
11
+ t.integer :event_import_file_id
12
+ t.timestamps
13
+ end
14
+
15
+ add_index :event_import_file_transitions, :event_import_file_id
16
+ add_index :event_import_file_transitions, [:sort_key, :event_import_file_id], unique: true, name: "index_event_import_file_transitions_on_sort_key_and_file_id"
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ class AddUserEncodingToEventImportFile < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :event_import_files, :user_encoding, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddDefaultLibraryIdToEventImportFile < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_reference :event_import_files, :default_library
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ class CreateEventExportFiles < ActiveRecord::Migration[4.2]
2
+ def change
3
+ create_table :event_export_files do |t|
4
+ t.references :user, index: true
5
+ t.attachment :event_export
6
+ t.datetime :executed_at
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end