clickhouse-activerecord 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e5a31d2ddff53bb618e1624e325c0be76f2f602655565a74a96106674f3a375e
|
|
4
|
+
data.tar.gz: 762b41c929d36e7ff0f0ceff557da5b85d0b231e8df3e6c6bd41b6085eb940b0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a6f8143c312efbc6f276b0fdc2b9e5ea8ab811f06a865d54ff82dcaa0614c30b26c44f65f60098f0895dcf935aa97c86e8b168e7e1bc5b7e54899662b71ad86a
|
|
7
|
+
data.tar.gz: d9f4ba22a3f13bd157a225870e4d5eb025ca6a35ac21dc73731c19a8bb0d7464e479479109007d117d29f1aa788bb2f3cd5ae0350f1fa13596c36da3ed99a766
|
|
@@ -68,10 +68,9 @@ module ActiveRecord
|
|
|
68
68
|
|
|
69
69
|
if options[:precision]
|
|
70
70
|
kind = :datetime64
|
|
71
|
-
options[:value] = options[:precision]
|
|
72
71
|
end
|
|
73
72
|
|
|
74
|
-
args.each { |name| column(name, kind, **options
|
|
73
|
+
args.each { |name| column(name, kind, **options) }
|
|
75
74
|
end
|
|
76
75
|
|
|
77
76
|
def uuid(*args, **options)
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module ClickhouseActiverecord
|
|
4
|
-
|
|
5
4
|
class Schema < ::ActiveRecord::Schema
|
|
6
5
|
|
|
7
|
-
def define(info, &block) # :nodoc:
|
|
8
|
-
instance_eval(&block)
|
|
9
|
-
|
|
10
|
-
if info[:version].present?
|
|
11
|
-
connection.schema_migration.create_table
|
|
12
|
-
connection.assume_migrated_upto_version(info[:version], ClickhouseActiverecord::Migrator.migrations_paths)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
ClickhouseActiverecord::InternalMetadata.create_table
|
|
16
|
-
ClickhouseActiverecord::InternalMetadata[:environment] = connection.migration_context.current_environment
|
|
17
|
-
end
|
|
18
6
|
end
|
|
19
7
|
end
|
data/lib/tasks/clickhouse.rake
CHANGED
|
@@ -14,9 +14,10 @@ namespace :clickhouse do
|
|
|
14
14
|
namespace :schema do
|
|
15
15
|
# TODO: not testing
|
|
16
16
|
desc 'Load database schema'
|
|
17
|
-
task load: %i[
|
|
17
|
+
task load: %i[prepare_internal_metadata_table] do
|
|
18
18
|
simple = ENV['simple'] || ARGV.any? { |a| a.include?('--simple') } ? '_simple' : nil
|
|
19
|
-
|
|
19
|
+
config = ActiveRecord::Base.configurations.configs_for(env_name: Rails.env, name: 'clickhouse')
|
|
20
|
+
ClickhouseActiverecord::SchemaMigration.new(ActiveRecord::Base.establish_connection(config).connection).drop_table
|
|
20
21
|
load(Rails.root.join("db/clickhouse_schema#{simple}.rb"))
|
|
21
22
|
end
|
|
22
23
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: clickhouse-activerecord
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sergey Odintsov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-01-
|
|
11
|
+
date: 2024-01-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|