<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;Fixtures are used to easily insert values into your database. The most common use for a fixture is to insert example record into your database&lt;/p&gt;
&lt;p&gt;You fixtures the same way you run migrate:&lt;/p&gt;
cake fixtures help
&lt;p&gt;If you wanted to create a fixture for your users table, it would be in the file &lt;code&gt;app/config/fixtures/users.php&lt;/code&gt; and it would look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;---
- 
  user: 
    id: 1
    name: My user!!
    description: foo bar
    created: 2008-11-13 21:03:40
    modified: 2008-11-13 21:03:40
- 
  contests: 
    id: 2
    name: Lorem
    description: Lorem ipsum dolor sit amet, consectetur
    created: 2008-11-13 21:21:39
    modified: 2008-11-13 21:21:39&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you have to reset your database or need to reinsert data for any reason, you can &amp;#8220;dump&amp;#8221; all your current data to fixtures like so:&lt;/p&gt;
cake fixtures g fromdb -force
&lt;p&gt;(The -force option overwrites any existing files in &lt;code&gt;app/config/fixtures&lt;/code&gt;)&lt;/p&gt;
&lt;p&gt;Then you can load them back into the database simply by calling:&lt;/p&gt;
cake fixtures</body>
  <created-at type="datetime">2009-11-23T00:00:52-08:00</created-at>
  <id type="integer">80856</id>
  <permalink>using-fixtures</permalink>
  <repository-id type="integer">70751</repository-id>
  <title>Using Fixtures</title>
  <updated-at type="datetime">2008-11-13T22:13:20-08:00</updated-at>
  <user-id type="integer">32290</user-id>
</wiki>
