# Querying Rails 4 Table & Field list

**URL:** <https://www.ruby-forum.com/t/querying-rails-4-table-field-list/126369>\
**Category:** Rails\
**Created:** [January 17, 2008, 7:42pm UTC](https://www.ruby-forum.com/t/querying-rails-4-table-field-list/126369 "2008-01-17T19:42:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptremblett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Post date:** [January 17, 2008, 7:42pm UTC](https://www.ruby-forum.com/t/querying-rails-4-table-field-list/126369/1 "2008-01-17T19:42:31Z")

</div>

I’ve been experimenting with migrations-- forward and back. Sometimes…  
I forget where I am in a series of migration steps.

I know I can open the database with a mySQL utility to see which fields  
exist and which don’t. I use the free EMS SQL Manager Lite 2005.

But…

Is there some way, to query Rails and get complete list of tables and  
fields?

If scaffolding can read a database and build a controller and views,  
then there must be some way to simply query the db and get a list of  
tables, OR at least field list of from a single table.

---

<div class="post-metadata">

**Author:** ![ptremblett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Post date:** [January 17, 2008, 7:50pm UTC](https://www.ruby-forum.com/t/querying-rails-4-table-field-list/126369/2 "2008-01-17T19:50:59Z")

</div>

You could run ‘rake db:version’ or look at the schema.rb file.

On Jan 17, 6:42 pm, Paul T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
