App-PhotoDB
view release on metacpan or search on metacpan
docs/SCHEMA.pod view on Meta::CPAN
=head2 CONDITION
Table to list of physical condition descriptions that can be used to evaluate equipment
+--------------+--------------+---------------------------------------------------------------+
| COLUMN_NAME | COLUMN_TYPE | COLUMN_COMMENT |
+--------------+--------------+---------------------------------------------------------------+
| condition_id | int(11) | Unique condition ID |
| code | varchar(6) | Condition shortcode (e.g. EXC) |
| name | varchar(45) | Full name of condition (e.g. Excellent) |
| min_rating | int(11) | The lowest percentage rating that encompasses this condition |
| max_rating | int(11) | The highest percentage rating that encompasses this condition |
| description | varchar(300) | Longer description of condition |
+--------------+--------------+---------------------------------------------------------------+
=head2 DEVELOPER
Table to list film and paper developers
+-----------------+-------------+---------------------------------------------------------------------+
| COLUMN_NAME | COLUMN_TYPE | COLUMN_COMMENT |
+-----------------+-------------+---------------------------------------------------------------------+
lib/App/PhotoDB/handlers.pm view on Meta::CPAN
sub series_info {
my $href = shift;
my $db = $href->{db};
my $series_id = $href->{series_id} // &listchoices({db=>$db, cols=>['series_id as id', 'name as opt'], table=>'SERIES', required=>1});
my $seriesname = &lookupval({db=>$db, col=>'name', table=>'SERIES', where=>{series_id=>$series_id}});
my $total = &printlist({db=>$db, msg=>"camera and lens models in series '$seriesname'", table=>'info_series', cols=>["Got as id", 'Model as opt'], where=>{'`Series ID`'=>$series_id}});
my $got = &lookupval({db=>$db, col=>'count(*)', table=>'info_series', where=>{'`Series ID`'=>$series_id, Got=>'â'}});
if ($total > 0) {
my $need = $total - $got;
my $percentcomplete = round(100 * $got/$total);
print "Series '$seriesname' is $percentcomplete% complete (got $got, need $need)\n";
}
return;
}
# Summarise all series
sub series_list {
my $href = shift;
my $db = $href->{db};
my $rows = &tabulate({db=>$db, view=>'summary_series'});
return $rows;
migrations/000-base-schema.sql view on Meta::CPAN
PRIMARY KEY (`archive_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Table to list the different types of archive available for materials';
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `CONDITION`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `CONDITION` (
`condition_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique condition ID',
`code` varchar(6) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Condition shortcode (e.g. EXC)',
`name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Full name of condition (e.g. Excellent)',
`min_rating` int(11) DEFAULT NULL COMMENT 'The lowest percentage rating that encompasses this condition',
`max_rating` int(11) DEFAULT NULL COMMENT 'The highest percentage rating that encompasses this condition',
`description` varchar(300) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Longer description of condition',
PRIMARY KEY (`condition_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Table to list of physical condition descriptions that can be used to evaluate equipment';
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `LOG`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `LOG` (
`log_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID of the log entry',
`datetime` datetime DEFAULT NULL COMMENT 'Timestamp for the log entry',
( run in 0.402 second using v1.01-cache-2.11-cpan-05162d3a2b1 )