Hey WOFriends - I may just have come across an area where the WebObjects API is not flexible enough. I'm so close to finishing a plugin for Firebird that will allow us to "Synchronize Schema". Really! I can see the option available in EOModeler now and it works...almost! This stumbling block I'm at may be impossible to get over. From what I can tell, "RENAME TABLE" syntax is not standard syntax; however, many databases support it. Firebird is not one of them. What I need is this: public NSArray statementsToRenameTableNamed(String s, String s1, NSDictionary nsdictionary) { return new NSArray(_expressionForString("rename table " + s + " to " + s1)); } Scratching my head, I tried a syntax that works in MySQL but fails in Firebird (again, probably not standard SQL): create table NEW_PERSON select * from PERSON; I thought, if the above worked, I could then immediately afterwards delete the original table. I'm running out of ideas WOFriends... and we're so close. Seems like just about everything else is working. Here is a sample output of the "Synchronize Schema" command I currently have: alter table PERSON_COMPANY drop constraint PERSON_COMPANY_company_FK alter table PERSON_COMPANY drop constraint PERSON_COMPANY_person_FK drop table EO_PK_TABLE alter table PERSON drop constraint PERSON_PK rename table PERSON to EO_OLD_PERSON CREATE table PERSON (FIRST_NAME VARCHAR(255) NOT NULL, ID BIGINT NOT NULL, LAST_NAME VARCHAR(255) NOT NULL, START_DATE DATE, TITLE VARCHAR(255)) insert into PERSON (FIRST_NAME, ID, LAST_NAME, TITLE) select FIRST_NAME, ID, LAST_NAME, TITLE from EO_OLD_PERSON drop table EO_OLD_PERSON /* The 'Create Primary Key Support' option is unavailable. */ alter table PERSON add constraint PERSON_PK primary key (ID) alter table PERSON_COMPANY add constraint PERSON_COMPANY_person_FK foreign key (PERSON_ID) references PERSON (ID) alter table PERSON_COMPANY add constraint PERSON_COMPANY_company_FK foreign key (COMPANY_ID) references COMPANY (ID) -- Aaron |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]
