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.
- checksums.yaml +4 -4
- data/README.md +2 -3
- data/Rakefile +1 -1
- data/app/controllers/message_requests_controller.rb +2 -2
- data/app/models/message.rb +2 -2
- data/app/models/message_request.rb +3 -2
- data/app/models/message_request_transition.rb +2 -2
- data/app/models/message_template.rb +2 -2
- data/app/models/message_transition.rb +2 -2
- data/app/views/message_requests/edit.html.erb +3 -3
- data/app/views/message_requests/index.html.erb +2 -2
- data/app/views/message_requests/new.html.erb +1 -1
- data/app/views/message_requests/show.html.erb +2 -2
- data/db/migrate/149_create_message_templates.rb +8 -3
- data/db/migrate/154_create_messages.rb +8 -4
- data/db/migrate/20080819181903_create_message_requests.rb +7 -2
- data/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +7 -2
- data/db/migrate/20120125050502_add_depth_to_message.rb +2 -1
- data/db/migrate/20140518111006_create_message_transitions.rb +8 -3
- data/db/migrate/20140518135713_create_message_request_transitions.rb +8 -3
- data/db/migrate/20160703185015_add_most_recent_to_message_transitions.rb +1 -1
- data/db/migrate/20160814165332_add_most_recent_to_message_request_transitions.rb +1 -1
- data/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +1 -1
- data/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +1 -1
- data/lib/enju_message/version.rb +1 -1
- data/spec/controllers/messages_controller_spec.rb +1 -2
- data/spec/dummy/config/database.yml +70 -9
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/005_create_manifestations.rb +3 -3
- data/spec/dummy/db/migrate/113_create_events.rb +21 -0
- data/spec/dummy/db/migrate/114_create_event_categories.rb +16 -0
- data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +23 -0
- data/spec/dummy/db/migrate/20090519203307_create_participates.rb +15 -0
- data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +15 -0
- data/spec/dummy/db/migrate/20120413051535_add_event_import_fingerprint_to_event_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413170734_add_error_message_to_event_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120415060342_rename_event_import_file_imported_at_to_executed_at.rb +9 -0
- data/spec/dummy/db/migrate/20140523171309_create_event_import_file_transitions.rb +18 -0
- data/spec/dummy/db/migrate/20140628071719_add_user_encoding_to_event_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +11 -0
- data/spec/dummy/db/migrate/20140812153137_create_event_export_file_transitions.rb +18 -0
- data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +5 -0
- 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/20151213070943_add_translation_table_to_library_group.rb +8 -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/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_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/20190102034126_create_doi_records.rb +13 -0
- data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
- data/spec/dummy/db/migrate/{20181026064038_add_login_banner_to_library_group.rb → 20190630115523_add_login_banner_translations_to_library_group.rb} +1 -1
- 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/schema.rb +265 -133
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/fixtures/agents.yml +29 -30
- data/spec/fixtures/libraries.yml +28 -30
- data/spec/fixtures/library_groups.yml +36 -19
- data/spec/fixtures/message_request_transitions.yml +2 -2
- data/spec/fixtures/message_requests.yml +3 -2
- data/spec/fixtures/message_templates.yml +2 -2
- data/spec/fixtures/messages.yml +3 -3
- data/spec/fixtures/roles.yml +22 -5
- data/spec/fixtures/shelves.yml +45 -0
- data/spec/fixtures/user_groups.yml +23 -5
- data/spec/fixtures/users.yml +1 -1
- data/spec/models/message_request_spec.rb +13 -3
- data/spec/models/message_spec.rb +2 -2
- data/spec/models/message_template_spec.rb +2 -2
- data/spec/rails_helper.rb +5 -1
- metadata +276 -302
- data/spec/dummy/app/jobs/application_job.rb +0 -7
- data/spec/dummy/db/migrate/20150421023923_create_identities.rb +0 -14
- data/spec/dummy/db/migrate/20151126005552_add_provider_to_identity.rb +0 -5
- data/spec/dummy/db/migrate/20170114174536_add_profile_id_to_user.rb +0 -5
- 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/20191219122214_create_custom_properties.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ce77a0b8f518342c225310c76d21ecfaef0f6e379e2b971ed97b02af0db33ea
|
4
|
+
data.tar.gz: dccdb1c462eb0f61733dfd8ad4487b3de116c8dbfe58fbbd4d700ee94d4ed518
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f389876e3248f3f0d57cf28a552bd31b9ff1c75b5d751cecbe86980db231a001f8a8539e91fa04730b7d522ec63776f8ede31ce969a3f085b0668f9df6072c3
|
7
|
+
data.tar.gz: 8e5ac3159cd008be25965f5d862a72a158a8ee65e4b4d50e4c3124039d5d9a27125ef335715497eb515310f7c7f998d591177e8af1b5a4faeea2c26f4a6415cb
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# EnjuMessage
|
2
|
-
[![
|
3
|
-
[![Coverage Status](https://coveralls.io/repos/github/next-l/enju_message/badge.svg?branch=
|
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
@@ -31,7 +31,7 @@ class MessageRequestsController < ApplicationController
|
|
31
31
|
|
32
32
|
# GET /message_requests/1/edit
|
33
33
|
def edit
|
34
|
-
@
|
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
|
-
@
|
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
|
data/app/models/message.rb
CHANGED
@@ -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
|
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
|
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
|
23
|
+
<%= link_to message_request.sender.username, message_request.sender -%>
|
24
24
|
<br />
|
25
25
|
->
|
26
|
-
<%= link_to message_request.receiver.username, message_request.receiver
|
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>
|
@@ -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
|
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
|
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[
|
2
|
-
def
|
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
|
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[
|
2
|
-
def
|
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,
|
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[
|
2
|
-
def
|
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[
|
2
|
-
def
|
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,13 +1,18 @@
|
|
1
|
-
class CreateMessageTransitions < ActiveRecord::Migration[
|
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
|
-
|
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.
|
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[
|
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
|
-
|
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.
|
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
|
data/lib/enju_message/version.rb
CHANGED
@@ -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
|
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
|
-
#
|
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_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:
|
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:
|
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,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
|