# DROP INDEX ....

**URL:** <https://discuss.rubyonrails.org/t/drop-index/27931>\
**Category:** rubyonrails-talk\
**Created:** [April 13, 2008, 9:17am UTC](https://discuss.rubyonrails.org/t/drop-index/27931 "2008-04-13T09:17:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erwin1](https://avatars.discourse-cdn.com/v4/letter/e/d07c76/32.png) [@Erwin1](https://discuss.rubyonrails.org/u/Erwin1)\
**Post date:** [April 13, 2008, 9:17am UTC](https://discuss.rubyonrails.org/t/drop-index/27931/1 "2008-04-13T09:17:29Z")

</div>

Hello

In my migration, I created index as follows: &nbsp;&nbsp;def self.up &nbsp;&nbsp;&nbsp;&nbsp;add\_index :users, :facebook\_id &nbsp;&nbsp;&nbsp;&nbsp;add\_index :references, [:referencing\_user\_id, :created\_at] .... and

&nbsp;&nbsp;def self.down &nbsp;&nbsp;&nbsp;&nbsp;remove\_index :users, :facebook\_id &nbsp;&nbsp;&nbsp;&nbsp;remove\_index :references, [:referencing\_user\_id, :created\_at]

working fine when creating ..

== 7 AddIndexes: migrating

---

<div class="post-metadata">

**Author:** ![Frederick\_Cheung](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/frederick_cheung/32/3901_2.png) [@Frederick\_Cheung](https://discuss.rubyonrails.org/u/Frederick_Cheung)\
**Post date:** [April 13, 2008, 10:57am UTC](https://discuss.rubyonrails.org/t/drop-index/27931/2 "2008-04-13T10:57:35Z")

</div>

> Hello
> 
> In my migration, I created index as follows: def self.up &nbsp;&nbsp;&nbsp;add\_index :users, :facebook\_id &nbsp;&nbsp;&nbsp;add\_index :references, [:referencing\_user\_id, :created\_at] .... and
> 
> def self.down &nbsp;&nbsp;&nbsp;remove\_index :users, :facebook\_id &nbsp;&nbsp;&nbsp;remove\_index :references, [:referencing\_user\_id, :created\_at]

The bad thing here seems to be that rails should be quoting that table name. The easiest way would probably to write out the sql statement yourself.

Fred
