Created
November 10, 2012 00:27
-
-
Save MichaelDrogalis/4049205 to your computer and use it in GitHub Desktop.
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
mysql> describe persons; | |
+--------+---------------+------+-----+---------+-------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+--------+---------------+------+-----+---------+-------+ | |
| name | varchar(32) | YES | | NULL | | | |
| number | int(11) | YES | | NULL | | | |
| money | decimal(10,2) | YES | | NULL | | | |
| about | varchar(50) | YES | | NULL | | | |
| secret | float(10,2) | YES | | NULL | | | |
+--------+---------------+------+-----+---------+-------+ | |
6 rows in set (0.00 sec) | |
mysql> describe pets; | |
+-------+-------------+------+-----+---------+-------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+-------+-------------+------+-----+---------+-------+ | |
| pid | int(11) | YES | | NULL | | | |
| name | varchar(32) | YES | | NULL | | | |
+-------+-------------+------+-----+---------+-------+ | |
2 rows in set (0.00 sec) | |
mysql> describe rooms; | |
+-------+-------------+------+-----+---------+-------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+-------+-------------+------+-----+---------+-------+ | |
| name | varchar(64) | YES | | NULL | | | |
+-------+-------------+------+-----+---------+-------+ |
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
(def db {:vendor :mysql :db "simulation" :user "root" :password ""}) | |
(defseed rooms | |
{:database db :table :rooms :policy :clean-slate} | |
(value-of :name "Mike's room")) | |
(defseed pets | |
{:database db :table :pets} | |
(inherit :pid) | |
(randomized :name {:subtype :first-name})) | |
(defseed people | |
{:database db :table :persons :policy :clean-slate :dependents [:pets] :n 5} | |
(randomized :name {:subtype :full-name}) | |
(randomized :number {:min 50 :max 100 :fk {pets :pid}}) | |
(randomized :money {:min 0.00 :max 100000.00}) | |
(randomized :about {:min 5 :max 10}) | |
(randomized :secret)) | |
(seed-table rooms) | |
(seed-table people) |
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
mysql> select * from persons; | |
+---------------+--------+--------+------------+------+--------------+ | |
| name | number | money | about | salt | secret | | |
+---------------+--------+--------+------------+------+--------------+ | |
| Colin Merrill | 80 | 757.62 | eryshmkr | NULL | -7202698.50 | | |
| Susan Joyce | 76 | 334.05 | uaidh | NULL | 15302256.00 | | |
| Saul Kaufman | 81 | 245.13 | sdqna | NULL | -4928619.00 | | |
| Frank Reeves | 70 | 121.35 | bmshpyri | NULL | -11777705.00 | | |
| Adolfo Hanson | 65 | 342.63 | iqsektiwfx | NULL | 18405868.00 | | |
+---------------+--------+--------+------------+------+--------------+ | |
5 rows in set (0.00 sec) | |
mysql> select * from pets; | |
+------+----------+ | |
| pid | name | | |
+------+----------+ | |
| 80 | Jaxson | | |
| 76 | Ruby | | |
| 81 | Graciela | | |
| 70 | Graciela | | |
| 65 | Javier | | |
+------+----------+ | |
5 rows in set (0.00 sec) | |
mysql> select * from rooms; | |
+-------------+ | |
| name | | |
+-------------+ | |
| Mike's room | | |
+-------------+ | |
1 row in set (0.00 sec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment