archiving 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +0 -3
- data/test/dummy/db/migrate/20140220134827_create_posts.rb +8 -1
- data/test/dummy/db/migrate/20140220140852_posts_archive.rb +8 -1
- data/test/dummy/db/migrate/20140220140952_posts_tag.rb +8 -1
- data/test/dummy/db/migrate/20140317201702_create_logs.rb +8 -1
- data/test/dummy/db/migrate/20140414124125_create_postable_on_log_day.rb +8 -1
- data/test/dummy/db/migrate/20161103093656_create_log_other.rb +8 -1
- data/test/dummy/db/migrate/20161103100644_create_log_other_archive.rb +16 -4
- data/test/dummy/db/migrate/20190711112558_create_postrws.rb +8 -1
- data/test/migrations_test.rb +8 -1
- metadata +47 -50
- data/test/dummy/log/test.log +0 -475
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fafb98fb93f47de9e5a199ffc1d37ea8dfc30ec8d4c39058e6fe80b03052f221
|
4
|
+
data.tar.gz: 25eb040c41551374aebc23a08aab63981ff298ba541717e97249629d59befb4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e22a51dbb93e4142359eca6902492c49349a8073f125591ba0f8bba406d1c1872c70646c6843b378ccfcd232d1e5525ab37af65d0a47b7f6a234f34ef9ec5801
|
7
|
+
data.tar.gz: 9abd0f49fa20bf84809fa9a28fb743ee97d6725f4cce1072fe1d3cd1a68decc01dc20c4274d16f1832e50c232af69c50a336eb7afcb9920de5d878b192aacac0
|
data/Rakefile
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
|
1
|
+
migration_class =
|
2
|
+
if ActiveRecord::VERSION::MAJOR >= 5
|
3
|
+
ActiveRecord::Migration[4.2]
|
4
|
+
else
|
5
|
+
ActiveRecord::Migration
|
6
|
+
end
|
7
|
+
|
8
|
+
class CreatePosts < migration_class
|
2
9
|
def change
|
3
10
|
create_table :posts do |t|
|
4
11
|
t.string :title
|
@@ -1,4 +1,11 @@
|
|
1
|
-
|
1
|
+
migration_class =
|
2
|
+
if ActiveRecord::VERSION::MAJOR >= 5
|
3
|
+
ActiveRecord::Migration[4.2]
|
4
|
+
else
|
5
|
+
ActiveRecord::Migration
|
6
|
+
end
|
7
|
+
|
8
|
+
class PostsArchive < migration_class
|
2
9
|
def change
|
3
10
|
create_table :posts_archive do |t|
|
4
11
|
t.string :title
|
@@ -1,4 +1,11 @@
|
|
1
|
-
|
1
|
+
migration_class =
|
2
|
+
if ActiveRecord::VERSION::MAJOR >= 5
|
3
|
+
ActiveRecord::Migration[4.2]
|
4
|
+
else
|
5
|
+
ActiveRecord::Migration
|
6
|
+
end
|
7
|
+
|
8
|
+
class PostsTag < migration_class
|
2
9
|
def change
|
3
10
|
add_column :posts, :tag, :string
|
4
11
|
add_column :posts_archive, :tag, :string
|
@@ -1,4 +1,11 @@
|
|
1
|
-
|
1
|
+
migration_class =
|
2
|
+
if ActiveRecord::VERSION::MAJOR >= 5
|
3
|
+
ActiveRecord::Migration[4.2]
|
4
|
+
else
|
5
|
+
ActiveRecord::Migration
|
6
|
+
end
|
7
|
+
|
8
|
+
class CreateLogs < migration_class
|
2
9
|
def change
|
3
10
|
create_table :log_days do |t|
|
4
11
|
t.references :post
|
@@ -1,4 +1,11 @@
|
|
1
|
-
|
1
|
+
migration_class =
|
2
|
+
if ActiveRecord::VERSION::MAJOR >= 5
|
3
|
+
ActiveRecord::Migration[4.2]
|
4
|
+
else
|
5
|
+
ActiveRecord::Migration
|
6
|
+
end
|
7
|
+
|
8
|
+
class CreatePostableOnLogDay < migration_class
|
2
9
|
def change
|
3
10
|
%w(log_days log_days_archive).each do |table|
|
4
11
|
add_column table, :postable_type, :string
|
@@ -1,4 +1,11 @@
|
|
1
|
-
|
1
|
+
migration_class =
|
2
|
+
if ActiveRecord::VERSION::MAJOR >= 5
|
3
|
+
ActiveRecord::Migration[4.2]
|
4
|
+
else
|
5
|
+
ActiveRecord::Migration
|
6
|
+
end
|
7
|
+
|
8
|
+
class CreateLogOther < migration_class
|
2
9
|
def change
|
3
10
|
create_table :log_others do |t|
|
4
11
|
t.references :post
|
@@ -1,4 +1,17 @@
|
|
1
|
-
class
|
1
|
+
class OtherConnection < ActiveRecord::Base
|
2
|
+
self.abstract_class = true
|
3
|
+
|
4
|
+
establish_connection :"other_#{Rails.env}"
|
5
|
+
end
|
6
|
+
|
7
|
+
migration_class =
|
8
|
+
if ActiveRecord::VERSION::MAJOR >= 5
|
9
|
+
ActiveRecord::Migration[4.2]
|
10
|
+
else
|
11
|
+
ActiveRecord::Migration
|
12
|
+
end
|
13
|
+
|
14
|
+
class CreateLogOtherArchive < migration_class
|
2
15
|
def up
|
3
16
|
set_connection do
|
4
17
|
create_table :log_others_archive do |t|
|
@@ -16,11 +29,10 @@ class CreateLogOtherArchive < ActiveRecord::Migration
|
|
16
29
|
|
17
30
|
def set_connection
|
18
31
|
connection_was = @connection
|
19
|
-
@connection =
|
32
|
+
@connection = OtherConnection.connection
|
20
33
|
yield
|
21
34
|
ensure
|
22
35
|
@connection = connection_was
|
23
|
-
|
24
|
-
ActiveRecord::Base.establish_connection
|
36
|
+
OtherConnection.remove_connection
|
25
37
|
end
|
26
38
|
end
|
@@ -1,4 +1,11 @@
|
|
1
|
-
|
1
|
+
migration_class =
|
2
|
+
if ActiveRecord::VERSION::MAJOR >= 5
|
3
|
+
ActiveRecord::Migration[4.2]
|
4
|
+
else
|
5
|
+
ActiveRecord::Migration
|
6
|
+
end
|
7
|
+
|
8
|
+
class CreatePostrws < migration_class
|
2
9
|
def change
|
3
10
|
create_table :postrws do |t|
|
4
11
|
t.string :title
|
data/test/migrations_test.rb
CHANGED
@@ -4,7 +4,14 @@ class Comment < ActiveRecord::Base
|
|
4
4
|
has_archive_table
|
5
5
|
end
|
6
6
|
|
7
|
-
|
7
|
+
migration_class =
|
8
|
+
if ActiveRecord::VERSION::MAJOR >= 5
|
9
|
+
ActiveRecord::Migration[4.2]
|
10
|
+
else
|
11
|
+
ActiveRecord::Migration
|
12
|
+
end
|
13
|
+
|
14
|
+
class CreateComments < migration_class
|
8
15
|
def up
|
9
16
|
create_table :comments do |t|
|
10
17
|
t.string :author
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: archiving
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harry Vangberg
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-10-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
version: '4.2'
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '
|
23
|
+
version: '7.0'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
version: '4.2'
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '7.0'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: mysql2
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '4.2'
|
55
55
|
- - "<"
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: '
|
57
|
+
version: '7.0'
|
58
58
|
type: :development
|
59
59
|
prerelease: false
|
60
60
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -64,7 +64,7 @@ dependencies:
|
|
64
64
|
version: '4.2'
|
65
65
|
- - "<"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
67
|
+
version: '7.0'
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
69
|
name: jquery-rails
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,7 +178,6 @@ files:
|
|
178
178
|
- test/dummy/db/migrate/20161103100644_create_log_other_archive.rb
|
179
179
|
- test/dummy/db/migrate/20190711112558_create_postrws.rb
|
180
180
|
- test/dummy/db/schema.rb
|
181
|
-
- test/dummy/log/test.log
|
182
181
|
- test/dummy/public/404.html
|
183
182
|
- test/dummy/public/422.html
|
184
183
|
- test/dummy/public/500.html
|
@@ -205,61 +204,59 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
204
|
- !ruby/object:Gem::Version
|
206
205
|
version: '0'
|
207
206
|
requirements: []
|
208
|
-
|
209
|
-
rubygems_version: 2.5.2
|
207
|
+
rubygems_version: 3.0.3
|
210
208
|
signing_key:
|
211
209
|
specification_version: 4
|
212
210
|
summary: MySQL Archive Tables
|
213
211
|
test_files:
|
214
212
|
- test/archiving_test.rb
|
215
|
-
- test/
|
216
|
-
- test/
|
217
|
-
- test/dummy/
|
218
|
-
- test/dummy/
|
219
|
-
- test/dummy/
|
220
|
-
- test/dummy/
|
221
|
-
- test/dummy/
|
222
|
-
- test/dummy/
|
223
|
-
- test/dummy/
|
224
|
-
- test/dummy/
|
225
|
-
- test/dummy/
|
226
|
-
- test/dummy/
|
227
|
-
- test/dummy/
|
213
|
+
- test/dummy/app/models/postrw.rb
|
214
|
+
- test/dummy/app/models/log_other.rb
|
215
|
+
- test/dummy/app/models/log_day.rb
|
216
|
+
- test/dummy/app/models/log_line.rb
|
217
|
+
- test/dummy/app/models/post.rb
|
218
|
+
- test/dummy/app/controllers/application_controller.rb
|
219
|
+
- test/dummy/app/views/layouts/application.html.erb
|
220
|
+
- test/dummy/app/assets/javascripts/application.js
|
221
|
+
- test/dummy/app/assets/stylesheets/application.css
|
222
|
+
- test/dummy/app/helpers/application_helper.rb
|
223
|
+
- test/dummy/test/unit/post_test.rb
|
224
|
+
- test/dummy/bin/rake
|
225
|
+
- test/dummy/bin/bundle
|
226
|
+
- test/dummy/bin/rails
|
227
|
+
- test/dummy/config/routes.rb
|
228
|
+
- test/dummy/config/locales/en.yml
|
228
229
|
- test/dummy/config/environments/production.rb
|
230
|
+
- test/dummy/config/environments/development.rb
|
229
231
|
- test/dummy/config/environments/test.rb
|
230
|
-
- test/dummy/config/routes.rb
|
231
232
|
- test/dummy/config/environment.rb
|
232
|
-
- test/dummy/config/
|
233
|
+
- test/dummy/config/application.rb
|
234
|
+
- test/dummy/config/database.yml
|
235
|
+
- test/dummy/config/boot.rb
|
236
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
237
|
+
- test/dummy/config/initializers/mime_types.rb
|
238
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
239
|
+
- test/dummy/config/initializers/session_store.rb
|
240
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
241
|
+
- test/dummy/config/initializers/secret_token.rb
|
242
|
+
- test/dummy/config/initializers/inflections.rb
|
243
|
+
- test/dummy/config.ru
|
233
244
|
- test/dummy/script/rails
|
245
|
+
- test/dummy/Rakefile
|
246
|
+
- test/dummy/public/favicon.ico
|
247
|
+
- test/dummy/public/422.html
|
248
|
+
- test/dummy/public/500.html
|
249
|
+
- test/dummy/public/404.html
|
250
|
+
- test/dummy/db/schema.rb
|
251
|
+
- test/dummy/db/migrate/20140414124125_create_postable_on_log_day.rb
|
234
252
|
- test/dummy/db/migrate/20190711112558_create_postrws.rb
|
235
|
-
- test/dummy/db/migrate/20140220140952_posts_tag.rb
|
236
253
|
- test/dummy/db/migrate/20140220134827_create_posts.rb
|
237
|
-
- test/dummy/db/migrate/20161103100644_create_log_other_archive.rb
|
238
|
-
- test/dummy/db/migrate/20140220140852_posts_archive.rb
|
239
|
-
- test/dummy/db/migrate/20140414124125_create_postable_on_log_day.rb
|
240
254
|
- test/dummy/db/migrate/20161103093656_create_log_other.rb
|
241
255
|
- test/dummy/db/migrate/20140317201702_create_logs.rb
|
242
|
-
- test/dummy/db/
|
243
|
-
- test/dummy/
|
256
|
+
- test/dummy/db/migrate/20161103100644_create_log_other_archive.rb
|
257
|
+
- test/dummy/db/migrate/20140220140952_posts_tag.rb
|
258
|
+
- test/dummy/db/migrate/20140220140852_posts_archive.rb
|
244
259
|
- test/dummy/README.rdoc
|
245
|
-
- test/dummy/test/unit/post_test.rb
|
246
|
-
- test/dummy/app/models/log_line.rb
|
247
|
-
- test/dummy/app/models/log_other.rb
|
248
|
-
- test/dummy/app/models/post.rb
|
249
|
-
- test/dummy/app/models/postrw.rb
|
250
|
-
- test/dummy/app/models/log_day.rb
|
251
|
-
- test/dummy/app/controllers/application_controller.rb
|
252
|
-
- test/dummy/app/assets/stylesheets/application.css
|
253
|
-
- test/dummy/app/assets/javascripts/application.js
|
254
|
-
- test/dummy/app/helpers/application_helper.rb
|
255
|
-
- test/dummy/app/views/layouts/application.html.erb
|
256
|
-
- test/dummy/public/500.html
|
257
|
-
- test/dummy/public/404.html
|
258
|
-
- test/dummy/public/favicon.ico
|
259
|
-
- test/dummy/public/422.html
|
260
|
-
- test/dummy/log/test.log
|
261
|
-
- test/dummy/bin/rake
|
262
|
-
- test/dummy/bin/rails
|
263
|
-
- test/dummy/bin/bundle
|
264
|
-
- test/dummy/config.ru
|
265
260
|
- test/migrations_test.rb
|
261
|
+
- test/archive_table_test.rb
|
262
|
+
- test/test_helper.rb
|
data/test/dummy/log/test.log
DELETED
@@ -1,475 +0,0 @@
|
|
1
|
-
[1m[35m (0.2ms)[0m [1m[35mSET @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483[0m
|
2
|
-
[1m[35m (0.2ms)[0m [1m[34mSELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC[0m
|
3
|
-
[1m[35m (0.2ms)[0m [1m[35mSET @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483[0m
|
4
|
-
[1m[35m (0.4ms)[0m [1m[34mSELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC[0m
|
5
|
-
[1m[35m (0.3ms)[0m [1m[34mSELECT `ar_internal_metadata`.`value` FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment'[0m
|
6
|
-
[1m[35m (0.2ms)[0m [1m[34mSELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC[0m
|
7
|
-
[1m[35m (0.7ms)[0m [1m[34mSELECT `ar_internal_metadata`.`value` FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment'[0m
|
8
|
-
[1m[35m (0.3ms)[0m [1m[34mSELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC[0m
|
9
|
-
[1m[35m (0.3ms)[0m [1m[34mSELECT `ar_internal_metadata`.`value` FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment'[0m
|
10
|
-
[1m[35m (0.4ms)[0m [1m[35mSET @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483[0m
|
11
|
-
[1m[35m (56.5ms)[0m [1m[35mDROP DATABASE IF EXISTS `archiving_test`[0m
|
12
|
-
[1m[35m (2.7ms)[0m [1m[35mCREATE DATABASE `archiving_test` DEFAULT CHARACTER SET `utf8`[0m
|
13
|
-
[1m[35m (0.2ms)[0m [1m[35mSET @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483[0m
|
14
|
-
[1m[35m (0.2ms)[0m [1m[35mSET @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483[0m
|
15
|
-
[1m[35m (1.5ms)[0m [1m[35mDROP TABLE IF EXISTS `log_days` CASCADE[0m
|
16
|
-
[1m[35m (44.8ms)[0m [1m[35mCREATE TABLE `log_days` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `post_id` int, `day` date, `postable_type` varchar(255), `postable_id` int) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci[0m
|
17
|
-
[1m[35m (1.8ms)[0m [1m[35mDROP TABLE IF EXISTS `log_days_archive` CASCADE[0m
|
18
|
-
[1m[35m (22.0ms)[0m [1m[35mCREATE TABLE `log_days_archive` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `post_id` int, `day` date, `postable_type` varchar(255), `postable_id` int) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci[0m
|
19
|
-
[1m[35m (1.2ms)[0m [1m[35mDROP TABLE IF EXISTS `log_lines` CASCADE[0m
|
20
|
-
[1m[35m (16.6ms)[0m [1m[35mCREATE TABLE `log_lines` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `log_day_id` int, `descr` varchar(255)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci[0m
|
21
|
-
[1m[35m (2.0ms)[0m [1m[35mDROP TABLE IF EXISTS `log_lines_archive` CASCADE[0m
|
22
|
-
[1m[35m (14.7ms)[0m [1m[35mCREATE TABLE `log_lines_archive` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `log_day_id` int, `descr` varchar(255)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci[0m
|
23
|
-
[1m[35m (1.4ms)[0m [1m[35mDROP TABLE IF EXISTS `log_others` CASCADE[0m
|
24
|
-
[1m[35m (11.8ms)[0m [1m[35mCREATE TABLE `log_others` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `post_id` int, `note` varchar(255)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci[0m
|
25
|
-
[1m[35m (1.4ms)[0m [1m[35mDROP TABLE IF EXISTS `log_others_archive` CASCADE[0m
|
26
|
-
[1m[35m (22.0ms)[0m [1m[35mCREATE TABLE `log_others_archive` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `post_id` int, `note` varchar(255)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci[0m
|
27
|
-
[1m[35m (1.7ms)[0m [1m[35mDROP TABLE IF EXISTS `postrws` CASCADE[0m
|
28
|
-
[1m[35m (20.9ms)[0m [1m[35mCREATE TABLE `postrws` (`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `title` varchar(255), `body` text, `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB DEFAULT CHARSET=utf8[0m
|
29
|
-
[1m[35m (4.3ms)[0m [1m[35mDROP TABLE IF EXISTS `postrws_archive` CASCADE[0m
|
30
|
-
[1m[35m (14.8ms)[0m [1m[35mCREATE TABLE `postrws_archive` (`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `title` varchar(255), `body` text, `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB DEFAULT CHARSET=utf8[0m
|
31
|
-
[1m[35m (1.0ms)[0m [1m[35mDROP TABLE IF EXISTS `posts` CASCADE[0m
|
32
|
-
[1m[35m (8.4ms)[0m [1m[35mCREATE TABLE `posts` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `title` varchar(255), `body` text, `created_at` datetime, `updated_at` datetime, `tag` varchar(255)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci[0m
|
33
|
-
[1m[35m (0.9ms)[0m [1m[35mDROP TABLE IF EXISTS `posts_archive` CASCADE[0m
|
34
|
-
[1m[35m (7.8ms)[0m [1m[35mCREATE TABLE `posts_archive` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `title` varchar(255), `body` text, `created_at` datetime, `updated_at` datetime, `tag` varchar(255)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci[0m
|
35
|
-
[1m[35m (7.8ms)[0m [1m[35mCREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL PRIMARY KEY)[0m
|
36
|
-
[1m[35m (0.4ms)[0m [1m[34mSELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC[0m
|
37
|
-
[1m[35m (1.8ms)[0m [1m[32mINSERT INTO `schema_migrations` (version) VALUES (20190711112558)[0m
|
38
|
-
[1m[35m (1.4ms)[0m [1m[32mINSERT INTO `schema_migrations` (version) VALUES
|
39
|
-
(20140220140952),
|
40
|
-
(20140220134827),
|
41
|
-
(20161103100644),
|
42
|
-
(20140220140852),
|
43
|
-
(20140414124125),
|
44
|
-
(20161103093656),
|
45
|
-
(20140317201702);
|
46
|
-
|
47
|
-
[0m
|
48
|
-
[1m[35m (6.8ms)[0m [1m[35mCREATE TABLE `ar_internal_metadata` (`key` varchar(255) NOT NULL PRIMARY KEY, `value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL)[0m
|
49
|
-
[1m[36mActiveRecord::InternalMetadata Load (0.4ms)[0m [1m[34mSELECT `ar_internal_metadata`.* FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment' LIMIT 1[0m
|
50
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
51
|
-
[1m[36mActiveRecord::InternalMetadata Create (0.2ms)[0m [1m[32mINSERT INTO `ar_internal_metadata` (`key`, `value`, `created_at`, `updated_at`) VALUES ('environment', 'test', '2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
52
|
-
[1m[35m (1.8ms)[0m [1m[35mCOMMIT[0m
|
53
|
-
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT `ar_internal_metadata`.* FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment' LIMIT 1[0m
|
54
|
-
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
55
|
-
[1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
|
56
|
-
[1m[35m (0.2ms)[0m [1m[35mSET @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483[0m
|
57
|
-
[1m[35m (0.2ms)[0m [1m[34mSELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC[0m
|
58
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
59
|
-
---------------------------------------------
|
60
|
-
ArchiveTableTest: test_archiving_associations
|
61
|
-
---------------------------------------------
|
62
|
-
[1m[36mPost Destroy (0.4ms)[0m [1m[31mDELETE FROM `posts`[0m
|
63
|
-
[1m[36mPost::Archive Destroy (0.2ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
64
|
-
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
65
|
-
[1m[36mPost Create (0.3ms)[0m [1m[32mINSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
66
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
67
|
-
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
68
|
-
[1m[36mLogDay Create (0.2ms)[0m [1m[32mINSERT INTO `log_days` (`post_id`, `day`) VALUES (1, '2019-05-27')[0m
|
69
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
70
|
-
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
71
|
-
[1m[36mLogLine Create (0.2ms)[0m [1m[32mINSERT INTO `log_lines` (`log_day_id`, `descr`) VALUES (1, 'hallo')[0m
|
72
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
73
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
74
|
-
[1m[36mLogLine Create (0.2ms)[0m [1m[32mINSERT INTO `log_lines` (`log_day_id`, `descr`) VALUES (1, 'hurra')[0m
|
75
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
76
|
-
[1m[35m (0.3ms)[0m [1m[34mSELECT COUNT(*) FROM `log_lines` WHERE `log_lines`.`log_day_id` = 1[0m
|
77
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
78
|
-
[1m[36mLogDay::Archive Create (0.2ms)[0m [1m[32mINSERT INTO `log_days_archive` (`id`, `post_id`, `day`) VALUES (1, 1, '2019-05-27')[0m
|
79
|
-
[1m[36mPost::Archive Create (0.3ms)[0m [1m[32mINSERT INTO `posts_archive` (`id`, `title`, `created_at`, `updated_at`, `tag`) VALUES (1, 'Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
80
|
-
[1m[36mPost Destroy (0.3ms)[0m [1m[31mDELETE FROM `posts` WHERE `posts`.`id` = 1[0m
|
81
|
-
[1m[36mLogLine Load (0.2ms)[0m [1m[34mSELECT `log_lines`.* FROM `log_lines` WHERE `log_lines`.`log_day_id` = 1[0m
|
82
|
-
[1m[36mLogLine::Archive Create (0.2ms)[0m [1m[32mINSERT INTO `log_lines_archive` (`id`, `log_day_id`, `descr`) VALUES (1, 1, 'hallo')[0m
|
83
|
-
[1m[36mLogLine Destroy (0.2ms)[0m [1m[31mDELETE FROM `log_lines` WHERE `log_lines`.`id` = 1[0m
|
84
|
-
[1m[36mLogLine::Archive Create (0.1ms)[0m [1m[32mINSERT INTO `log_lines_archive` (`id`, `log_day_id`, `descr`) VALUES (2, 1, 'hurra')[0m
|
85
|
-
[1m[36mLogLine Destroy (0.2ms)[0m [1m[31mDELETE FROM `log_lines` WHERE `log_lines`.`id` = 2[0m
|
86
|
-
[1m[36mLogDay Destroy (0.2ms)[0m [1m[31mDELETE FROM `log_days` WHERE `log_days`.`id` = 1[0m
|
87
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
88
|
-
[1m[36mLogDay Load (0.3ms)[0m [1m[34mSELECT `log_days`.* FROM `log_days` WHERE `log_days`.`id` = 1 LIMIT 1[0m
|
89
|
-
[1m[36mLogDay::Archive Load (0.2ms)[0m [1m[34mSELECT `log_days_archive`.* FROM `log_days_archive` WHERE `log_days_archive`.`id` = 1 LIMIT 1[0m
|
90
|
-
[1m[36mPost Load (0.5ms)[0m [1m[34mSELECT `posts`.* FROM `posts` WHERE `posts`.`id` = 1 LIMIT 1[0m
|
91
|
-
[1m[36mPost::Archive Load (0.2ms)[0m [1m[34mSELECT `posts_archive`.* FROM `posts_archive` WHERE `posts_archive`.`id` = 1 LIMIT 1[0m
|
92
|
-
[1m[36mLogLine Load (0.2ms)[0m [1m[34mSELECT `log_lines`.* FROM `log_lines` WHERE `log_lines`.`id` = 1 LIMIT 1[0m
|
93
|
-
[1m[36mLogLine::Archive Load (0.2ms)[0m [1m[34mSELECT `log_lines_archive`.* FROM `log_lines_archive` WHERE `log_lines_archive`.`id` = 1 LIMIT 1[0m
|
94
|
-
[1m[36mLogLine Load (0.1ms)[0m [1m[34mSELECT `log_lines`.* FROM `log_lines` WHERE `log_lines`.`id` = 2 LIMIT 1[0m
|
95
|
-
[1m[36mLogLine::Archive Load (0.1ms)[0m [1m[34mSELECT `log_lines_archive`.* FROM `log_lines_archive` WHERE `log_lines_archive`.`id` = 2 LIMIT 1[0m
|
96
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
97
|
-
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
98
|
-
--------------------------------------------------
|
99
|
-
ArchiveTableTest: test_shorthand_for_archive_model
|
100
|
-
--------------------------------------------------
|
101
|
-
[1m[36mPost Destroy (0.2ms)[0m [1m[31mDELETE FROM `posts`[0m
|
102
|
-
[1m[36mPost::Archive Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
103
|
-
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
104
|
-
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
105
|
-
---------------------------------------------------------
|
106
|
-
ArchiveTableTest: test_archiving_polymorphic_associations
|
107
|
-
---------------------------------------------------------
|
108
|
-
[1m[36mPost Destroy (0.2ms)[0m [1m[31mDELETE FROM `posts`[0m
|
109
|
-
[1m[36mPost::Archive Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
110
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
111
|
-
[1m[36mPost Create (0.2ms)[0m [1m[32mINSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
112
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
113
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
114
|
-
[1m[36mLogDay Create (0.2ms)[0m [1m[32mINSERT INTO `log_days` (`day`, `postable_type`, `postable_id`) VALUES ('2019-05-27', 'Post', 2)[0m
|
115
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
116
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
117
|
-
[1m[36mLogLine Create (0.1ms)[0m [1m[32mINSERT INTO `log_lines` (`log_day_id`, `descr`) VALUES (2, 'hallo')[0m
|
118
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
119
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
120
|
-
[1m[36mLogLine Create (0.1ms)[0m [1m[32mINSERT INTO `log_lines` (`log_day_id`, `descr`) VALUES (2, 'hurra')[0m
|
121
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
122
|
-
[1m[35m (0.2ms)[0m [1m[34mSELECT COUNT(*) FROM `log_lines` WHERE `log_lines`.`log_day_id` = 2[0m
|
123
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
124
|
-
[1m[36mLogDay::Archive Create (0.2ms)[0m [1m[32mINSERT INTO `log_days_archive` (`id`, `day`, `postable_type`, `postable_id`) VALUES (2, '2019-05-27', 'Post', 2)[0m
|
125
|
-
[1m[36mLogLine Load (0.8ms)[0m [1m[34mSELECT `log_lines`.* FROM `log_lines` WHERE `log_lines`.`log_day_id` = 2[0m
|
126
|
-
[1m[36mLogLine::Archive Create (0.2ms)[0m [1m[32mINSERT INTO `log_lines_archive` (`id`, `log_day_id`, `descr`) VALUES (3, 2, 'hallo')[0m
|
127
|
-
[1m[36mLogLine Destroy (0.2ms)[0m [1m[31mDELETE FROM `log_lines` WHERE `log_lines`.`id` = 3[0m
|
128
|
-
[1m[36mLogLine::Archive Create (0.3ms)[0m [1m[32mINSERT INTO `log_lines_archive` (`id`, `log_day_id`, `descr`) VALUES (4, 2, 'hurra')[0m
|
129
|
-
[1m[36mLogLine Destroy (0.6ms)[0m [1m[31mDELETE FROM `log_lines` WHERE `log_lines`.`id` = 4[0m
|
130
|
-
[1m[36mPost::Archive Create (0.3ms)[0m [1m[32mINSERT INTO `posts_archive` (`id`, `title`, `created_at`, `updated_at`, `tag`) VALUES (2, 'Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
131
|
-
[1m[36mPost Destroy (0.3ms)[0m [1m[31mDELETE FROM `posts` WHERE `posts`.`id` = 2[0m
|
132
|
-
[1m[36mLogDay Destroy (0.2ms)[0m [1m[31mDELETE FROM `log_days` WHERE `log_days`.`id` = 2[0m
|
133
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
134
|
-
[1m[36mLogDay Load (0.2ms)[0m [1m[34mSELECT `log_days`.* FROM `log_days` WHERE `log_days`.`id` = 2 LIMIT 1[0m
|
135
|
-
[1m[36mLogDay::Archive Load (0.3ms)[0m [1m[34mSELECT `log_days_archive`.* FROM `log_days_archive` WHERE `log_days_archive`.`id` = 2 LIMIT 1[0m
|
136
|
-
[1m[36mPost Load (0.2ms)[0m [1m[34mSELECT `posts`.* FROM `posts` WHERE `posts`.`id` = 2 LIMIT 1[0m
|
137
|
-
[1m[36mPost::Archive Load (0.2ms)[0m [1m[34mSELECT `posts_archive`.* FROM `posts_archive` WHERE `posts_archive`.`id` = 2 LIMIT 1[0m
|
138
|
-
[1m[36mLogLine Load (0.1ms)[0m [1m[34mSELECT `log_lines`.* FROM `log_lines` WHERE `log_lines`.`id` = 3 LIMIT 1[0m
|
139
|
-
[1m[36mLogLine::Archive Load (0.1ms)[0m [1m[34mSELECT `log_lines_archive`.* FROM `log_lines_archive` WHERE `log_lines_archive`.`id` = 3 LIMIT 1[0m
|
140
|
-
[1m[36mLogLine Load (0.1ms)[0m [1m[34mSELECT `log_lines`.* FROM `log_lines` WHERE `log_lines`.`id` = 4 LIMIT 1[0m
|
141
|
-
[1m[36mLogLine::Archive Load (0.2ms)[0m [1m[34mSELECT `log_lines_archive`.* FROM `log_lines_archive` WHERE `log_lines_archive`.`id` = 4 LIMIT 1[0m
|
142
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
143
|
-
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
144
|
-
------------------------------------------------
|
145
|
-
ArchiveTableTest: test_with_archive_takes_:limit
|
146
|
-
------------------------------------------------
|
147
|
-
[1m[36mPost Destroy (0.3ms)[0m [1m[31mDELETE FROM `posts`[0m
|
148
|
-
[1m[36mPost::Archive Destroy (0.2ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
149
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
150
|
-
[1m[36mPost Create (0.1ms)[0m [1m[32mINSERT INTO `posts` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
151
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
152
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
153
|
-
[1m[36mPost Create (0.1ms)[0m [1m[32mINSERT INTO `posts` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
154
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
155
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
156
|
-
[1m[36mPost::Archive Create (0.3ms)[0m [1m[32mINSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
157
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
158
|
-
[1m[35m (0.4ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
159
|
-
[1m[36mPost::Archive Create (0.3ms)[0m [1m[32mINSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
160
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
161
|
-
[1m[36mPost Union Load (0.8ms)[0m [1m[35m(SELECT `posts`.`id`, `posts`.`title`, `posts`.`body`, `posts`.`created_at`, `posts`.`updated_at`, `posts`.`tag`, 'active' as archive_table_type FROM `posts`) UNION (SELECT `posts_archive`.`id`, `posts_archive`.`title`, `posts_archive`.`body`, `posts_archive`.`created_at`, `posts_archive`.`updated_at`, `posts_archive`.`tag`, 'archived' as archive_table_type FROM `posts_archive`) LIMIT 3[0m
|
162
|
-
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
163
|
-
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
164
|
-
-------------------------------------------------------------
|
165
|
-
ArchiveTableTest: test_existing_archive_records_are_read_only
|
166
|
-
-------------------------------------------------------------
|
167
|
-
[1m[36mPost Destroy (0.2ms)[0m [1m[31mDELETE FROM `posts`[0m
|
168
|
-
[1m[36mPost::Archive Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
169
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
170
|
-
[1m[36mPost::Archive Create (0.1ms)[0m [1m[32mINSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
171
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
172
|
-
[1m[36mPost::Archive Load (0.2ms)[0m [1m[34mSELECT `posts_archive`.* FROM `posts_archive` WHERE `posts_archive`.`id` = 5 LIMIT 1[0m
|
173
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
174
|
-
[1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
175
|
-
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
176
|
-
[1m[36mPostrw::Archive Create (0.3ms)[0m [1m[32mINSERT INTO `postrws_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
177
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
178
|
-
[1m[36mPostrw::Archive Load (0.3ms)[0m [1m[34mSELECT `postrws_archive`.* FROM `postrws_archive` WHERE `postrws_archive`.`id` = 1 LIMIT 1[0m
|
179
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
180
|
-
[1m[36mPostrw::Archive Update (0.3ms)[0m [1m[33mUPDATE `postrws_archive` SET `title` = 'New post' WHERE `postrws_archive`.`id` = 1[0m
|
181
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
182
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
183
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
184
|
-
-----------------------------------------------------------------
|
185
|
-
ArchiveTableTest: test_overriding_database_connection_for_archive
|
186
|
-
-----------------------------------------------------------------
|
187
|
-
[1m[36mPost Destroy (0.2ms)[0m [1m[31mDELETE FROM `posts`[0m
|
188
|
-
[1m[36mPost::Archive Destroy (0.2ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
189
|
-
[1m[35m (0.3ms)[0m [1m[35mSET @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483[0m
|
190
|
-
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
191
|
-
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
192
|
-
[1m[36mPost Create (0.5ms)[0m [1m[32mINSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
193
|
-
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
194
|
-
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
195
|
-
[1m[36mLogOther Create (0.2ms)[0m [1m[32mINSERT INTO `log_others` (`post_id`, `note`) VALUES (5, 'Oh')[0m
|
196
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
197
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
198
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
199
|
-
[1m[36mLogOther::Archive Create (0.2ms)[0m [1m[32mINSERT INTO `log_others_archive` (`id`, `post_id`, `note`) VALUES (1, 5, 'Oh')[0m
|
200
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
201
|
-
[1m[36mPost::Archive Create (0.3ms)[0m [1m[32mINSERT INTO `posts_archive` (`id`, `title`, `created_at`, `updated_at`, `tag`) VALUES (5, 'Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
202
|
-
[1m[36mPost Destroy (0.2ms)[0m [1m[31mDELETE FROM `posts` WHERE `posts`.`id` = 5[0m
|
203
|
-
[1m[36mLogOther Destroy (0.2ms)[0m [1m[31mDELETE FROM `log_others` WHERE `log_others`.`id` = 1[0m
|
204
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
205
|
-
[1m[36mPost Load (0.2ms)[0m [1m[34mSELECT `posts`.* FROM `posts` WHERE `posts`.`id` = 5 LIMIT 1[0m
|
206
|
-
[1m[36mPost::Archive Load (0.2ms)[0m [1m[34mSELECT `posts_archive`.* FROM `posts_archive` WHERE `posts_archive`.`id` = 5 LIMIT 1[0m
|
207
|
-
[1m[36mLogOther Load (0.2ms)[0m [1m[34mSELECT `log_others`.* FROM `log_others` WHERE `log_others`.`id` = 1 LIMIT 1[0m
|
208
|
-
[1m[36mLogOther::Archive Load (0.3ms)[0m [1m[34mSELECT `log_others_archive`.* FROM `log_others_archive` WHERE `log_others_archive`.`id` = 1 LIMIT 1[0m
|
209
|
-
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
210
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
211
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
212
|
-
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
213
|
-
--------------------------------------------
|
214
|
-
ArchiveTableTest: test_creates_archive_model
|
215
|
-
--------------------------------------------
|
216
|
-
[1m[36mPost Destroy (0.2ms)[0m [1m[31mDELETE FROM `posts`[0m
|
217
|
-
[1m[36mPost::Archive Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
218
|
-
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
219
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
220
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
221
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
222
|
-
-----------------------------------------------------------
|
223
|
-
ArchiveTableTest: test_with_archive_applies_lambda_to_query
|
224
|
-
-----------------------------------------------------------
|
225
|
-
[1m[36mPost Destroy (0.3ms)[0m [1m[31mDELETE FROM `posts`[0m
|
226
|
-
[1m[36mPost::Archive Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
227
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
228
|
-
[1m[36mPost Create (0.2ms)[0m [1m[32mINSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
229
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
230
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
231
|
-
[1m[36mPost Create (0.1ms)[0m [1m[32mINSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 2', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'misc')[0m
|
232
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
233
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
234
|
-
[1m[36mPost::Archive Create (0.1ms)[0m [1m[32mINSERT INTO `posts_archive` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Archive 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
235
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
236
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
237
|
-
[1m[36mPost::Archive Create (0.1ms)[0m [1m[32mINSERT INTO `posts_archive` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Archive 2', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'misc')[0m
|
238
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
239
|
-
[1m[36mPost Union Load (0.4ms)[0m [1m[35m(SELECT `posts`.`id`, `posts`.`title`, `posts`.`body`, `posts`.`created_at`, `posts`.`updated_at`, `posts`.`tag`, 'active' as archive_table_type FROM `posts` WHERE `posts`.`tag` = 'misc') UNION (SELECT `posts_archive`.`id`, `posts_archive`.`title`, `posts_archive`.`body`, `posts_archive`.`created_at`, `posts_archive`.`updated_at`, `posts_archive`.`tag`, 'archived' as archive_table_type FROM `posts_archive` WHERE `posts_archive`.`tag` = 'misc')[0m
|
240
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
241
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
242
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
243
|
-
[1m[35m (0.7ms)[0m [1m[35mBEGIN[0m
|
244
|
-
-----------------------------------------------------------
|
245
|
-
ArchiveTableTest: test_new_archive_records_can_be_persisted
|
246
|
-
-----------------------------------------------------------
|
247
|
-
[1m[36mPost Destroy (0.6ms)[0m [1m[31mDELETE FROM `posts`[0m
|
248
|
-
[1m[36mPost::Archive Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
249
|
-
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
250
|
-
[1m[36mPost::Archive Create (0.2ms)[0m [1m[32mINSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
251
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
252
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
253
|
-
[1m[36mPostrw::Archive Create (0.2ms)[0m [1m[32mINSERT INTO `postrws_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
254
|
-
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
255
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
256
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
257
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
258
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
259
|
-
---------------------------------------------------------------------------------------
|
260
|
-
ArchiveTableTest: test_existing_archive_records_fetched_with_with_archive_are_read_only
|
261
|
-
---------------------------------------------------------------------------------------
|
262
|
-
[1m[36mPost Destroy (0.3ms)[0m [1m[31mDELETE FROM `posts`[0m
|
263
|
-
[1m[36mPost::Archive Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
264
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
265
|
-
[1m[36mPost::Archive Create (0.2ms)[0m [1m[32mINSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
266
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
267
|
-
[1m[36mPost Union Load (0.4ms)[0m [1m[35m(SELECT `posts`.`id`, `posts`.`title`, `posts`.`body`, `posts`.`created_at`, `posts`.`updated_at`, `posts`.`tag`, 'active' as archive_table_type FROM `posts`) UNION (SELECT `posts_archive`.`id`, `posts_archive`.`title`, `posts_archive`.`body`, `posts_archive`.`created_at`, `posts_archive`.`updated_at`, `posts_archive`.`tag`, 'archived' as archive_table_type FROM `posts_archive`)[0m
|
268
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
269
|
-
[1m[35m (0.1ms)[0m [1m[31mROLLBACK TO SAVEPOINT active_record_1[0m
|
270
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
271
|
-
[1m[36mPostrw::Archive Create (0.2ms)[0m [1m[32mINSERT INTO `postrws_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
272
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
273
|
-
[1m[36mPostrw Union Load (0.4ms)[0m [1m[35m(SELECT `postrws`.`id`, `postrws`.`title`, `postrws`.`body`, `postrws`.`created_at`, `postrws`.`updated_at`, 'active' as archive_table_type FROM `postrws`) UNION (SELECT `postrws_archive`.`id`, `postrws_archive`.`title`, `postrws_archive`.`body`, `postrws_archive`.`created_at`, `postrws_archive`.`updated_at`, 'archived' as archive_table_type FROM `postrws_archive`)[0m
|
274
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
275
|
-
[1m[36mPostrw::Archive Update (0.2ms)[0m [1m[33mUPDATE `postrws_archive` SET `title` = 'New post' WHERE `postrws_archive`.`id` = 3[0m
|
276
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
277
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
278
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
279
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
280
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
281
|
-
------------------------------------------------------------
|
282
|
-
ArchiveTableTest: test_with_archive_takes_lambda_and_options
|
283
|
-
------------------------------------------------------------
|
284
|
-
[1m[36mPost Destroy (0.2ms)[0m [1m[31mDELETE FROM `posts`[0m
|
285
|
-
[1m[36mPost::Archive Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
286
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
287
|
-
[1m[36mPost Create (0.1ms)[0m [1m[32mINSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('4', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
288
|
-
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
289
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
290
|
-
[1m[36mPost Create (0.1ms)[0m [1m[32mINSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('3', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'misc')[0m
|
291
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
292
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
293
|
-
[1m[36mPost::Archive Create (0.2ms)[0m [1m[32mINSERT INTO `posts_archive` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('2', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'misc')[0m
|
294
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
295
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
296
|
-
[1m[36mPost::Archive Create (0.1ms)[0m [1m[32mINSERT INTO `posts_archive` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'misc')[0m
|
297
|
-
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
298
|
-
[1m[36mPost Union Load (0.4ms)[0m [1m[35m(SELECT `posts`.`id`, `posts`.`title`, `posts`.`body`, `posts`.`created_at`, `posts`.`updated_at`, `posts`.`tag`, 'active' as archive_table_type FROM `posts` WHERE `posts`.`tag` = 'misc') UNION (SELECT `posts_archive`.`id`, `posts_archive`.`title`, `posts_archive`.`body`, `posts_archive`.`created_at`, `posts_archive`.`updated_at`, `posts_archive`.`tag`, 'archived' as archive_table_type FROM `posts_archive` WHERE `posts_archive`.`tag` = 'misc') ORDER BY title ASC LIMIT 2[0m
|
299
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
300
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
301
|
-
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
302
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
303
|
-
-------------------------------------------------------------------
|
304
|
-
ArchiveTableTest: test_with_archive_unions_results_from_both_tables
|
305
|
-
-------------------------------------------------------------------
|
306
|
-
[1m[36mPost Destroy (0.2ms)[0m [1m[31mDELETE FROM `posts`[0m
|
307
|
-
[1m[36mPost::Archive Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
308
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
309
|
-
[1m[36mPost Create (0.1ms)[0m [1m[32mINSERT INTO `posts` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
310
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
311
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
312
|
-
[1m[36mPost::Archive Create (0.1ms)[0m [1m[32mINSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
313
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
314
|
-
[1m[36mPost Union Load (0.4ms)[0m [1m[35m(SELECT `posts`.`id`, `posts`.`title`, `posts`.`body`, `posts`.`created_at`, `posts`.`updated_at`, `posts`.`tag`, 'active' as archive_table_type FROM `posts`) UNION (SELECT `posts_archive`.`id`, `posts_archive`.`title`, `posts_archive`.`body`, `posts_archive`.`created_at`, `posts_archive`.`updated_at`, `posts_archive`.`tag`, 'archived' as archive_table_type FROM `posts_archive`)[0m
|
315
|
-
[1m[35m (0.5ms)[0m [1m[31mROLLBACK[0m
|
316
|
-
[1m[35m (0.9ms)[0m [1m[31mROLLBACK[0m
|
317
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
318
|
-
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
319
|
-
-------------------------------------------------------
|
320
|
-
ArchiveTableTest: test_add_archive_suffix_to_table_name
|
321
|
-
-------------------------------------------------------
|
322
|
-
[1m[36mPost Destroy (0.6ms)[0m [1m[31mDELETE FROM `posts`[0m
|
323
|
-
[1m[36mPost::Archive Destroy (0.2ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
324
|
-
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
325
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
326
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
327
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
328
|
-
--------------------------------------------------
|
329
|
-
ArchiveTableTest: test_archiving_a_specific_record
|
330
|
-
--------------------------------------------------
|
331
|
-
[1m[36mPost Destroy (0.3ms)[0m [1m[31mDELETE FROM `posts`[0m
|
332
|
-
[1m[36mPost::Archive Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
333
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
334
|
-
[1m[36mPost Create (0.2ms)[0m [1m[32mINSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
335
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
336
|
-
[1m[35m (0.2ms)[0m [1m[34mSELECT COUNT(*) FROM `posts`[0m
|
337
|
-
[1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM `posts_archive`[0m
|
338
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
339
|
-
[1m[36mPost::Archive Create (0.1ms)[0m [1m[32mINSERT INTO `posts_archive` (`id`, `title`, `created_at`, `updated_at`, `tag`) VALUES (11, 'Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
340
|
-
[1m[36mPost Destroy (0.2ms)[0m [1m[31mDELETE FROM `posts` WHERE `posts`.`id` = 11[0m
|
341
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
342
|
-
[1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM `posts_archive`[0m
|
343
|
-
[1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM `posts`[0m
|
344
|
-
[1m[36mPost Load (0.1ms)[0m [1m[34mSELECT `posts`.* FROM `posts` WHERE `posts`.`id` = 11 LIMIT 1[0m
|
345
|
-
[1m[36mPost::Archive Load (0.2ms)[0m [1m[34mSELECT `posts_archive`.* FROM `posts_archive` WHERE `posts_archive`.`id` = 11 LIMIT 1[0m
|
346
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
347
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
348
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
349
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
350
|
-
---------------------------------------------
|
351
|
-
ArchiveTableTest: test_archiving_aged_records
|
352
|
-
---------------------------------------------
|
353
|
-
[1m[36mPost Destroy (0.3ms)[0m [1m[31mDELETE FROM `posts`[0m
|
354
|
-
[1m[36mPost::Archive Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
355
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
356
|
-
[1m[36mPost Create (0.2ms)[0m [1m[32mINSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
357
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
358
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
359
|
-
[1m[36mPost Create (0.1ms)[0m [1m[32mINSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 2', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'misc')[0m
|
360
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
361
|
-
[1m[35m (0.2ms)[0m [1m[34mSELECT COUNT(*) FROM `posts`[0m
|
362
|
-
[1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM `posts_archive`[0m
|
363
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
364
|
-
[1m[36mPost Load (0.2ms)[0m [1m[34mSELECT `posts`.* FROM `posts` WHERE (tag = 'news') ORDER BY `posts`.`id` ASC LIMIT 100[0m
|
365
|
-
[1m[36mPost::Archive Create (0.2ms)[0m [1m[32mINSERT INTO `posts_archive` (`id`, `title`, `created_at`, `updated_at`, `tag`) VALUES (12, 'Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
366
|
-
[1m[36mPost Destroy (0.2ms)[0m [1m[31mDELETE FROM `posts` WHERE `posts`.`id` = 12[0m
|
367
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
368
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
369
|
-
[1m[36mPost Load (0.3ms)[0m [1m[34mSELECT `posts`.* FROM `posts` WHERE (tag = 'news') ORDER BY `posts`.`id` ASC LIMIT 100[0m
|
370
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
371
|
-
[1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM `posts_archive`[0m
|
372
|
-
[1m[35m (0.1ms)[0m [1m[34mSELECT COUNT(*) FROM `posts`[0m
|
373
|
-
[1m[36mPost Load (0.2ms)[0m [1m[34mSELECT `posts`.* FROM `posts` WHERE `posts`.`id` = 12 LIMIT 1[0m
|
374
|
-
[1m[36mPost::Archive Load (0.1ms)[0m [1m[34mSELECT `posts_archive`.* FROM `posts_archive` WHERE `posts_archive`.`id` = 12 LIMIT 1[0m
|
375
|
-
[1m[36mPost Load (0.1ms)[0m [1m[34mSELECT `posts`.* FROM `posts` WHERE `posts`.`id` = 13 LIMIT 1[0m
|
376
|
-
[1m[36mPost::Archive Load (0.2ms)[0m [1m[34mSELECT `posts_archive`.* FROM `posts_archive` WHERE `posts_archive`.`id` = 13 LIMIT 1[0m
|
377
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
378
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
379
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
380
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
381
|
-
------------------------------------------------
|
382
|
-
ArchiveTableTest: test_with_archive_takes_:order
|
383
|
-
------------------------------------------------
|
384
|
-
[1m[36mPost Destroy (0.3ms)[0m [1m[31mDELETE FROM `posts`[0m
|
385
|
-
[1m[36mPost::Archive Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
386
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
387
|
-
[1m[36mPost Create (0.1ms)[0m [1m[32mINSERT INTO `posts` (`created_at`, `updated_at`, `tag`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20', '3')[0m
|
388
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
389
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
390
|
-
[1m[36mPost Create (0.1ms)[0m [1m[32mINSERT INTO `posts` (`created_at`, `updated_at`, `tag`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20', '4')[0m
|
391
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
392
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
393
|
-
[1m[36mPost::Archive Create (0.4ms)[0m [1m[32mINSERT INTO `posts_archive` (`created_at`, `updated_at`, `tag`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20', '1')[0m
|
394
|
-
[1m[35m (0.3ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
395
|
-
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
396
|
-
[1m[36mPost::Archive Create (0.3ms)[0m [1m[32mINSERT INTO `posts_archive` (`created_at`, `updated_at`, `tag`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20', '2')[0m
|
397
|
-
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
398
|
-
[1m[36mPost Union Load (1.0ms)[0m [1m[35m(SELECT `posts`.`id`, `posts`.`title`, `posts`.`body`, `posts`.`created_at`, `posts`.`updated_at`, `posts`.`tag`, 'active' as archive_table_type FROM `posts`) UNION (SELECT `posts_archive`.`id`, `posts_archive`.`title`, `posts_archive`.`body`, `posts_archive`.`created_at`, `posts_archive`.`updated_at`, `posts_archive`.`tag`, 'archived' as archive_table_type FROM `posts_archive`) ORDER BY tag DESC[0m
|
399
|
-
[1m[35m (0.5ms)[0m [1m[31mROLLBACK[0m
|
400
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
401
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
402
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
403
|
-
------------------------------------------------------------------
|
404
|
-
ArchiveTableTest: test_archiving_aged_records_with_before_callback
|
405
|
-
------------------------------------------------------------------
|
406
|
-
[1m[36mPost Destroy (0.3ms)[0m [1m[31mDELETE FROM `posts`[0m
|
407
|
-
[1m[36mPost::Archive Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
408
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
409
|
-
[1m[36mPost Create (0.1ms)[0m [1m[32mINSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
410
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
411
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
412
|
-
[1m[36mPost Create (0.1ms)[0m [1m[32mINSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 2', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'misc')[0m
|
413
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
414
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
415
|
-
[1m[36mPost Load (0.2ms)[0m [1m[34mSELECT `posts`.* FROM `posts` WHERE (tag = 'news') ORDER BY `posts`.`id` ASC LIMIT 100[0m
|
416
|
-
[1m[36mPost::Archive Create (0.2ms)[0m [1m[32mINSERT INTO `posts_archive` (`id`, `title`, `created_at`, `updated_at`, `tag`) VALUES (16, 'Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')[0m
|
417
|
-
[1m[36mPost Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts` WHERE `posts`.`id` = 16[0m
|
418
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
419
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
420
|
-
[1m[36mPost Load (0.2ms)[0m [1m[34mSELECT `posts`.* FROM `posts` WHERE (tag = 'news') ORDER BY `posts`.`id` ASC LIMIT 100[0m
|
421
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
422
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
423
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
424
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
425
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
426
|
-
-------------------------------------------------
|
427
|
-
ArchiveTableTest: test_with_archive_takes_:offset
|
428
|
-
-------------------------------------------------
|
429
|
-
[1m[36mPost Destroy (0.3ms)[0m [1m[31mDELETE FROM `posts`[0m
|
430
|
-
[1m[36mPost::Archive Destroy (0.1ms)[0m [1m[31mDELETE FROM `posts_archive`[0m
|
431
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
432
|
-
[1m[36mPost Create (0.2ms)[0m [1m[32mINSERT INTO `posts` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
433
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
434
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
435
|
-
[1m[36mPost Create (0.1ms)[0m [1m[32mINSERT INTO `posts` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
436
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
437
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
438
|
-
[1m[36mPost::Archive Create (0.2ms)[0m [1m[32mINSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
439
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
440
|
-
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
441
|
-
[1m[36mPost::Archive Create (0.2ms)[0m [1m[32mINSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')[0m
|
442
|
-
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
443
|
-
[1m[36mPost Union Load (0.4ms)[0m [1m[35m(SELECT `posts`.`id`, `posts`.`title`, `posts`.`body`, `posts`.`created_at`, `posts`.`updated_at`, `posts`.`tag`, 'active' as archive_table_type FROM `posts`) UNION (SELECT `posts_archive`.`id`, `posts_archive`.`title`, `posts_archive`.`body`, `posts_archive`.`created_at`, `posts_archive`.`updated_at`, `posts_archive`.`tag`, 'archived' as archive_table_type FROM `posts_archive`) LIMIT 10 OFFSET 2[0m
|
444
|
-
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
445
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
446
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
447
|
-
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
448
|
-
----------------------------------------
|
449
|
-
MigrationTest: test_create_archive_table
|
450
|
-
----------------------------------------
|
451
|
-
[1m[35m (16.4ms)[0m [1m[35mCREATE TABLE `comments` (`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `author` varchar(255), `body` text) ENGINE=InnoDB[0m
|
452
|
-
[1m[35m (11.4ms)[0m [1m[35mCREATE TABLE IF NOT EXISTS `comments_archive` LIKE `comments`[0m
|
453
|
-
[1m[35m (10.6ms)[0m [1m[35mDROP TABLE `comments`[0m
|
454
|
-
[1m[35m (5.2ms)[0m [1m[35mDROP TABLE `comments_archive`[0m
|
455
|
-
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
456
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
457
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
458
|
-
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
459
|
-
-------------------------------------------------
|
460
|
-
MigrationTest: test_ignore_existing_archive_table
|
461
|
-
-------------------------------------------------
|
462
|
-
[1m[35m (11.2ms)[0m [1m[35mCREATE TABLE `comments` (`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `author` varchar(255), `body` text) ENGINE=InnoDB[0m
|
463
|
-
[1m[35m (12.8ms)[0m [1m[35mCREATE TABLE IF NOT EXISTS `comments_archive` LIKE `comments`[0m
|
464
|
-
[1m[35m (1.4ms)[0m [1m[35mCREATE TABLE IF NOT EXISTS `comments_archive` LIKE `comments`[0m
|
465
|
-
[1m[35m (4.7ms)[0m [1m[35mDROP TABLE `comments`[0m
|
466
|
-
[1m[35m (5.0ms)[0m [1m[35mDROP TABLE `comments_archive`[0m
|
467
|
-
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
468
|
-
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
469
|
-
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
470
|
-
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
471
|
-
-------------------------
|
472
|
-
ArchivingTest: test_truth
|
473
|
-
-------------------------
|
474
|
-
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
475
|
-
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|