# Should the "schema migrations" table have more than one row?

**URL:** <https://www.ruby-forum.com/t/should-the-schema-migrations-table-have-more-than-one-row/155646>\
**Category:** Rails\
**Created:** [December 15, 2008, 8:18am UTC](https://www.ruby-forum.com/t/should-the-schema-migrations-table-have-more-than-one-row/155646 "2008-12-15T08:18:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [December 15, 2008, 8:18am UTC](https://www.ruby-forum.com/t/should-the-schema-migrations-table-have-more-than-one-row/155646/1 "2008-12-15T08:18:45Z")

</div>

Hi,

Should the “schema migrations” table have more than one row??? If yes  
how  
do you know what the current version is supposed to be?

I noted mine looks like the following. Is this a problem?

mysql\> select \* from schema\_migrations;  
±---------------+  
| version |  
±---------------+  
| 1 |  
| 10 |  
| 11 |  
| 2 |  
| 20080817031054 |  
| 20080817031553 |  
| 20080817035257 |  
| 20080817040006 |  
| 20080825042400 |  
| 20080825042409 |  
| 20080827041506 |  
| 20080827233612 |  
| 20080827234249 |  
| 20080828013624 |  
| 20080828023952 |  
| 20080828202412 |  
| 20080829003635 |  
| 20080829053140 |  
| 20080829234813 |  
| 20080831231657 |  
| 20080902000944 |  
| 20080909023613 |  
| 20080909031013 |  
| 20080929084759 |  
| 20080930224956 |  
| 20081101104047 |  
| 20081101111721 |  
| 20081102025337 |  
| 20081105225128 |  
| 20081110083640 |  
| 20081115064924 |  
| 20081128103504 |  
| 20081128104846 |  
| 3 |  
| 4 |  
| 5 |  
| 6 |  
| 7 |  
| 8 |  
| 9 |  
±---------------+  
40 rows in set (0.01 sec)

thanks

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [December 15, 2008, 8:36am UTC](https://www.ruby-forum.com/t/should-the-schema-migrations-table-have-more-than-one-row/155646/2 "2008-12-15T08:36:54Z")

</div>

I’m guessing that it needs to keep the whole list of migration versions  
given there’s been a change in the way migration version naming are  
created. So in this case Rails would check to see for each migration,  
whether there is already an entry in the “schema\_migrations” table, and  
if  
there is it would assume the migration has been applied.

Is this correct?

On Mon, Dec 15, 2008 at 5:18 PM, Greg H. \<

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [December 15, 2008, 10:01am UTC](https://www.ruby-forum.com/t/should-the-schema-migrations-table-have-more-than-one-row/155646/3 "2008-12-15T10:01:47Z")

</div>

On Mon, Dec 15, 2008 at 6:36 PM, Greg H. \<  
removed\_email\_address@domain.invalid\> wrote:

> I’m guessing that it needs to keep the whole list of migration versions  
> given there’s been a change in the way migration version naming are  
> created. So in this case Rails would check to see for each migration,  
> whether there is already an entry in the “schema\_migrations” table, and if  
> there is it would assume the migration has been applied.
> 
> Is this correct?

Yes, you are correct.
