my $username_len = 64; #usernamemax config file
- # name type nullability length default local
+ # Returns a hashref defining the entire application database schema
+ # Each key of the hashref contains a structure describing a database table
+ #
+ # table_name => {
+ # columns => [...],
+ # primary_key => 'column',
+ # unique => [column,column,...],
+ # index => [[column],[column,column],...],
+ # foreign_keys => [{...},{...},...],
+ # }
+ #
+ #
+ # columns => [
+ #
+ # 'column_name',
+ #
+ # 'column_type',
+ #
+ # 'NULL' or '', # 'NULL' : Allow null values
+ # # '' : Disallow null values
+ #
+ # 'length', # Column size value. eg:
+ # # 40 : VARCHAR(40)
+ # # '10,2' : FLOAT(10,2)
+ #
+ # 'default', # Default column value for a new record
+ # # (Unclear is setting this to '' results in a default
+ # # value of NULL or empty string)
+ #
+ # '', # local ?
+ #
+ # name, type, nullability, length, default, local,
+ # name, type, nullability, length, default, local,
+ # ...
+ #
+ # ],
return {
'foreign_keys' => [],
},
+ 'realestate_property' => {
+ 'columns' => [
+ 'propnum', 'serial', '', '', '', '',
+ 'agentnum', 'int', 'NULL', '', '', '',
+ 'title', 'varchar', '', $char_d, '', '',
+ 'address1', 'varchar', 'NULL', $char_d, '', '',
+ 'address2', 'varchar', 'NULL', $char_d, '', '',
+ 'city', 'varchar', 'NULL', $char_d, '', '',
+ 'state', 'varchar', 'NULL', $char_d, '', '',
+ 'zip', 'char', 'NULL', 5, '', '',
+ 'disabled', 'char', '', 1, '0', '',
+ ],
+ 'primary_key' => 'propnum',
+ 'unique' => [],
+ 'index' => [ ['agentnum'] ],
+ 'foreign_keys' => [
+ {columns => ['agentnum'], table => 'agent'}
+ ],
+ },
+
+ 'realestate_subproperty' => {
+ 'columns' => [
+ 'spropnum', 'serial', '', '', '', '',
+ 'propnum', 'int', '', '', '', '',
+ 'subtitle', 'varchar', '', $char_d, '', '',
+ 'disabled', 'char', '', 1, '0', '',
+ ],
+ 'primary_key' => 'spropnum',
+ 'unique' => [],
+ 'index' => [ ['propnum'] ],
+ 'foreign_keys' => [
+ {columns => ['propnum'], table => 'realestate_property'}
+ ],
+ },
+
# name type nullability length default local
#'new_table' => {
=cut
1;
-