# Test-db on SQLite: getting "index xx already exists" error

**URL:** <https://www.ruby-forum.com/t/test-db-on-sqlite-getting-index-xx-already-exists-error/122232>\
**Category:** Rails\
**Created:** [December 5, 2007, 7:10pm UTC](https://www.ruby-forum.com/t/test-db-on-sqlite-getting-index-xx-already-exists-error/122232 "2007-12-05T19:10:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [December 5, 2007, 7:10pm UTC](https://www.ruby-forum.com/t/test-db-on-sqlite-getting-index-xx-already-exists-error/122232/1 "2007-12-05T19:10:10Z")

</div>

Hi all

I wanted to speed up my tests, so I changed my test environment from  
MySQL to SQLite. I’m on OSX 10.4 so SQLite3 is already installed.

I changed the test env to the following:

SQLite3::SQLException: index name\_unique already exists: CREATE UNIQUE  
INDEX “name\_unique” ON link\_categories (“name”)

But after running rake db:test:prepare I got the following error:

SQLite3::SQLException: index name\_unique already exists: CREATE UNIQUE  
INDEX “name\_unique” ON link\_categories (“name”)

After changing back to MySQL everything worked again. What’s wrong  
here?!

Thanks  
Josh
