Skip to content

Instantly share code, notes, and snippets.

@MichaelDrogalis
Created November 6, 2012 03:08
Show Gist options
  • Select an option

  • Save MichaelDrogalis/4022304 to your computer and use it in GitHub Desktop.

Select an option

Save MichaelDrogalis/4022304 to your computer and use it in GitHub Desktop.
mysql> desc persons;
+--------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+-------------+------+-----+---------+-------+
| name | varchar(32) | YES | | NULL | |
| number | int(11) | YES | | NULL | |
+--------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)
mysql> desc pets;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| nickname | varchar(32) | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)
(def db {:vendor :mysql :db "simulation" :user "root" :password ""}
(seed-table
{:database db :table :people :policy :clean-slate :n 50}
(seed
(randomized :name)
(randomized :number)
(fk
{:table :pets}
(inherit :id :from :number)
(randomized :nickname))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment