cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Handling database creation and migration
Date Wed, 21 Dec 2011 20:02:38 GMT
I am checking my migrations archive, and "Cayenne-friendly" schema alterations or simple INSERT/UPDATE/DELETE
make up probably 50% of those. The rest are things like these:

(1)

LOAD DATA LOCAL INFILE './patches-5.0/some.csv' INTO TABLE some_table 
 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' (C1,C2,C3);


(2)

SET unique_checks=0;

ALTER TABLE t1 DROP INDEX keyword_index;
ALTER TABLE t1 DROP INDEX headline_index;
ALTER TABLE t1 ENGINE=InnoDB;

SET unique_checks=1;

(3)

set @AAA = (select max(ID) from nhldb.xxx);
insert into nhldb.xxx (ID, NAME, DESCRIPTION, URL)
values((@AAA+1), 's1', 's2', 's3');

So how would those be handled if we are to go this route?

Andrus
Mime
View raw message