Created
March 29, 2021 00:35
-
-
Save PJZ9n/0a446b04f8812ca0d295b47755a1b751 to your computer and use it in GitHub Desktop.
サーバーID一覧データから当てはまらないものはサスペンドする
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "csv" | |
sql = 'UPDATE servers SET status="suspended" WHERE status IS NULL' | |
CSV.foreach("test.csv") do |row| | |
sql += ' AND NOT uuidShort="' + row[0] + '"' | |
end | |
puts sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment