WeBWorK::DB::Layout - the database layout.
The database layout is a hash reference consisting of items keyed by table names. The value of each item is a reference to a hash containing the following items:
The name of a perl module to use for representing the data in a record.
The name of a perl module to use for access to the table.
A reference to a hash containing extra information needed by the schema. Some schemas require parameters, some do not. The only supported parameters are non_native
, tableOverride
, and merge
at this point.
If non_native => 1
is set it means that the table is not a table for the course. Note that can mean two things. It can mean that the table is a global site table, or it can mean that the table is a virtual table.
The tableOverride
parameter is the name of the physical table in the database. Usually this just prepends $courseName
.
If the merge
parameter is set it should be a reference to an array of table names (that are NOT non_native
) whose values are merged to give the values in this table. Note that a merge
table is virtual and must have non_native => 1
set.
A reference to an array of other database tables on which this table depends and whose schemas must be initialized prior to initialization of the schema for this table.
my $dbLayout = databaseLayout($courseName);
This returns a database layout hash as described above for the course identified by $courseName
which is the only required argument for this method.