From: Fidel S. <fi...@vb...> - 2004-01-21 18:23:32
|
Angel, I am not sure I totally understand your mail because I first want to make sure you understand what I am trying to do. What I want to do is to add a column to a table before installing GUS. That is, I want to add a column to the SQL statement that creates the table (dots-tables.sql:CREATE TABLE DoTS.NAENTRY (). From Chris's and your previous answer nothing will break. By nothing, I understand not the installation and not the parsers. Correct? Thanks Fidel Angel Pizarro <an...@pc...> writes: > BTW, > > I did not mention this, but adding a column in the GUS system is not > completely trivial. Since the default columns are assumed to be at the > end of the column list, and adding a column in most RDBMSs appends to > the column list, you in fact have to create a new temporary table > where the added column precedes the "modification_date". > The added column is usually nullable and thus a select statement is > used to populate the temp table from the old: > > insert into <new_table> (<column list from old table>) select * from > <original_table>; > > If the column is to be non-null, then you have to provide some default > value in the column listing of the select clause of the insert > statement: > > insert into <new_table> (<column list from NEW table>) select <non > default columns from old table>, <default_value>, <GUS default column > list> from <original_table>; > > Then you rename the old/new tables, drop and recreate the constraints > (the constraints will follow the old table as you rename, so if you > don't drop them first or you will have name clashes) and then the > object layer sees the new table definition. I'll release this as GUS > 3.1.1 > > Angel > Angel Pizarro wrote: > >> Adding the column will not break anythiing, although I ask you to >> post a tracker item on the SF.net site. : >> >> http://sourceforge.net/tracker/?atid=479181&group_id=54213&func=browse >> >> Also, please attach the SQL to make that makes the new table, >> transfers the data, apply constraints and rename the tables >> appropriately, etc., to the tracker item. Since you have to do these >> actions regardless, it would be nice to share them as a script ;) >> >> I'll commit the change to CVS when I make the other changes that are >> needed for GUS 3.1 >> >> Angel >> >> Fidel Salas wrote: >> >>> Chris Stoeckert <sto...@pc...> writes: >>> >>> > Hi Fidel, >>> >>> Hi Chris. Thanks for your response. >>> >>> > What are you trying to get from LOCUS? >>> > Here's an example for the kit gene (maybe you can send me a more >>> > relevant one for you). >>> > LOCUS NM_021099 5132 bp mRNA linear ROD 20-DEC-2003 >>> > Is it the "linear" info? >>> >>> Yes, it is the "linear" (or "circular") info. >>> >>> > I agree that NAEntry table would be a good place for this and >>> I would >>> > recommend that the NAEntry table have a "topology" attribute >>> added. >>> > I'm guessing that this information was lost because it's not >>> something >>> > that we at CBIL use. >>> >>> Understood. >>> >>> > My understanding is that nothing should should break by >>> adding this >>> > column but would like others to confirm (Steve? Angel?) >>> >>> It sounds good. >>> >>> Fidel >>> >>> >>> > I also don't think that you would need to add set/get methods just >>> > alter the existing one for NAEntry. >>> > Chris >>> > On Jan 6, 2004, at 11:35 AM, Fidel Salas wrote: >>> > I need help in finding a quick solution to the following >>> requirement. >>> > I need topology information for any given GenBank DNA >>> sequence or >>> > entry. This information is found in the LOCUS line of a GenBank >>> > entry. For reasons unclear to me, the GBParser plugin parses >>> this and >>> > then silently drops it. >>> > Since I am about to create a new GUS database, I would like >>> to add a >>> > column to DoTS:NAEntry that will hold the topology >>> information. The >>> > main question is: will I break anything if I add this column >>> to the >>> > tables sql script? >>> > Also, what is the reason this information is dropped? >>> > I am assuming getting GBParser to populate this new column >>> would >>> > involve just getting the objrelp generator to add set and get >>> methods. >>> > Is this all that would need to be done? >>> > Thanks >>> > Fidel >>> >>>> >>>> >>>> >>> >>> > ------------------------------------------------------- >>> > This SF.net email is sponsored by: IBM Linux Tutorials. >>> > Become an expert in LINUX or just sharpen your skills. Sign >>> up for >>> > IBM's >>> > Free Linux Tutorials. Learn everything from the bash shell to sys >>> > admin. >>> > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click >>> > _______________________________________________ >>> > Gusdev-gusdev mailing list >>> > Gus...@li... >>> > https://lists.sourceforge.net/lists/listinfo/gusdev-gusdev >>> >>> >>> >>> ------------------------------------------------------- >>> The SF.Net email is sponsored by EclipseCon 2004 >>> Premiere Conference on Open Tools Development and Integration >>> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. >>> http://www.eclipsecon.org/osdn >>> _______________________________________________ >>> Gusdev-gusdev mailing list >>> Gus...@li... >>> https://lists.sourceforge.net/lists/listinfo/gusdev-gusdev >>> >> >> >> >> ------------------------------------------------------- >> The SF.Net email is sponsored by EclipseCon 2004 >> Premiere Conference on Open Tools Development and Integration >> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. >> http://www.eclipsecon.org/osdn >> _______________________________________________ >> Gusdev-gusdev mailing list >> Gus...@li... >> https://lists.sourceforge.net/lists/listinfo/gusdev-gusdev |