utf8mb4rails 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/utf8mb4rails.rb +4 -3
- data/lib/utf8mb4rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4954a15b606370a431abdefc253289c341e2d647
|
4
|
+
data.tar.gz: b9a7e416ec58b170053c8e6eccd03ff83730222c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25fae3f7ffadec257d586c7ffa29d5d9a6c744a8743065a4acdfddc6277455283da8f3707d80c52ab2f6424c5356ebb064c3120c008150331c10628ba9ef834f
|
7
|
+
data.tar.gz: 8753f0d26b1b4974c7a4c2bd88d0f3748ed0fa2aac832281d30df941827c0531abc3dae92ab34c86ae893bde23ef6e5a8419cb99e1d6fbc6bebe06474021365a
|
data/README.md
CHANGED
@@ -18,6 +18,10 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
$ gem install utf8mb4rails
|
20
20
|
|
21
|
+
This gem uses [departure](https://github.com/departurerb/departure) a Percona's pt-online-schema-change runner for ActiveRecord migrations.
|
22
|
+
|
23
|
+
You need to have percona tools installed prior to using this gem. See instructions [here](https://github.com/departurerb/departure).
|
24
|
+
|
21
25
|
## Usage
|
22
26
|
|
23
27
|
This gem will add in your rails project a new task called utf8mb4. This tast is aimed to easily convert tables in utf8 into
|
data/lib/utf8mb4rails.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
require 'utf8mb4rails/version'
|
2
2
|
require 'utf8mb4rails/migrator'
|
3
|
-
require 'departure'
|
4
3
|
|
5
|
-
Departure.configure do |_config|; end
|
6
4
|
def usage
|
7
5
|
puts
|
8
6
|
puts 'Usage: '
|
@@ -22,6 +20,9 @@ module Utf8mb4rails
|
|
22
20
|
namespace :db do
|
23
21
|
desc 'migrates a table[/column] (TABLE, COLUMN env vars) to utf8mb encoding'
|
24
22
|
task utf8mb4: :environment do
|
23
|
+
require 'departure'
|
24
|
+
Departure.configure do |_config|; end
|
25
|
+
|
25
26
|
table = ENV['TABLE']
|
26
27
|
unless table
|
27
28
|
puts 'Please specify a table with TABLE='
|
@@ -32,7 +33,7 @@ module Utf8mb4rails
|
|
32
33
|
column = ENV['COLUMN']
|
33
34
|
runner = Migrator::Runner.new
|
34
35
|
if column
|
35
|
-
puts
|
36
|
+
puts "Migrating #{table}.#{column}"
|
36
37
|
runner.migrate_column!(table, column)
|
37
38
|
else
|
38
39
|
puts 'No column specified, will migrate the entire table'
|
data/lib/utf8mb4rails/version.rb
CHANGED