Initial revision
[freeside.git] / htdocs / docs / man / dbdef.txt
1 NAME
2     FS::dbdef - Database objects
3
4 SYNOPSIS
5       use FS::dbdef;
6
7       $dbdef = new FS::dbdef (@dbdef_table_objects);
8       $dbdef = load FS::dbdef "filename";
9
10       $dbdef->save("filename");
11
12       $dbdef->addtable($dbdef_table_object);
13
14       @table_names = $dbdef->tables;
15
16       $FS_dbdef_table_object = $dbdef->table;
17
18 DESCRIPTION
19     FS::dbdef objects are collections of FS::dbdef_table objects and
20     represnt a database (a collection of tables).
21
22 METHODS
23     new TABLE, TABLE, ...
24         Creates a new FS::dbdef object
25
26     load FILENAME
27         Loads an FS::dbdef object from a file.
28
29     save FILENAME
30         Saves an FS::dbdef object to a file.
31
32     addtable TABLE
33         Adds this FS::dbdef_table object.
34
35     tables
36         Returns the names of all tables.
37
38     table TABLENAME
39         Returns the named FS::dbdef_table object.
40
41 BUGS
42         Each FS::dbdef object should have a name which corresponds
43         to its name within the SQL database engine.
44
45 SEE ALSO
46         the FS::dbdef_table manpage, the FS::Record manpage,
47
48 HISTORY
49         beginning of abstraction into a class (not really)
50
51         ivan@sisd.com 97-dec-4
52
53         added primary_key ivan@sisd.com 98-jan-20
54
55         added datatype (very kludgy and needs to be cleaned)
56         ivan@sisd.com 98-feb-21
57
58         perltrap (sigh) masked by mysql 3.20->3,21 ivan@sisd.com 98-
59         mar-2
60
61         Change 'type' to 'atype' in agent_type Changed attributes to
62         special words which are changed in fs-setup ie. double(10,2)
63         <=> MONEYTYPE Changed order of some of the field definitions
64         because Pg6.3 is picky Changed 'day' to 'daytime' in
65         cust_main Changed type of tax from tinyint to real Change
66         'password' to '_password' in svc_acct Pg6.3 does not allow
67         'field char(x) NULL' bmccane@maxbaud.net 98-apr-3
68
69         rewrite: now properly OO. See also
70         FS::dbdef_{table,column,unique,index}
71
72         ivan@sisd.com 98-apr-17
73
74         gained some extra functions ivan@sisd.com 98-may-11
75
76         now knows how to Freeze and Thaw itself ivan@sisd.com 98-
77         jun-2
78
79         pod ivan@sisd.com 98-sep-23
80