The procedure for adding a table is nicely described in cdfnote 5641. However, if you are left with questions after reading this note, the email exchange below may be helpful (read from the bottom!)
Hi Jack,
thanks for input! We will do as you recommend - Farrukh commits,
Matt checks out, copies and modifies. (Yes, Matt is aware that he needs to
edit the SQL file)
thanks,
Dmitri Litvintsev
P.S.: Matt I think you could cut&paste his exchange to Calibration
home-page so next time someone will ask questions, we will direct
him/her to that page
(although IMHO the note is fine!)
/----------------------------------------------------------\
| Tel: (630) 840 5005 |
| FAX: (630) 840 2968 |
| office: 149-L CDF Trailers |
| E-mail: litvinse@fnal.gov |
\----------------------------------------------------------/
On Mon, 1 Dec 2003, Jack Cranshaw wrote:
> Hi,
>
> For production it is best if Mat recreates the sql file from the java file
> by checking out the package from the head and running codegen. This
> checks that everything is in CVS ok, and there are things that codegen
> doesn't do, so the generated sql needs some tweaking, most specifically
> the tablespaces.
>
> I'm sure Dmitri has bad memories about that particular problem. ;-)
>
> The tweaked generated files then need to go into CalibDBDDL.
> Mat and I still need to sit together and do a 'cut' sometime.
>
> Cheers,
>
> Jack
>
> P.S. I would be happy to be proved wrong if someone has fixed that
> aspect of codegen.
>
> Dmitri Litvintsev wrote:
>
> >Hi Farukh,
> >
> >you should be more positive.....
> >
> >so,
> >
> >1) addpkg -h COTCalibDBTables
> > cd COTCalibDBTables/tables
> > emacs COTBEAML3.java
> >
> > the body of the file should look like:
> >
> > import emitter.Attrib;
> > mport java.io.Serializable;
> >
> > /** @author Farukh and the Gang, 12/01/03 */
> >
> > public class COTBEAML3 extends Attrib implements Serializable
> > {
> > long id;
> > int a;
> > int b;
> > double x
> > double y;
> > double z;
> > double sigma_xx;
> > double sigma_xy;
> >
> > .....
> > public Long cdfNote() { return new Long(6775); }
> >
> > public String rcsId() {
> > return "$Id$";
> > }
> >
> >
> > }
> > cd ../
> > cd ..
> > gmake codegen
> >
> >if OK => commit, else correct, until OK,
> >Let Matt know where the file 'COTBEAML3.sql' or 'COTBEAML3.osql'
> >is.
> >
> >He will do the rest.
> >
> >The point is: you prepare the table, Matt puts it into the schema.
> >(I guess that was the procesure Jack put forward)
> >
> >regards,
> >Dmitri Litvintsev
> >
> >/----------------------------------------------------------\
> >| Tel: (630) 840 5005 |
> >| FAX: (630) 840 2968 |
> >| office: 149-L CDF Trailers |
> >| E-mail: litvinse@fnal.gov |
> >\----------------------------------------------------------/
> >
> >
> >
> >
> >>>>Hi Farrukh,
> >>>>
> >>>>the procedure is described in CDF 5641 (substitute
> >>>>OffCalibDBTables with AlignmentDB)
> >>>>
> >>>>in directory
> >>>>
> >>>> AlignmentDB/tables/
> >>>>
> >>>>create 'java' description of the table (use existing classes
> >>>>as an example)
> >>>>
> >>>>then do :
> >>>>
> >>>> - Do a gmake codegen
> >>>> - Look in the tmp/$BFARCH/ directory for the sql
> >>>>
> >>>>Then, let Matt know that you did it, Matt should fetch the sql file
> >>>>
> >>>>
> >>>>from you and do these:
> >>>
> >>>
> >>>>- Check out CalibDBDDL
> >>>>- cd to the version/V_X_X (just go to the latest one)
> >>>>- Copy the sql from the tmp area to this directory
> >>>>- Compare to another one of the table files, so
> >>>> that you can change pieces that need changing
> >>>>- Run the ddl against integration
> >>>>- Run the ddl against production
> >>>>- Commit the change to CVS
> >>>>
> >>>>Matt should check table/index space names in the DDL file (should be
> >>>>CALIB_SML_DATA I believe)
> >>>>
> >>>>I presumed that David did the Java part.