Skip to content

Instantly share code, notes, and snippets.

@ihatov08
Created December 26, 2018 03:10
Show Gist options
  • Save ihatov08/e7ac8df435d3c2be00851c35381d0757 to your computer and use it in GitHub Desktop.
Save ihatov08/e7ac8df435d3c2be00851c35381d0757 to your computer and use it in GitHub Desktop.
userを作成するSQLを大量作成するスクリプト
base_sql = ->(prefix) { %(INSERT INTO "users" ("email", "encrypted_password", "created_at", "updated_at", "prefecture_code", "newly_hired_year", "confirmation_token", "confirmation_sent_at", "information_updated_at", "nurse_license_number") VALUES ('raw_sql_test_#{prefix}@gmail.com', '$2a$10$.nem4Wlxbur4nXpxpC3EJuJXbS/LOYJVomyHyAbxLPDw2UPYN29G.', NOW(), NOW(), 3, 1951, '#{prefix}_eth46u5ejrs', NOW(), NOW(), '53479ty93');) }
File.open("users.sql", "w") do |f|
2_000_000.times do |i|
f.puts base_sql.(i)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment