How to create a table if not exists?

Dear All

how to create a table if not exists already?
how can i check that whether the table exists or not?

pls guide me on this

Hi

    You will get table names for your environment with

ActiveRecord::Base.connection.tables

Sijo K George

Newb N. wrote:

Dear All

how to create a table if not exists already?
how can i check that whether the table exists or not?

pls guide me on this

Generally speaking, you shouldn’t need to do this at all. In most
cases, the only time you should create tables is in migrations, and
Rails takes care of the logic in there.

Why do you think you need to check whether a table exists? What are you
trying to achieve?

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]