Thread: Some wayfor checking/updating database/table structure?

Some wayfor checking/updating database/table structure?

From
Libor Vanek
Date:
Hi,
I'm looking for some way which could enable me to say:
- I have database DB_foo
- in this database is table T_bar
- table T_bar has got columns desc with text type and num with integer
type and default value 10

And if there is for example in T_bar only column "desc" I want to add
column "num".

Is there some simple way of doing this or must I always list
tables/columns and manualy check it? I imagine something like:

ALTER TABLE T_bar ADD COLUMN desc text IF NOT EXISTS;



Thanks for comments,
Libor