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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4787a476fbcf9372daaad1458c4e5c69c9f0d842
4
- data.tar.gz: 25320a992b8ca046256c7113875bf9dc90e1439e
2
+ SHA256:
3
+ metadata.gz: fafb98fb93f47de9e5a199ffc1d37ea8dfc30ec8d4c39058e6fe80b03052f221
4
+ data.tar.gz: 25eb040c41551374aebc23a08aab63981ff298ba541717e97249629d59befb4e
5
5
  SHA512:
6
- metadata.gz: 072f48fa3df167fcbfb64cd60f28154b57e1c3d36bb6976435e0ab75d188f7fc9047c95b57ac4cb2c9120e9ea8c0f667bfb4c269fac97ee91bfdc0e2171a7edb
7
- data.tar.gz: d725d9edf1b23113618d3bdb6ca6b651a573fae5a64a481ca8255968284326627da0768419e863ad13ba3722f8e9b78b7b1b3322e9466c89c0a1d6c0029ada37
6
+ metadata.gz: e22a51dbb93e4142359eca6902492c49349a8073f125591ba0f8bba406d1c1872c70646c6843b378ccfcd232d1e5525ab37af65d0a47b7f6a234f34ef9ec5801
7
+ data.tar.gz: 9abd0f49fa20bf84809fa9a28fb743ee97d6725f4cce1072fe1d3cd1a68decc01dc20c4274d16f1832e50c232af69c50a336eb7afcb9920de5d878b192aacac0
data/Rakefile CHANGED
@@ -20,9 +20,6 @@ RDoc::Task.new(:rdoc) do |rdoc|
20
20
  rdoc.rdoc_files.include('lib/**/*.rb')
21
21
  end
22
22
 
23
-
24
-
25
-
26
23
  Bundler::GemHelper.install_tasks
27
24
 
28
25
  require 'rake/testtask'
@@ -1,4 +1,11 @@
1
- class CreatePosts < ActiveRecord::Migration
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
- class PostsArchive < ActiveRecord::Migration
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
- class PostsTag < ActiveRecord::Migration
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
- class CreateLogs < ActiveRecord::Migration
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
- class CreatePostableOnLogDay < ActiveRecord::Migration
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
- class CreateLogOther < ActiveRecord::Migration
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 CreateLogOtherArchive < ActiveRecord::Migration
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 = ActiveRecord::Base.establish_connection(:"other_#{Rails.env}").connection
32
+ @connection = OtherConnection.connection
20
33
  yield
21
34
  ensure
22
35
  @connection = connection_was
23
- ActiveRecord::Base.remove_connection
24
- ActiveRecord::Base.establish_connection
36
+ OtherConnection.remove_connection
25
37
  end
26
38
  end
@@ -1,4 +1,11 @@
1
- class CreatePostrws < ActiveRecord::Migration[4.2]
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
@@ -4,7 +4,14 @@ class Comment < ActiveRecord::Base
4
4
  has_archive_table
5
5
  end
6
6
 
