Skip to content

Instantly share code, notes, and snippets.

View samflores's full-sized avatar
🦕

Samuel Flores samflores

🦕
View GitHub Profile
{
"took": 316,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
{"took":28,"timed_out":false,"_shards":{"total":5,"successful":5,"skipped":0,"failed":0},"hits":{"total":46,"max_score":6.978977,"hits":[{"_shard":"[sales_beta_1555455616][0]","_node":"JWxHCo0YTOup-EXSYlUNAA","_index":"sales_beta_1555455616","_type":"sale","_id":"16900","_score":6.978977,"_source":{"name":"NordVPN: 3-Yr Subscription","id":16900,"title":"This Double-Encrypted VPN Received an Outstanding Rating From PC Mag","products":[{"name":"NordVPN: 3-Yr Subscription"}]},"_explanation":{"value":6.9789777,"description":"sum of:","details":[{"value":6.9789777,"description":"max of:","details":[{"value":6.9789777,"description":"sum of:","details":[{"value":6.9789777,"description":"weight(name:nord in 13370) [PerFieldSimilarity], result of:","details":[{"value":6.9789777,"description":"score(doc=13370,freq=1.0 = termFreq=1.0\n), product of:","details":[{"value":6.3537903,"description":"idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:","details":[{"value":1.0,"description":"docFreq","
{
"took": 28,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
{
"took": 313,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
#!/bin/zsh
local parts=("${(@s/:/)1}")
if [ -z ${parts[2]} ]; then
cat ${parts[1]}
else
tail --lines="+${parts[2]}" ${parts[1]}
fi
I, [2019-06-19T10:44:28.582763 #171] INFO -- : Migrating to UpdateDatabaseCharset (20190612150412)
== 20190612150412 UpdateDatabaseCharset: migrating ============================
-- execute("SET NAMES utf8mb4;")
D, [2019-06-19T10:44:28.583903 #171] DEBUG -- : (0.2ms) SET NAMES utf8mb4;
-> 0.0003s
-- execute("ALTER DATABASE `stacksocial_development` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;")
D, [2019-06-19T10:44:28.584379 #171] DEBUG -- : (0.3ms) ALTER DATABASE `stacksocial_development` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-> 0.0004s
-- Unable to convert `orders`.`first_name` because it's part of a composite index
-- Unable to convert `orders`.`last_name` because it's part of a composite index
db = ActiveRecord::Base.connection
puts '#!/bin/bash'
puts ""
puts "COMMAND='dry-run'"
puts ""
db_conversion = "CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
puts "pt-online-schema-change -uroot --alter '#{db_conversion}' D=#{db.current_database} --chunk-size=10k --critical-load Threads_running=200 --set-vars innodb_lock_wait_timeout=2 --alter-foreign-keys-method=auto --$COMMAND"
#!/bin/bash
COMMAND='dry-run'
pt-online-schema-change -uroot --alter 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;' D=stacksocial_development --chunk-size=10k --critical-load Threads_running=200 --set-vars innodb_lock_wait_timeout=2 --alter-foreign-keys-method=auto --$COMMAND
# actions
pt-online-schema-change -uroot --alter 'ROW_FORMAT=DYNAMIC CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci' D=stacksocial_development,t=actions --chunk-size=10k --critical-load Threads_running=200 --set-vars innodb_lock_wait_timeout=2 --alter-foreign-keys-method=auto --$COMMAND
pt-online-schema-change -uroot --alter 'MODIFY `type` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci' D=stacksocial_development,t=actions --chunk-size=10k --critical-load Threads_running=200 --set-vars innodb_lock_wait_timeout=2 --alter-foreign-keys-method=auto --$COMMAND
# actions_sales
> heroku run -a stack-api-beta-pr-905 rake data:migrate VERSION=20190527114250 6353-merge-elearn-and-academy-verticals = ~api
Running rake data:migrate VERSION=20190527114250 on ⬢ stack-api-beta-pr-905... up, run.6170 (Standard-1X)
W, [2019-05-31T09:36:28.409440 #4] WARN -- sentry: ** [Raven] You are running on Heroku but haven't enabled Dyno Metadata. For Sentry's release detection to work correctly, please run `heroku labs:enable runtime-dyno-metadata`
I, [2019-05-31T09:36:29.373802 #4] INFO -- : Raven 2.7.4 ready to catch errors
D, [2019-05-31T09:36:31.515062 #4] DEBUG -- : (1.5ms) SET NAMES utf8, @@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
D, [2019-05-31T09:36:31.524810 #4] DEBUG -- : DataMigrate::DataSchemaMigration Load (1.2ms) SELECT `data_migrations`.* FROM `data_migrations`
D, [2019-05-31T09:36:31.557123 #4] DEBUG -- : DataM