[Rt-devel] generator script
Jesse Vincent
jesse at bestpractical.com
Wed Jul 4 10:04:05 EDT 2007
On Jul 1, 2007, at 7:48 PM, Otto Hirr wrote:
>>> I am looking for the script which 'Autogenerates' the files in lib/
>>> RT like User.pm. What data file is being used for its input?
>>
>> you want sbin/factory in your RT distribution
>
> sbin/factory slurps from a mysql db instance of rt.
>
> So do I assume correctly that the schema design process is to make a
> change to a db containing an instance of rt, then rev-engr the db
> via some tool to make the schema.mysql?
>
> What I'm seeking is "what is the master" for the db schema?
The MySQL schema files are used as the master for generating the base
RT model classes.
>>> Also what script is used to generate the various schemas in etc? At
>>> the top of schema.Pg, I see 'My2Pg 1.23 translated dump' (for
>>> version
>>> rt-3.6.3).
>>
>> I believe that refers to a program called My2Pg version 1.23 that
>> translates MySQL schemas to Pg schemas. It has since been tweaked.
>
> 'since been tweaked' ... what do you mean, like hand edits?
Yes. Sometime, possibly 5 years ago, my2pg was used to create a first
stub version of the postgres schema. Since that time, all schema
files are handcrafted. We've found at least a few cases where we
really want different column types on different platforms.
>
>>> What are the others using? or is it by hand? Has anyone tried
>>> SQL::Translator?
>>
>> using for what?
>
> In the ideal world it would seem that there would be a master
> definition of the database, say in a neutral format like one used
> for SQL::Translator.
Have a look at what we're doing with Jifty and Jifty::DBI. That's
likely the direction we'll end up going with RT as we port oto Jifty.
>
> Another question, are the constraints, as found in constraints.mysql,
> an optional item?
They are. Referential integrity is enforced at the application layer.
(And in some cases, we do things like multi-column foreign keys
pointing to different tables which you can't do with sql-level
constraints)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.bestpractical.com/pipermail/rt-devel/attachments/20070704/9760c7a6/PGP.pgp
More information about the Rt-devel
mailing list