Creating tables - migrating from MySQL.
2014-01-21 14:09:39 GMT
Hi all, I'm trying to migrate a system (72 tables) from MySQL to Apache. I've looked at the docco here http://db.apache.org/derby/docs/10.0/manuals/reference/sqlj27.html#CREATE+TABLE+statement, but it isn't readily apparent to me how to create INDEXES within the CREATE TABLE statement. I'd rather not have to manually perform this procedure - a sample might help. CREATE TABLE analysis ( analysis_id smallint(5) unsigned NOT NULL AUTO_INCREMENT, created datetime NOT NULL DEFAULT '0000-00-00 00:00:00', logic_name varchar(128) NOT NULL, db varchar(120) DEFAULT NULL, PRIMARY KEY (analysis_id), UNIQUE KEY logic_name_idx (logic_name), KEY db_idx (db) ); Tried this through ij and it failed. What do I have to substitute for "PRIMARY KEY", "UNIQUE KEY" and "KEY" in the CREATE TABLE statement (I'll either use sed/awk/vi/ or Java eventually) - or do I have to create the PRIMARY KEY and other KEYs outside of the main CREATE TABLE statement? I did try doing this automatically using SQuirrel SQL, but there are(Continue reading)