Small G2 change in CVS

baschny
baschny's picture

Joined: 2003-01-04
Posts: 328
Posted: Wed, 2003-03-05 19:54

Hi!

I just checked in a change into the current G2-CVS where the file extension is not saved as a separate member anymore.

If anyone is using bleeding-edge code, it probably won't work as expected anymore without reinitializing the whole database.

If you have some photo-tree that he would like continue to use you can try (at your own risk) the following SQL-statement (valid only with MySQL) to change your current schema to the new one:

SELECT g2_GalleryFileSystemEntity.g_id as g_id,
IFNULL(CONCAT(g2_GalleryFileSystemEntity.g_pathComponent,'.', g2_GalleryDataItem.g_fileExtension),
g2_GalleryFileSystemEntity.g_pathComponent) AS g_pathComponent
INTO OUTFILE '/tmp/g2.sql'
FROM g2_GalleryFileSystemEntity
LEFT JOIN g2_GalleryDataItem ON g2_GalleryDataItem.g_id = g2_GalleryFileSystemEntity.g_id;

DELETE FROM g2_GalleryFileSystemEntity;

LOAD DATA INFILE '/tmp/g2.sql' INTO TABLE g2_GalleryFileSystemEntity;

ALTER TABLE g2_GalleryDataItem DROP COLUMN g_fileExtension;