7
- class CreateComments < ActiveRecord::Migration[4.2]
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.3.1
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-05-27 00:00:00.000000000 Z
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: '6.0'
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: '6.0'
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: '6.0'
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: '6.0'
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
- rubyforge_project:
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/test_helper.rb
216
- - test/archive_table_test.rb
217
- - test/dummy/config/boot.rb
218
- - test/dummy/config/application.rb
219
- - test/dummy/config/initializers/secret_token.rb
220
- - test/dummy/config/initializers/inflections.rb
221
- - test/dummy/config/initializers/wrap_parameters.rb
222
- - test/dummy/config/initializers/session_store.rb
223
- - test/dummy/config/initializers/mime_types.rb
224
- - test/dummy/config/initializers/filter_parameter_logging.rb
225
- - test/dummy/config/initializers/backtrace_silencers.rb
226
- - test/dummy/config/database.yml
227
- - test/dummy/config/environments/development.rb
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/locales/en.yml
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/schema.rb
243
- - test/dummy/Rakefile
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
@@ -1,475 +0,0 @@
1
-  (0.2ms) SET @@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
2
-  (0.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC
3
-  (0.2ms) SET @@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
4
-  (0.4ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC
5
-  (0.3ms) SELECT `ar_internal_metadata`.`value` FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment'
6
-  (0.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC
7
-  (0.7ms) SELECT `ar_internal_metadata`.`value` FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment'
8
-  (0.3ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC
9
-  (0.3ms) SELECT `ar_internal_metadata`.`value` FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment'
10
-  (0.4ms) SET @@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
11
-  (56.5ms) DROP DATABASE IF EXISTS `archiving_test`
12
-  (2.7ms) CREATE DATABASE `archiving_test` DEFAULT CHARACTER SET `utf8`
13
-  (0.2ms) SET @@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
14
-  (0.2ms) SET @@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
15
-  (1.5ms) DROP TABLE IF EXISTS `log_days` CASCADE
16
-  (44.8ms) CREATE 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
17
-  (1.8ms) DROP TABLE IF EXISTS `log_days_archive` CASCADE
18
-  (22.0ms) CREATE 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
19
-  (1.2ms) DROP TABLE IF EXISTS `log_lines` CASCADE
20
-  (16.6ms) CREATE 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
21
-  (2.0ms) DROP TABLE IF EXISTS `log_lines_archive` CASCADE
22
-  (14.7ms) CREATE 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
23
-  (1.4ms) DROP TABLE IF EXISTS `log_others` CASCADE
24
-  (11.8ms) CREATE 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
25
-  (1.4ms) DROP TABLE IF EXISTS `log_others_archive` CASCADE
26
-  (22.0ms) CREATE 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
27
-  (1.7ms) DROP TABLE IF EXISTS `postrws` CASCADE
28
-  (20.9ms) CREATE 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
29
-  (4.3ms) DROP TABLE IF EXISTS `postrws_archive` CASCADE
30
-  (14.8ms) CREATE 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
31
-  (1.0ms) DROP TABLE IF EXISTS `posts` CASCADE
32
-  (8.4ms) CREATE 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
33
-  (0.9ms) DROP TABLE IF EXISTS `posts_archive` CASCADE
34
-  (7.8ms) CREATE 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
35
-  (7.8ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL PRIMARY KEY)
36
-  (0.4ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC
37
-  (1.8ms) INSERT INTO `schema_migrations` (version) VALUES (20190711112558)
38
-  (1.4ms) INSERT INTO `schema_migrations` (version) VALUES
39
- (20140220140952),
40
- (20140220134827),
41
- (20161103100644),
42
- (20140220140852),
43
- (20140414124125),
44
- (20161103093656),
45
- (20140317201702);
46
-
47
- 
48
-  (6.8ms) CREATE TABLE `ar_internal_metadata` (`key` varchar(255) NOT NULL PRIMARY KEY, `value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL)
49
- ActiveRecord::InternalMetadata Load (0.4ms) SELECT `ar_internal_metadata`.* FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment' LIMIT 1
50
-  (0.2ms) BEGIN
51
- ActiveRecord::InternalMetadata Create (0.2ms) INSERT 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')
52
-  (1.8ms) COMMIT
53
- ActiveRecord::InternalMetadata Load (0.2ms) SELECT `ar_internal_metadata`.* FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment' LIMIT 1
54
-  (0.1ms) BEGIN
55
-  (0.5ms) COMMIT
56
-  (0.2ms) SET @@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
57
-  (0.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC
58
-  (0.2ms) BEGIN
59
- ---------------------------------------------
60
- ArchiveTableTest: test_archiving_associations
61
- ---------------------------------------------
62
- Post Destroy (0.4ms) DELETE FROM `posts`
63
- Post::Archive Destroy (0.2ms) DELETE FROM `posts_archive`
64
-  (0.3ms) SAVEPOINT active_record_1
65
- Post Create (0.3ms) INSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')
66
-  (0.1ms) RELEASE SAVEPOINT active_record_1
67
-  (0.2ms) SAVEPOINT active_record_1
68
- LogDay Create (0.2ms) INSERT INTO `log_days` (`post_id`, `day`) VALUES (1, '2019-05-27')
69
-  (0.1ms) RELEASE SAVEPOINT active_record_1
70
-  (0.2ms) SAVEPOINT active_record_1
71
- LogLine Create (0.2ms) INSERT INTO `log_lines` (`log_day_id`, `descr`) VALUES (1, 'hallo')
72
-  (0.1ms) RELEASE SAVEPOINT active_record_1
73
-  (0.1ms) SAVEPOINT active_record_1
74
- LogLine Create (0.2ms) INSERT INTO `log_lines` (`log_day_id`, `descr`) VALUES (1, 'hurra')
75
-  (0.1ms) RELEASE SAVEPOINT active_record_1
76
-  (0.3ms) SELECT COUNT(*) FROM `log_lines` WHERE `log_lines`.`log_day_id` = 1
77
-  (0.1ms) SAVEPOINT active_record_1
78
- LogDay::Archive Create (0.2ms) INSERT INTO `log_days_archive` (`id`, `post_id`, `day`) VALUES (1, 1, '2019-05-27')
79
- Post::Archive Create (0.3ms) INSERT 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')
80
- Post Destroy (0.3ms) DELETE FROM `posts` WHERE `posts`.`id` = 1
81
- LogLine Load (0.2ms) SELECT `log_lines`.* FROM `log_lines` WHERE `log_lines`.`log_day_id` = 1
82
- LogLine::Archive Create (0.2ms) INSERT INTO `log_lines_archive` (`id`, `log_day_id`, `descr`) VALUES (1, 1, 'hallo')
83
- LogLine Destroy (0.2ms) DELETE FROM `log_lines` WHERE `log_lines`.`id` = 1
84
- LogLine::Archive Create (0.1ms) INSERT INTO `log_lines_archive` (`id`, `log_day_id`, `descr`) VALUES (2, 1, 'hurra')
85
- LogLine Destroy (0.2ms) DELETE FROM `log_lines` WHERE `log_lines`.`id` = 2
86
- LogDay Destroy (0.2ms) DELETE FROM `log_days` WHERE `log_days`.`id` = 1
87
-  (0.1ms) RELEASE SAVEPOINT active_record_1
88
- LogDay Load (0.3ms) SELECT `log_days`.* FROM `log_days` WHERE `log_days`.`id` = 1 LIMIT 1
89
- LogDay::Archive Load (0.2ms) SELECT `log_days_archive`.* FROM `log_days_archive` WHERE `log_days_archive`.`id` = 1 LIMIT 1
90
- Post Load (0.5ms) SELECT `posts`.* FROM `posts` WHERE `posts`.`id` = 1 LIMIT 1
91
- Post::Archive Load (0.2ms) SELECT `posts_archive`.* FROM `posts_archive` WHERE `posts_archive`.`id` = 1 LIMIT 1
92
- LogLine Load (0.2ms) SELECT `log_lines`.* FROM `log_lines` WHERE `log_lines`.`id` = 1 LIMIT 1
93
- LogLine::Archive Load (0.2ms) SELECT `log_lines_archive`.* FROM `log_lines_archive` WHERE `log_lines_archive`.`id` = 1 LIMIT 1
94
- LogLine Load (0.1ms) SELECT `log_lines`.* FROM `log_lines` WHERE `log_lines`.`id` = 2 LIMIT 1
95
- LogLine::Archive Load (0.1ms) SELECT `log_lines_archive`.* FROM `log_lines_archive` WHERE `log_lines_archive`.`id` = 2 LIMIT 1
96
-  (0.2ms) ROLLBACK
97
-  (0.1ms) BEGIN
98
- --------------------------------------------------
99
- ArchiveTableTest: test_shorthand_for_archive_model
100
- --------------------------------------------------
101
- Post Destroy (0.2ms) DELETE FROM `posts`
102
- Post::Archive Destroy (0.1ms) DELETE FROM `posts_archive`
103
-  (0.1ms) ROLLBACK
104
-  (0.1ms) BEGIN
105
- ---------------------------------------------------------
106
- ArchiveTableTest: test_archiving_polymorphic_associations
107
- ---------------------------------------------------------
108
- Post Destroy (0.2ms) DELETE FROM `posts`
109
- Post::Archive Destroy (0.1ms) DELETE FROM `posts_archive`
110
-  (0.1ms) SAVEPOINT active_record_1
111
- Post Create (0.2ms) INSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')
112
-  (0.1ms) RELEASE SAVEPOINT active_record_1
113
-  (0.1ms) SAVEPOINT active_record_1
114
- LogDay Create (0.2ms) INSERT INTO `log_days` (`day`, `postable_type`, `postable_id`) VALUES ('2019-05-27', 'Post', 2)
115
-  (0.1ms) RELEASE SAVEPOINT active_record_1
116
-  (0.1ms) SAVEPOINT active_record_1
117
- LogLine Create (0.1ms) INSERT INTO `log_lines` (`log_day_id`, `descr`) VALUES (2, 'hallo')
118
-  (0.1ms) RELEASE SAVEPOINT active_record_1
119
-  (0.1ms) SAVEPOINT active_record_1
120
- LogLine Create (0.1ms) INSERT INTO `log_lines` (`log_day_id`, `descr`) VALUES (2, 'hurra')
121
-  (0.1ms) RELEASE SAVEPOINT active_record_1
122
-  (0.2ms) SELECT COUNT(*) FROM `log_lines` WHERE `log_lines`.`log_day_id` = 2
123
-  (0.1ms) SAVEPOINT active_record_1
124
- LogDay::Archive Create (0.2ms) INSERT INTO `log_days_archive` (`id`, `day`, `postable_type`, `postable_id`) VALUES (2, '2019-05-27', 'Post', 2)
125
- LogLine Load (0.8ms) SELECT `log_lines`.* FROM `log_lines` WHERE `log_lines`.`log_day_id` = 2
126
- LogLine::Archive Create (0.2ms) INSERT INTO `log_lines_archive` (`id`, `log_day_id`, `descr`) VALUES (3, 2, 'hallo')
127
- LogLine Destroy (0.2ms) DELETE FROM `log_lines` WHERE `log_lines`.`id` = 3
128
- LogLine::Archive Create (0.3ms) INSERT INTO `log_lines_archive` (`id`, `log_day_id`, `descr`) VALUES (4, 2, 'hurra')
129
- LogLine Destroy (0.6ms) DELETE FROM `log_lines` WHERE `log_lines`.`id` = 4
130
- Post::Archive Create (0.3ms) INSERT 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')
131
- Post Destroy (0.3ms) DELETE FROM `posts` WHERE `posts`.`id` = 2
132
- LogDay Destroy (0.2ms) DELETE FROM `log_days` WHERE `log_days`.`id` = 2
133
-  (0.1ms) RELEASE SAVEPOINT active_record_1
134
- LogDay Load (0.2ms) SELECT `log_days`.* FROM `log_days` WHERE `log_days`.`id` = 2 LIMIT 1
135
- LogDay::Archive Load (0.3ms) SELECT `log_days_archive`.* FROM `log_days_archive` WHERE `log_days_archive`.`id` = 2 LIMIT 1
136
- Post Load (0.2ms) SELECT `posts`.* FROM `posts` WHERE `posts`.`id` = 2 LIMIT 1
137
- Post::Archive Load (0.2ms) SELECT `posts_archive`.* FROM `posts_archive` WHERE `posts_archive`.`id` = 2 LIMIT 1
138
- LogLine Load (0.1ms) SELECT `log_lines`.* FROM `log_lines` WHERE `log_lines`.`id` = 3 LIMIT 1
139
- LogLine::Archive Load (0.1ms) SELECT `log_lines_archive`.* FROM `log_lines_archive` WHERE `log_lines_archive`.`id` = 3 LIMIT 1
140
- LogLine Load (0.1ms) SELECT `log_lines`.* FROM `log_lines` WHERE `log_lines`.`id` = 4 LIMIT 1
141
- LogLine::Archive Load (0.2ms) SELECT `log_lines_archive`.* FROM `log_lines_archive` WHERE `log_lines_archive`.`id` = 4 LIMIT 1
142
-  (0.2ms) ROLLBACK
143
-  (0.1ms) BEGIN
144
- ------------------------------------------------
145
- ArchiveTableTest: test_with_archive_takes_:limit
146
- ------------------------------------------------
147
- Post Destroy (0.3ms) DELETE FROM `posts`
148
- Post::Archive Destroy (0.2ms) DELETE FROM `posts_archive`
149
-  (0.1ms) SAVEPOINT active_record_1
150
- Post Create (0.1ms) INSERT INTO `posts` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
151
-  (0.1ms) RELEASE SAVEPOINT active_record_1
152
-  (0.1ms) SAVEPOINT active_record_1
153
- Post Create (0.1ms) INSERT INTO `posts` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
154
-  (0.1ms) RELEASE SAVEPOINT active_record_1
155
-  (0.1ms) SAVEPOINT active_record_1
156
- Post::Archive Create (0.3ms) INSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
157
-  (0.1ms) RELEASE SAVEPOINT active_record_1
158
-  (0.4ms) SAVEPOINT active_record_1
159
- Post::Archive Create (0.3ms) INSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
160
-  (0.1ms) RELEASE SAVEPOINT active_record_1
161
- Post Union Load (0.8ms) (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
162
-  (0.3ms) ROLLBACK
163
-  (0.3ms) BEGIN
164
- -------------------------------------------------------------
165
- ArchiveTableTest: test_existing_archive_records_are_read_only
166
- -------------------------------------------------------------
167
- Post Destroy (0.2ms) DELETE FROM `posts`
168
- Post::Archive Destroy (0.1ms) DELETE FROM `posts_archive`
169
-  (0.1ms) SAVEPOINT active_record_1
170
- Post::Archive Create (0.1ms) INSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
171
-  (0.1ms) RELEASE SAVEPOINT active_record_1
172
- Post::Archive Load (0.2ms) SELECT `posts_archive`.* FROM `posts_archive` WHERE `posts_archive`.`id` = 5 LIMIT 1
173
-  (0.1ms) SAVEPOINT active_record_1
174
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
175
-  (0.2ms) SAVEPOINT active_record_1
176
- Postrw::Archive Create (0.3ms) INSERT INTO `postrws_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
177
-  (0.1ms) RELEASE SAVEPOINT active_record_1
178
- Postrw::Archive Load (0.3ms) SELECT `postrws_archive`.* FROM `postrws_archive` WHERE `postrws_archive`.`id` = 1 LIMIT 1
179
-  (0.1ms) SAVEPOINT active_record_1
180
- Postrw::Archive Update (0.3ms) UPDATE `postrws_archive` SET `title` = 'New post' WHERE `postrws_archive`.`id` = 1
181
-  (0.1ms) RELEASE SAVEPOINT active_record_1
182
-  (0.2ms) ROLLBACK
183
-  (0.2ms) BEGIN
184
- -----------------------------------------------------------------
185
- ArchiveTableTest: test_overriding_database_connection_for_archive
186
- -----------------------------------------------------------------
187
- Post Destroy (0.2ms) DELETE FROM `posts`
188
- Post::Archive Destroy (0.2ms) DELETE FROM `posts_archive`
189
-  (0.3ms) SET @@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
190
-  (0.1ms) BEGIN
191
-  (0.2ms) SAVEPOINT active_record_1
192
- Post Create (0.5ms) INSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')
193
-  (0.3ms) RELEASE SAVEPOINT active_record_1
194
-  (0.2ms) SAVEPOINT active_record_1
195
- LogOther Create (0.2ms) INSERT INTO `log_others` (`post_id`, `note`) VALUES (5, 'Oh')
196
-  (0.1ms) RELEASE SAVEPOINT active_record_1
197
-  (0.1ms) SAVEPOINT active_record_1
198
-  (0.1ms) SAVEPOINT active_record_1
199
- LogOther::Archive Create (0.2ms) INSERT INTO `log_others_archive` (`id`, `post_id`, `note`) VALUES (1, 5, 'Oh')
200
-  (0.1ms) RELEASE SAVEPOINT active_record_1
201
- Post::Archive Create (0.3ms) INSERT 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')
202
- Post Destroy (0.2ms) DELETE FROM `posts` WHERE `posts`.`id` = 5
203
- LogOther Destroy (0.2ms) DELETE FROM `log_others` WHERE `log_others`.`id` = 1
204
-  (0.1ms) RELEASE SAVEPOINT active_record_1
205
- Post Load (0.2ms) SELECT `posts`.* FROM `posts` WHERE `posts`.`id` = 5 LIMIT 1
206
- Post::Archive Load (0.2ms) SELECT `posts_archive`.* FROM `posts_archive` WHERE `posts_archive`.`id` = 5 LIMIT 1
207
- LogOther Load (0.2ms) SELECT `log_others`.* FROM `log_others` WHERE `log_others`.`id` = 1 LIMIT 1
208
- LogOther::Archive Load (0.3ms) SELECT `log_others_archive`.* FROM `log_others_archive` WHERE `log_others_archive`.`id` = 1 LIMIT 1
209
-  (0.3ms) ROLLBACK
210
-  (0.2ms) ROLLBACK
211
-  (0.2ms) BEGIN
212
-  (0.1ms) BEGIN
213
- --------------------------------------------
214
- ArchiveTableTest: test_creates_archive_model
215
- --------------------------------------------
216
- Post Destroy (0.2ms) DELETE FROM `posts`
217
- Post::Archive Destroy (0.1ms) DELETE FROM `posts_archive`
218
-  (0.1ms) ROLLBACK
219
-  (0.2ms) ROLLBACK
220
-  (0.2ms) BEGIN
221
-  (0.2ms) BEGIN
222
- -----------------------------------------------------------
223
- ArchiveTableTest: test_with_archive_applies_lambda_to_query
224
- -----------------------------------------------------------
225
- Post Destroy (0.3ms) DELETE FROM `posts`
226
- Post::Archive Destroy (0.1ms) DELETE FROM `posts_archive`
227
-  (0.1ms) SAVEPOINT active_record_1
228
- Post Create (0.2ms) INSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')
229
-  (0.1ms) RELEASE SAVEPOINT active_record_1
230
-  (0.1ms) SAVEPOINT active_record_1
231
- Post Create (0.1ms) INSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 2', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'misc')
232
-  (0.1ms) RELEASE SAVEPOINT active_record_1
233
-  (0.1ms) SAVEPOINT active_record_1
234
- Post::Archive Create (0.1ms) INSERT 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')
235
-  (0.1ms) RELEASE SAVEPOINT active_record_1
236
-  (0.1ms) SAVEPOINT active_record_1
237
- Post::Archive Create (0.1ms) INSERT 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')
238
-  (0.1ms) RELEASE SAVEPOINT active_record_1
239
- Post Union Load (0.4ms) (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')
240
-  (0.2ms) ROLLBACK
241
-  (0.2ms) ROLLBACK
242
-  (0.2ms) BEGIN
243
-  (0.7ms) BEGIN
244
- -----------------------------------------------------------
245
- ArchiveTableTest: test_new_archive_records_can_be_persisted
246
- -----------------------------------------------------------
247
- Post Destroy (0.6ms) DELETE FROM `posts`
248
- Post::Archive Destroy (0.1ms) DELETE FROM `posts_archive`
249
-  (0.2ms) SAVEPOINT active_record_1
250
- Post::Archive Create (0.2ms) INSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
251
-  (0.1ms) RELEASE SAVEPOINT active_record_1
252
-  (0.1ms) SAVEPOINT active_record_1
253
- Postrw::Archive Create (0.2ms) INSERT INTO `postrws_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
254
-  (0.2ms) RELEASE SAVEPOINT active_record_1
255
-  (0.2ms) ROLLBACK
256
-  (0.2ms) ROLLBACK
257
-  (0.2ms) BEGIN
258
-  (0.2ms) BEGIN
259
- ---------------------------------------------------------------------------------------
260
- ArchiveTableTest: test_existing_archive_records_fetched_with_with_archive_are_read_only
261
- ---------------------------------------------------------------------------------------
262
- Post Destroy (0.3ms) DELETE FROM `posts`
263
- Post::Archive Destroy (0.1ms) DELETE FROM `posts_archive`
264
-  (0.1ms) SAVEPOINT active_record_1
265
- Post::Archive Create (0.2ms) INSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
266
-  (0.1ms) RELEASE SAVEPOINT active_record_1
267
- Post Union Load (0.4ms) (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`)
268
-  (0.1ms) SAVEPOINT active_record_1
269
-  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
270
-  (0.1ms) SAVEPOINT active_record_1
271
- Postrw::Archive Create (0.2ms) INSERT INTO `postrws_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
272
-  (0.1ms) RELEASE SAVEPOINT active_record_1
273
- Postrw Union Load (0.4ms) (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`)
274
-  (0.1ms) SAVEPOINT active_record_1
275
- Postrw::Archive Update (0.2ms) UPDATE `postrws_archive` SET `title` = 'New post' WHERE `postrws_archive`.`id` = 3
276
-  (0.1ms) RELEASE SAVEPOINT active_record_1
277
-  (0.2ms) ROLLBACK
278
-  (0.2ms) ROLLBACK
279
-  (0.2ms) BEGIN
280
-  (0.2ms) BEGIN
281
- ------------------------------------------------------------
282
- ArchiveTableTest: test_with_archive_takes_lambda_and_options
283
- ------------------------------------------------------------
284
- Post Destroy (0.2ms) DELETE FROM `posts`
285
- Post::Archive Destroy (0.1ms) DELETE FROM `posts_archive`
286
-  (0.1ms) SAVEPOINT active_record_1
287
- Post Create (0.1ms) INSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('4', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')
288
-  (0.2ms) RELEASE SAVEPOINT active_record_1
289
-  (0.1ms) SAVEPOINT active_record_1
290
- Post Create (0.1ms) INSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('3', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'misc')
291
-  (0.1ms) RELEASE SAVEPOINT active_record_1
292
-  (0.1ms) SAVEPOINT active_record_1
293
- Post::Archive Create (0.2ms) INSERT INTO `posts_archive` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('2', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'misc')
294
-  (0.1ms) RELEASE SAVEPOINT active_record_1
295
-  (0.1ms) SAVEPOINT active_record_1
296
- Post::Archive Create (0.1ms) INSERT INTO `posts_archive` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'misc')
297
-  (0.2ms) RELEASE SAVEPOINT active_record_1
298
- Post Union Load (0.4ms) (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
299
-  (0.2ms) ROLLBACK
300
-  (0.2ms) ROLLBACK
301
-  (0.1ms) BEGIN
302
-  (0.2ms) BEGIN
303
- -------------------------------------------------------------------
304
- ArchiveTableTest: test_with_archive_unions_results_from_both_tables
305
- -------------------------------------------------------------------
306
- Post Destroy (0.2ms) DELETE FROM `posts`
307
- Post::Archive Destroy (0.1ms) DELETE FROM `posts_archive`
308
-  (0.1ms) SAVEPOINT active_record_1
309
- Post Create (0.1ms) INSERT INTO `posts` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
310
-  (0.1ms) RELEASE SAVEPOINT active_record_1
311
-  (0.1ms) SAVEPOINT active_record_1
312
- Post::Archive Create (0.1ms) INSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
313
-  (0.1ms) RELEASE SAVEPOINT active_record_1
314
- Post Union Load (0.4ms) (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`)
315
-  (0.5ms) ROLLBACK
316
-  (0.9ms) ROLLBACK
317
-  (0.2ms) BEGIN
318
-  (0.3ms) BEGIN
319
- -------------------------------------------------------
320
- ArchiveTableTest: test_add_archive_suffix_to_table_name
321
- -------------------------------------------------------
322
- Post Destroy (0.6ms) DELETE FROM `posts`
323
- Post::Archive Destroy (0.2ms) DELETE FROM `posts_archive`
324
-  (0.1ms) ROLLBACK
325
-  (0.2ms) ROLLBACK
326
-  (0.2ms) BEGIN
327
-  (0.2ms) BEGIN
328
- --------------------------------------------------
329
- ArchiveTableTest: test_archiving_a_specific_record
330
- --------------------------------------------------
331
- Post Destroy (0.3ms) DELETE FROM `posts`
332
- Post::Archive Destroy (0.1ms) DELETE FROM `posts_archive`
333
-  (0.1ms) SAVEPOINT active_record_1
334
- Post Create (0.2ms) INSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')
335
-  (0.1ms) RELEASE SAVEPOINT active_record_1
336
-  (0.2ms) SELECT COUNT(*) FROM `posts`
337
-  (0.1ms) SELECT COUNT(*) FROM `posts_archive`
338
-  (0.1ms) SAVEPOINT active_record_1
339
- Post::Archive Create (0.1ms) INSERT 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')
340
- Post Destroy (0.2ms) DELETE FROM `posts` WHERE `posts`.`id` = 11
341
-  (0.1ms) RELEASE SAVEPOINT active_record_1
342
-  (0.1ms) SELECT COUNT(*) FROM `posts_archive`
343
-  (0.1ms) SELECT COUNT(*) FROM `posts`
344
- Post Load (0.1ms) SELECT `posts`.* FROM `posts` WHERE `posts`.`id` = 11 LIMIT 1
345
- Post::Archive Load (0.2ms) SELECT `posts_archive`.* FROM `posts_archive` WHERE `posts_archive`.`id` = 11 LIMIT 1
346
-  (0.2ms) ROLLBACK
347
-  (0.2ms) ROLLBACK
348
-  (0.2ms) BEGIN
349
-  (0.2ms) BEGIN
350
- ---------------------------------------------
351
- ArchiveTableTest: test_archiving_aged_records
352
- ---------------------------------------------
353
- Post Destroy (0.3ms) DELETE FROM `posts`
354
- Post::Archive Destroy (0.1ms) DELETE FROM `posts_archive`
355
-  (0.1ms) SAVEPOINT active_record_1
356
- Post Create (0.2ms) INSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')
357
-  (0.1ms) RELEASE SAVEPOINT active_record_1
358
-  (0.1ms) SAVEPOINT active_record_1
359
- Post Create (0.1ms) INSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 2', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'misc')
360
-  (0.1ms) RELEASE SAVEPOINT active_record_1
361
-  (0.2ms) SELECT COUNT(*) FROM `posts`
362
-  (0.1ms) SELECT COUNT(*) FROM `posts_archive`
363
-  (0.1ms) SAVEPOINT active_record_1
364
- Post Load (0.2ms) SELECT `posts`.* FROM `posts` WHERE (tag = 'news') ORDER BY `posts`.`id` ASC LIMIT 100
365
- Post::Archive Create (0.2ms) INSERT 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')
366
- Post Destroy (0.2ms) DELETE FROM `posts` WHERE `posts`.`id` = 12
367
-  (0.1ms) RELEASE SAVEPOINT active_record_1
368
-  (0.1ms) SAVEPOINT active_record_1
369
- Post Load (0.3ms) SELECT `posts`.* FROM `posts` WHERE (tag = 'news') ORDER BY `posts`.`id` ASC LIMIT 100
370
-  (0.1ms) RELEASE SAVEPOINT active_record_1
371
-  (0.1ms) SELECT COUNT(*) FROM `posts_archive`
372
-  (0.1ms) SELECT COUNT(*) FROM `posts`
373
- Post Load (0.2ms) SELECT `posts`.* FROM `posts` WHERE `posts`.`id` = 12 LIMIT 1
374
- Post::Archive Load (0.1ms) SELECT `posts_archive`.* FROM `posts_archive` WHERE `posts_archive`.`id` = 12 LIMIT 1
375
- Post Load (0.1ms) SELECT `posts`.* FROM `posts` WHERE `posts`.`id` = 13 LIMIT 1
376
- Post::Archive Load (0.2ms) SELECT `posts_archive`.* FROM `posts_archive` WHERE `posts_archive`.`id` = 13 LIMIT 1
377
-  (0.2ms) ROLLBACK
378
-  (0.2ms) ROLLBACK
379
-  (0.2ms) BEGIN
380
-  (0.2ms) BEGIN
381
- ------------------------------------------------
382
- ArchiveTableTest: test_with_archive_takes_:order
383
- ------------------------------------------------
384
- Post Destroy (0.3ms) DELETE FROM `posts`
385
- Post::Archive Destroy (0.1ms) DELETE FROM `posts_archive`
386
-  (0.1ms) SAVEPOINT active_record_1
387
- Post Create (0.1ms) INSERT INTO `posts` (`created_at`, `updated_at`, `tag`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20', '3')
388
-  (0.1ms) RELEASE SAVEPOINT active_record_1
389
-  (0.1ms) SAVEPOINT active_record_1
390
- Post Create (0.1ms) INSERT INTO `posts` (`created_at`, `updated_at`, `tag`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20', '4')
391
-  (0.1ms) RELEASE SAVEPOINT active_record_1
392
-  (0.1ms) SAVEPOINT active_record_1
393
- Post::Archive Create (0.4ms) INSERT INTO `posts_archive` (`created_at`, `updated_at`, `tag`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20', '1')
394
-  (0.3ms) RELEASE SAVEPOINT active_record_1
395
-  (0.2ms) SAVEPOINT active_record_1
396
- Post::Archive Create (0.3ms) INSERT INTO `posts_archive` (`created_at`, `updated_at`, `tag`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20', '2')
397
-  (0.2ms) RELEASE SAVEPOINT active_record_1
398
- Post Union Load (1.0ms) (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
399
-  (0.5ms) ROLLBACK
400
-  (0.2ms) ROLLBACK
401
-  (0.2ms) BEGIN
402
-  (0.2ms) BEGIN
403
- ------------------------------------------------------------------
404
- ArchiveTableTest: test_archiving_aged_records_with_before_callback
405
- ------------------------------------------------------------------
406
- Post Destroy (0.3ms) DELETE FROM `posts`
407
- Post::Archive Destroy (0.1ms) DELETE FROM `posts_archive`
408
-  (0.1ms) SAVEPOINT active_record_1
409
- Post Create (0.1ms) INSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 1', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'news')
410
-  (0.1ms) RELEASE SAVEPOINT active_record_1
411
-  (0.1ms) SAVEPOINT active_record_1
412
- Post Create (0.1ms) INSERT INTO `posts` (`title`, `created_at`, `updated_at`, `tag`) VALUES ('Post 2', '2019-05-27 15:41:20', '2019-05-27 15:41:20', 'misc')
413
-  (0.1ms) RELEASE SAVEPOINT active_record_1
414
-  (0.1ms) SAVEPOINT active_record_1
415
- Post Load (0.2ms) SELECT `posts`.* FROM `posts` WHERE (tag = 'news') ORDER BY `posts`.`id` ASC LIMIT 100
416
- Post::Archive Create (0.2ms) INSERT 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')
417
- Post Destroy (0.1ms) DELETE FROM `posts` WHERE `posts`.`id` = 16
418
-  (0.1ms) RELEASE SAVEPOINT active_record_1
419
-  (0.1ms) SAVEPOINT active_record_1
420
- Post Load (0.2ms) SELECT `posts`.* FROM `posts` WHERE (tag = 'news') ORDER BY `posts`.`id` ASC LIMIT 100
421
-  (0.1ms) RELEASE SAVEPOINT active_record_1
422
-  (0.2ms) ROLLBACK
423
-  (0.2ms) ROLLBACK
424
-  (0.2ms) BEGIN
425
-  (0.2ms) BEGIN
426
- -------------------------------------------------
427
- ArchiveTableTest: test_with_archive_takes_:offset
428
- -------------------------------------------------
429
- Post Destroy (0.3ms) DELETE FROM `posts`
430
- Post::Archive Destroy (0.1ms) DELETE FROM `posts_archive`
431
-  (0.1ms) SAVEPOINT active_record_1
432
- Post Create (0.2ms) INSERT INTO `posts` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
433
-  (0.1ms) RELEASE SAVEPOINT active_record_1
434
-  (0.1ms) SAVEPOINT active_record_1
435
- Post Create (0.1ms) INSERT INTO `posts` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
436
-  (0.1ms) RELEASE SAVEPOINT active_record_1
437
-  (0.1ms) SAVEPOINT active_record_1
438
- Post::Archive Create (0.2ms) INSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
439
-  (0.1ms) RELEASE SAVEPOINT active_record_1
440
-  (0.1ms) SAVEPOINT active_record_1
441
- Post::Archive Create (0.2ms) INSERT INTO `posts_archive` (`created_at`, `updated_at`) VALUES ('2019-05-27 15:41:20', '2019-05-27 15:41:20')
442
-  (0.1ms) RELEASE SAVEPOINT active_record_1
443
- Post Union Load (0.4ms) (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
444
-  (0.1ms) ROLLBACK
445
-  (0.2ms) ROLLBACK
446
-  (0.2ms) BEGIN
447
-  (0.1ms) BEGIN
448
- ----------------------------------------
449
- MigrationTest: test_create_archive_table
450
- ----------------------------------------
451
-  (16.4ms) CREATE TABLE `comments` (`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `author` varchar(255), `body` text) ENGINE=InnoDB
452
-  (11.4ms) CREATE TABLE IF NOT EXISTS `comments_archive` LIKE `comments`
453
-  (10.6ms) DROP TABLE `comments`
454
-  (5.2ms) DROP TABLE `comments_archive`
455
-  (0.1ms) ROLLBACK
456
-  (0.2ms) ROLLBACK
457
-  (0.2ms) BEGIN
458
-  (0.2ms) BEGIN
459
- -------------------------------------------------
460
- MigrationTest: test_ignore_existing_archive_table
461
- -------------------------------------------------
462
-  (11.2ms) CREATE TABLE `comments` (`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `author` varchar(255), `body` text) ENGINE=InnoDB
463
-  (12.8ms) CREATE TABLE IF NOT EXISTS `comments_archive` LIKE `comments`
464
-  (1.4ms) CREATE TABLE IF NOT EXISTS `comments_archive` LIKE `comments`
465
-  (4.7ms) DROP TABLE `comments`
466
-  (5.0ms) DROP TABLE `comments_archive`
467
-  (0.1ms) ROLLBACK
468
-  (0.2ms) ROLLBACK
469
-  (0.1ms) BEGIN
470
-  (0.1ms) BEGIN
471
- -------------------------
472
- ArchivingTest: test_truth
473
- -------------------------
474
-  (0.1ms) ROLLBACK
475
-  (0.1ms) ROLLBACK