Created
December 26, 2018 03:10
-
-
Save ihatov08/e7ac8df435d3c2be00851c35381d0757 to your computer and use it in GitHub Desktop.
userを作成するSQLを大量作成するスクリプト
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
| 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