2

I search PHP library that gets "CREATE TABLE" query and returns difference if this table already exists For example I have table "table1"

id (int11) | name (varchar64)
----------------------------

Then I parse query:

CREATE TABLE table1 id int(11), name varchar(255), description text

And parser returns 2 queries:

ALTER TABLE table1 CHANGE name name varchar(255)
ALTER TABLE table1 ADD description text

Can you advise me php library that can do it?

Ildar
  • 798
  • 2
  • 14
  • 35
  • You can do this yourself too very easily. You wouldn't need to have a big API for that. Try to look into functionalities like `DESCRIBE` `EXPLAIN` etc. You can then match the *creation* vs the *alteration* that you want. –  May 08 '13 at 05:35

1 Answers1

0

You might consider Doctrine Migrations or one of the other scads of migrations libraries.

Google for php migrations library.

quickshiftin
  • 66,362
  • 10
  • 68
  • 89