[freeside-devel] Documentation

ivan at 420.am ivan at 420.am
Mon Oct 20 19:57:29 PDT 2003


On Mon, Oct 20, 2003 at 03:08:53PM +1000, Systems Administrator wrote:
> On Sun, 19 Oct 2003 ivan at 420.am wrote:
> 
> > tablename.pm modules can declare their schema information in a variable,
> > like their "table" subroutine, or as a (package) global.
> 
> 	Ok, I'm fine with that.  Does that mean that the new fs_setup will 
> use all the tablename.pm modules?  

fs-setup is 1.4 and is not being used.  freeside-setup is 1.5 and is
what would be modified here.

Search for and use, yes.  Anything all-lowercase is a database class.

> > > 2.	Aside from how we encapsulate it (ie. 1 above), what would you 
> > > 	prefer here?  Perl data structures?  SQL?  Something that works 
> > > 	with POD?  Or some non-standard entirely new thing?  Or something 
> > > 	else that I'm unaware of?  HTML?  XML?  
> > 
> > "Perl data structures".  Take a look at DBIx::DBSchema.  pretty_print
> > and pretty_read are close, but probably need to use a hashref for each
> > column instead of throwing six elements for each column into a giant
> > array, and also need to be factored down into DBSchema/Table.pm so we
> > can work with a structure for an individual table, not just for the
> > whole schema.
> 
> 	So, roughly, in agent::table, you'd have something like:

Yup.

> foreach $field(@$schema->columns) {
> 	if(! defined($field->length)) { $field->length = 80; }
> }

I'd forget this, though, and specify lengths explicitly like we do now.

> 	Also, did you have anywhere where you wanted the links between the 
> tables documented?

It wouldn't be a bad idea to make foreign key relationships available.

>  And are you using PostgreSQL's views anywhere?  

No, we're still working under the delusion that MySQL could be
supported again someday (not that anyone has done any work on it in
ages).

-- 
_ivan



More information about the freeside-devel mailing list