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: d56a19e32a58184c6c70b4cc56f30f4e7f742255a9f63441ce8c9b94ec63eebf
4
- data.tar.gz: 2bd423580e61443e1b334e2182e4a05a7e712d79141ae6431730edcdc5dee7e3
3
+ metadata.gz: e5a31d2ddff53bb618e1624e325c0be76f2f602655565a74a96106674f3a375e
4
+ data.tar.gz: 762b41c929d36e7ff0f0ceff557da5b85d0b231e8df3e6c6bd41b6085eb940b0
5
5
  SHA512:
6
- metadata.gz: 17a5a009eb6ece2d6835f5c37598891bde51fb4cf6c6e7ccb8fdc02cf9b1345d822e39d0f3d825b593606180db020357f4828e89f0c9c4cdf8352349ad6f4104
7
- data.tar.gz: edc694713807b818d8f2e9c0b6a0592e0a3862a6b064d4110d12d82ebc1cb40133f7495e9e665007f91f0da5223d129ed110387f4922bf4de710729f462d4509
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.except(:precision)) }
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
@@ -1,3 +1,3 @@
1
1
  module ClickhouseActiverecord
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
@@ -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[load_config prepare_internal_metadata_table] do
17
+ task load: %i[prepare_internal_metadata_table] do
18
18
  simple = ENV['simple'] || ARGV.any? { |a| a.include?('--simple') } ? '_simple' : nil
19
- ClickhouseActiverecord::SchemaMigration.drop_table
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.1
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-10 00:00:00.000000000 Z
11
+ date: 2024-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler