Working with the Migration scripts

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Working with the Migration scripts

Dennis Grant
OK, I have determined that, as the first part of my conversion from my
local fork of 4.2.2 to 5.0, that I need a working database conversion

Actually, the first part was importing 5.0.0-rc into Subversion so now I
have proper version control and patch generation - and that's done.

So I'm looking at the scripts in Modules/Migration, and the first thing
I notice is the much greater use of comments in the code - THANK YOU!
This is going to make the transition of my fork back into mainstream
vtiger all that much easier. Bravo Zulu one and all!

I'm seeing references to a migration log file, but nowhere do I see it
printed out - where is the log file supposed to be, and how do I turn on

I'm also seeing code like $this->printLn("something") - where are those
logs going?

One of the places I'm probably running into trouble is that I have
extended some of the stock tables - for example:

mysql> describe quotesproductrel;
| Field      | Type          | Null | Key | Default | Extra |
| quoteid    | int(19)       |      | PRI | 0       |       |
| productid  | int(19)       |      | PRI | 0       |       |
| quantity   | int(19)       | YES  |     | NULL    |       |
| listprice  | decimal(11,3) | YES  |     | NULL    |       |
| dgsequence | int(6)        | YES  |     | NULL    |       |
| dgcomment  | longtext      | YES  |     | NULL    |       |

You'll notice that I have extended the table with two fields:
dgsequence, which captures the order than products were added to the
quote (so they display in the same order that they were added) and
dgcomment, which, if present, prints out above the line item in question
(allows for the creation of subheadings in the quote to form packages)

I notice that in V5, the various *productrel tables are folded into a
single vtiger_inventoryproductrel table - so I need to add my two extra
fields (which I'll probably rename sequence_no and comment) to this

Where is the correct place to add this? I see all sorts of ALTER TABLE
statements in the migration scripts - shouldn't this just be added to
the table creation query in the install process? Why all the ALTER-ing
of tables?


Get started with creating presentations online -