schema-tools 1.0.1 → 1.0.3
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 +4 -4
- data/README.md +12 -0
- data/lib/schema_tools/new_alias.rb +0 -5
- data/lib/schema_tools/railtie.rb +10 -0
- data/lib/schema_tools/rake_tasks.rb +7 -7
- data/lib/schema_tools.rb +9 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b0a1829a0042b9d9e031af29d3684bb90a52af86943de3b12b95f55c8c0ac0b
|
4
|
+
data.tar.gz: 4b6675502d201d507ba404becfd2f310278abb6bf5f00751916d56a5a65a1708
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3306dea2eb57653f934bc9f18c6cf646bc12f2a2dfb55b905b899f69fefb84381d074486cc3c6bad865b73b353dd5b1e1059c117b36f9ba62533ae69f76f0e3c
|
7
|
+
data.tar.gz: 120bf4d22a5f50b5c68e9830aa0b900e089cdf11883480c2448216906ca79b4351bd318c31e59d2e77d770a25081cc736dfcd59cc17eac1b5a744f0116be6831
|
data/README.md
CHANGED
@@ -15,6 +15,12 @@ Install this Ruby gem.
|
|
15
15
|
gem install schema-tools
|
16
16
|
```
|
17
17
|
|
18
|
+
Add (or edit) a file called `Rakefile` and add this line:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
require 'schema_tools'
|
22
|
+
```
|
23
|
+
|
18
24
|
### Configuration
|
19
25
|
|
20
26
|
Set the connection URL for your OpenSearch or Elasticsearch instance:
|
@@ -35,6 +41,12 @@ export OPENSEARCH_USERNAME=your_username
|
|
35
41
|
export OPENSEARCH_PASSWORD=your_password
|
36
42
|
```
|
37
43
|
|
44
|
+
### View available rake tasks
|
45
|
+
|
46
|
+
```sh
|
47
|
+
rake -T | grep " schema:"
|
48
|
+
```
|
49
|
+
|
38
50
|
### Download an existing schema
|
39
51
|
|
40
52
|
Run `rake schema:download` to download a schema from an existing alias or index:
|
@@ -6,11 +6,6 @@ require_relative 'settings_filter'
|
|
6
6
|
|
7
7
|
module SchemaTools
|
8
8
|
def self.new_alias(client:)
|
9
|
-
puts "Warning: This tool only supports migrating aliases."
|
10
|
-
puts "Create an alias for this index by running:"
|
11
|
-
puts "rake schema:alias"
|
12
|
-
puts "\nDownload this index schema anyway? Y/n"
|
13
|
-
|
14
9
|
choice = STDIN.gets&.chomp&.downcase
|
15
10
|
if choice.nil? || choice.empty? || choice == 'y' || choice == 'yes'
|
16
11
|
# User wants to proceed with creating a new alias
|
@@ -3,13 +3,13 @@ require 'rake/tasklib'
|
|
3
3
|
|
4
4
|
module SchemaTools
|
5
5
|
module RakeTasks
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
def self.load_tasks
|
7
|
+
# Only load schema.rake, not test.rake which requires development dependencies
|
8
|
+
schema_rake_file = File.join(File.dirname(__FILE__), '..', 'tasks', 'schema.rake')
|
9
|
+
load schema_rake_file if File.exist?(schema_rake_file)
|
10
|
+
end
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
#
|
15
|
-
SchemaTools::RakeTasks.load_tasks
|
14
|
+
# Tasks are loaded automatically in Rails apps via Railtie
|
15
|
+
# For non-Rails usage, call SchemaTools::RakeTasks.load_tasks manually
|
data/lib/schema_tools.rb
CHANGED
@@ -1 +1,9 @@
|
|
1
|
-
require 'schema_tools/rake_tasks'
|
1
|
+
require 'schema_tools/rake_tasks'
|
2
|
+
|
3
|
+
# Load Railtie for automatic rake task loading in Rails apps
|
4
|
+
if defined?(Rails)
|
5
|
+
require 'schema_tools/railtie'
|
6
|
+
else
|
7
|
+
# For non-Rails usage, load tasks immediately
|
8
|
+
SchemaTools::RakeTasks.load_tasks
|
9
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rich Kuzsma
|
@@ -157,6 +157,7 @@ files:
|
|
157
157
|
- lib/schema_tools/painless_scripts_delete.rb
|
158
158
|
- lib/schema_tools/painless_scripts_download.rb
|
159
159
|
- lib/schema_tools/painless_scripts_upload.rb
|
160
|
+
- lib/schema_tools/railtie.rb
|
160
161
|
- lib/schema_tools/rake_tasks.rb
|
161
162
|
- lib/schema_tools/schema_files.rb
|
162
163
|
- lib/schema_tools/seed.rb
|