App-PhotoDB

 view release on metacpan or  search on metacpan

docs/SCHEMA.pod  view on Meta::CPAN

    | negative_size_id       | int(11)      | ID of the negative size which this lens is designed for                                                                                     |
    | fixed_mount            | tinyint(1)   | Whether this is a fixed lens (i.e. on a compact camera)                                                                                     |
    | notes                  | text         | Freeform notes field                                                                                                                        |
    | coating                | varchar(45)  | Notes about the lens coating type                                                                                                           |
    | hood                   | varchar(45)  | Model number of the compatible lens hood                                                                                                    |
    | exif_lenstype          | varchar(45)  | EXIF LensID number, if this lens has one officially registered. See documentation at http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/ |
    | rectilinear            | tinyint(1)   | Whether this is a rectilinear lens                                                                                                          |
    | length                 | int(11)      | Length of lens in mm                                                                                                                        |
    | diameter               | int(11)      | Width of lens in mm                                                                                                                         |
    | image_circle           | int(11)      | Diameter of image circle projected by lens, in mm                                                                                           |
    | formula                | varchar(45)  | Name of the type of lens formula (e.g. Tessar)                                                                                              |
    | shutter_model          | varchar(45)  | Name of the integrated shutter, if any                                                                                                      |
    +------------------------+--------------+---------------------------------------------------------------------------------------------------------------------------------------------+

=head2 LIGHT_METER

Table to catalog light meters

    +-----------------+-------------+--------------------------------------------------------------------+
    | COLUMN_NAME     | COLUMN_TYPE | COLUMN_COMMENT                                                     |
    +-----------------+-------------+--------------------------------------------------------------------+

docs/SCHEMA.pod  view on Meta::CPAN

=head2 TONER

Table to catalog paper toners that can be used during the printing process

    +-----------------+-------------+-------------------------------------+
    | COLUMN_NAME     | COLUMN_TYPE | COLUMN_COMMENT                      |
    +-----------------+-------------+-------------------------------------+
    | toner_id        | int(11)     | Unique ID of the toner              |
    | manufacturer_id | int(11)     | ID of the manufacturer of the toner |
    | toner           | varchar(45) | Name of the toner                   |
    | formulation     | varchar(45) | Chemical formulation of the toner   |
    | stock_dilution  | varchar(10) | Stock dilution of the toner         |
    +-----------------+-------------+-------------------------------------+

=head2 TO_PRINT

Table to catalogue negatives that should be printed

    +-------------+-------------+---------------------------------+
    | COLUMN_NAME | COLUMN_TYPE | COLUMN_COMMENT                  |
    +-------------+-------------+---------------------------------+

lib/App/PhotoDB/handlers.pm  view on Meta::CPAN

	$data{url} = &prompt({prompt=>'Informational URL for this lens', default=>$$defaults{url}});
	$data{introduced} = &prompt({prompt=>'When was this lens introduced?', type=>'integer', default=>$$defaults{introduced}});
	$data{discontinued} = &prompt({prompt=>'When was this lens discontinued?', type=>'integer', default=>$$defaults{discontinued}});
	$data{negative_size_id} = &listchoices({db=>$db, cols=>['negative_size_id as id', 'negative_size as opt'], table=>'NEGATIVE_SIZE', inserthandler=>\&negativesize_add, default=>$$defaults{negative_size_id}});
	$data{notes} = &prompt({prompt=>'Notes', default=>$$defaults{notes}});
	$data{coating} = &prompt({prompt=>'What coating does this lens have?', default=>$$defaults{coating}});
	$data{hood} = &prompt({prompt=>'What is the model number of the suitable hood for this lens?', default=>$$defaults{hood}});
	$data{exif_lenstype} = &prompt({prompt=>'EXIF lens type code', default=>$$defaults{exif_lenstype}});
	$data{rectilinear} = &prompt({prompt=>'Is this a rectilinear lens?', type=>'boolean', default=>$$defaults{rectilinear}//'yes'});
	$data{image_circle} = &prompt({prompt=>'What is the diameter of the image circle?', type=>'integer', default=>$$defaults{image_circle}});
	$data{formula} = &prompt({prompt=>'Does this lens have a named optical formula?', default=>$$defaults{formula}});
	$data{shutter_model} = &prompt({prompt=>'What shutter does this lens incorporate?', default=>$$defaults{shutter_model}});
	return \%data;
}

# Add accessory compatibility info to a lens
sub lensmodel_accessory {
	my $href = shift;
	my $db = $href->{db};
	my $lensmodel_id = $href->{lensmodel_id} // &listchoices({db=>$db, table=>'choose_lensmodel', required=>1});
	while (1) {

lib/App/PhotoDB/handlers.pm  view on Meta::CPAN

	return;
}

# Add a new chemical toner to the database
sub toner_add {
	my $href = shift;
	my $db = $href->{db};
	my %data;
	$data{manufacturer_id} = $href->{manufacturer_id} // &choose_manufacturer({db=>$db});
	$data{toner} = $href->{toner} // &prompt({prompt=>'What is the name of this toner?'});
	$data{formulation} = $href->{formulation} // &prompt({prompt=>'What is the chemical formulation of this toner?'});
	$data{stock_dilution} = $href->{stock_dilution} // &prompt({prompt=>'What is the stock dilution of this toner?'});
	return &newrecord({db=>$db, data=>\%data, table=>'TONER'});
}

# Add a new type of filmstock to the database
sub filmstock_add {
	my $href = shift;
	my $db = $href->{db};
	my %data;
	$data{manufacturer_id} = $href->{manufacturer_id} // &choose_manufacturer({db=>$db});

migrations/000-base-schema.sql  view on Meta::CPAN

  CONSTRAINT `fk_TELECONVERTER_2` FOREIGN KEY (`mount_id`) REFERENCES `MOUNT` (`mount_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Table to catalog teleconverters (multipliers)';
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `TONER`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `TONER` (
  `toner_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID of the toner',
  `manufacturer_id` int(11) DEFAULT NULL COMMENT 'ID of the manufacturer of the toner',
  `toner` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Name of the toner',
  `formulation` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Chemical formulation of the toner',
  `stock_dilution` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Stock dilution of the toner',
  PRIMARY KEY (`toner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Table to catalog paper toners that can be used during the printing process';
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `ENLARGER`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `ENLARGER` (
  `enlarger_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique enlarger ID',
  `manufacturer_id` int(11) DEFAULT NULL COMMENT 'Manufacturer ID of the enlarger',

migrations/000-base-schema.sql  view on Meta::CPAN

  `lost_price` decimal(6,2) DEFAULT NULL COMMENT 'Price for which the lens was sold',
  `source` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Place where the lens was acquired from',
  `coating` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Notes about the lens coating type',
  `hood` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Model number of the compatible lens hood',
  `exif_lenstype` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'EXIF LensID number, if this lens has one officially registered. See documentation at http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/',
  `rectilinear` tinyint(1) DEFAULT NULL COMMENT 'Whether this is a rectilinear lens',
  `length` int(11) DEFAULT NULL COMMENT 'Length of lens in mm',
  `diameter` int(11) DEFAULT NULL COMMENT 'Width of lens in mm',
  `condition_id` int(11) DEFAULT NULL COMMENT 'Denotes the cosmetic condition of the camera',
  `image_circle` int(11) DEFAULT NULL COMMENT 'Diameter of image circle projected by lens, in mm',
  `formula` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Name of the type of lens formula (e.g. Tessar)',
  `shutter_model` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Name of the integrated shutter, if any',
  PRIMARY KEY (`lens_id`),
  KEY `fk_LENS_2` (`manufacturer_id`),
  KEY `fk_LENS_3` (`mount_id`),
  KEY `fk_LENS_4` (`negative_size_id`),
  KEY `fk_LENS_1_idx` (`condition_id`),
  CONSTRAINT `fk_LENS_1` FOREIGN KEY (`condition_id`) REFERENCES `CONDITION` (`condition_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_LENS_2` FOREIGN KEY (`manufacturer_id`) REFERENCES `MANUFACTURER` (`manufacturer_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_LENS_3` FOREIGN KEY (`mount_id`) REFERENCES `MOUNT` (`mount_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_LENS_4` FOREIGN KEY (`negative_size_id`) REFERENCES `NEGATIVE_SIZE` (`negative_size_id`) ON DELETE CASCADE ON UPDATE CASCADE

migrations/003-views.sql  view on Meta::CPAN

  `Date lost` tinyint NOT NULL,
  `Price sold` tinyint NOT NULL,
  `Source` tinyint NOT NULL,
  `Coating` tinyint NOT NULL,
  `Hood` tinyint NOT NULL,
  `EXIF LensType` tinyint NOT NULL,
  `Rectilinear` tinyint NOT NULL,
  `Dimensions (l×w)` tinyint NOT NULL,
  `Condition` tinyint NOT NULL,
  `Image circle` tinyint NOT NULL,
  `Optical formula` tinyint NOT NULL,
  `Shutter model` tinyint NOT NULL,
  `Frames shot` tinyint NOT NULL
) ENGINE=MyISAM;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `info_lens`;
SET @saved_cs_client          = @@character_set_client;
SET @saved_cs_results         = @@character_set_results;
SET @saved_col_connection     = @@collation_connection;
SET character_set_client      = utf8;
SET character_set_results     = utf8;
SET collation_connection      = utf8_general_ci;
CREATE ALGORITHM=UNDEFINED
VIEW `info_lens` AS select `LENS`.`lens_id` AS `Lens ID`,`MOUNT`.`mount` AS `Mount`,if(`LENS`.`zoom`,concat(`LENS`.`min_focal_length`,'-',`LENS`.`max_focal_length`,'mm'),concat(`LENS`.`min_focal_length`,'mm')) AS `Focal length`,concat(`MANUFACTURER`....
SET character_set_client      = @saved_cs_client;
SET character_set_results     = @saved_cs_results;
SET collation_connection      = @saved_col_connection;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `info_movie` (
  `Movie ID` tinyint NOT NULL,
  `Title` tinyint NOT NULL,
  `Camera` tinyint NOT NULL,
  `Lens` tinyint NOT NULL,

migrations/022-create-lens-model.sql  view on Meta::CPAN

  `negative_size_id` int(11) DEFAULT NULL COMMENT 'ID of the negative size which this lens is designed for',
  `fixed_mount` tinyint(1) DEFAULT NULL COMMENT 'Whether this is a fixed lens (i.e. on a compact camera)',
  `notes` text COLLATE utf8mb4_unicode_ci COMMENT 'Freeform notes field',
  `coating` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Notes about the lens coating type',
  `hood` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Model number of the compatible lens hood',
  `exif_lenstype` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'EXIF LensID number, if this lens has one officially registered. See documentation at http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/',
  `rectilinear` tinyint(1) DEFAULT NULL COMMENT 'Whether this is a rectilinear lens',
  `length` int(11) DEFAULT NULL COMMENT 'Length of lens in mm',
  `diameter` int(11) DEFAULT NULL COMMENT 'Width of lens in mm',
  `image_circle` int(11) DEFAULT NULL COMMENT 'Diameter of image circle projected by lens, in mm',
  `formula` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Name of the type of lens formula (e.g. Tessar)',
  `shutter_model` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Name of the integrated shutter, if any',
  PRIMARY KEY (`lensmodel_id`),
  KEY `fk_LENS_2` (`manufacturer_id`),
  KEY `fk_LENS_3` (`mount_id`),
  KEY `fk_LENS_4` (`negative_size_id`),
  CONSTRAINT `fk_LENSMODEL_1` FOREIGN KEY (`manufacturer_id`) REFERENCES `MANUFACTURER` (`manufacturer_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_LENSMODEL_2` FOREIGN KEY (`mount_id`) REFERENCES `MOUNT` (`mount_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_LENSMODEL_3` FOREIGN KEY (`negative_size_id`) REFERENCES `NEGATIVE_SIZE` (`negative_size_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Table to catalog lens models';

migrations/023-copy-lens-models.sql  view on Meta::CPAN

insert into LENSMODEL (lensmodel_id, mount_id, zoom, min_focal_length, max_focal_length, manufacturer_id, model, closest_focus, max_aperture, min_aperture, elements, groups, weight, nominal_min_angle_diag, nominal_max_angle_diag, aperture_blades, aut...
select
lens_id, mount_id, zoom, min_focal_length, max_focal_length, manufacturer_id, model, closest_focus, max_aperture, min_aperture, elements, groups, weight, nominal_min_angle_diag, nominal_max_angle_diag, aperture_blades, autofocus, filter_thread, magni...
from LENS;

migrations/026-lensmodel-views.sql  view on Meta::CPAN

        `LENSMODEL`.`coating` AS `Coating`,
        `LENSMODEL`.`hood` AS `Hood`,
        `LENSMODEL`.`exif_lenstype` AS `EXIF LensType`,
        PRINTBOOL(`LENSMODEL`.`rectilinear`) AS `Rectilinear`,
        CONCAT(`LENSMODEL`.`length`,
                '×',
                `LENSMODEL`.`diameter`,
                'mm') AS `Dimensions (l×w)`,
        `CONDITION`.`name` AS `Condition`,
        CONCAT(`LENSMODEL`.`image_circle`, 'mm') AS `Image circle`,
        `LENSMODEL`.`formula` AS `Optical formula`,
        `LENSMODEL`.`shutter_model` AS `Shutter model`,
        COUNT(`NEGATIVE`.`negative_id`) AS `Frames shot`
    FROM
        ((((((`LENS`
        JOIN `LENSMODEL` ON ((`LENS`.`lensmodel_id` = `LENSMODEL`.`lensmodel_id`)))
        LEFT JOIN `MOUNT` ON ((`LENSMODEL`.`mount_id` = `MOUNT`.`mount_id`)))
        LEFT JOIN `MANUFACTURER` ON ((`LENSMODEL`.`manufacturer_id` = `MANUFACTURER`.`manufacturer_id`)))
        LEFT JOIN `CONDITION` ON ((`LENS`.`condition_id` = `CONDITION`.`condition_id`)))
        LEFT JOIN `NEGATIVE_SIZE` ON ((`LENSMODEL`.`negative_size_id` = `NEGATIVE_SIZE`.`negative_size_id`)))
        LEFT JOIN `NEGATIVE` ON ((`NEGATIVE`.`lens_id` = `LENS`.`lens_id`)))

migrations/028-drop-lens-cols.sql  view on Meta::CPAN

ALTER TABLE `LENS`
DROP FOREIGN KEY `fk_LENS_4`,
DROP FOREIGN KEY `fk_LENS_3`,
DROP FOREIGN KEY `fk_LENS_2`;
ALTER TABLE `LENS`
DROP COLUMN `shutter_model`,
DROP COLUMN `formula`,
DROP COLUMN `image_circle`,
DROP COLUMN `diameter`,
DROP COLUMN `length`,
DROP COLUMN `rectilinear`,
DROP COLUMN `exif_lenstype`,
DROP COLUMN `hood`,
DROP COLUMN `coating`,
DROP COLUMN `fixed_mount`,
DROP COLUMN `negative_size_id`,
DROP COLUMN `discontinued`,

migrations/029-lensmodel-views.sql  view on Meta::CPAN

        `LENSMODEL`.`coating` AS `Coating`,
        `LENSMODEL`.`hood` AS `Hood`,
        `LENSMODEL`.`exif_lenstype` AS `EXIF LensType`,
        PRINTBOOL(`LENSMODEL`.`rectilinear`) AS `Rectilinear`,
        CONCAT(`LENSMODEL`.`length`,
                '×',
                `LENSMODEL`.`diameter`,
                'mm') AS `Dimensions (l×w)`,
        `CONDITION`.`name` AS `Condition`,
        CONCAT(`LENSMODEL`.`image_circle`, 'mm') AS `Image circle`,
        `LENSMODEL`.`formula` AS `Optical formula`,
        `LENSMODEL`.`shutter_model` AS `Shutter model`,
        COUNT(`NEGATIVE`.`negative_id`) AS `Frames shot`
    FROM
        ((((((`LENS`
        JOIN `LENSMODEL` ON ((`LENS`.`lensmodel_id` = `LENSMODEL`.`lensmodel_id`)))
        LEFT JOIN `MOUNT` ON ((`LENSMODEL`.`mount_id` = `MOUNT`.`mount_id`)))
        LEFT JOIN `MANUFACTURER` ON ((`LENSMODEL`.`manufacturer_id` = `MANUFACTURER`.`manufacturer_id`)))
        LEFT JOIN `CONDITION` ON ((`LENS`.`condition_id` = `CONDITION`.`condition_id`)))
        LEFT JOIN `NEGATIVE_SIZE` ON ((`LENSMODEL`.`negative_size_id` = `NEGATIVE_SIZE`.`negative_size_id`)))
        LEFT JOIN `NEGATIVE` ON ((`NEGATIVE`.`lens_id` = `LENS`.`lens_id`)))

migrations/033-cameramodel-views.sql  view on Meta::CPAN

        `LENSMODEL`.`coating` AS `Coating`,
        `LENSMODEL`.`hood` AS `Hood`,
        `LENSMODEL`.`exif_lenstype` AS `EXIF LensType`,
        PRINTBOOL(`LENSMODEL`.`rectilinear`) AS `Rectilinear`,
        CONCAT(`LENSMODEL`.`length`,
                '×',
                `LENSMODEL`.`diameter`,
                'mm') AS `Dimensions (l×w)`,
        `CONDITION`.`name` AS `Condition`,
        CONCAT(`LENSMODEL`.`image_circle`, 'mm') AS `Image circle`,
        `LENSMODEL`.`formula` AS `Optical formula`,
        `LENSMODEL`.`shutter_model` AS `Shutter model`,
        COUNT(`NEGATIVE`.`negative_id`) AS `Frames shot`
    FROM
        ((((((`LENS`
        JOIN `LENSMODEL` ON (`LENS`.`lensmodel_id` = `LENSMODEL`.`lensmodel_id`))
        LEFT JOIN `MOUNT` ON (`LENSMODEL`.`mount_id` = `MOUNT`.`mount_id`))
        LEFT JOIN `MANUFACTURER` ON (`LENSMODEL`.`manufacturer_id` = `MANUFACTURER`.`manufacturer_id`))
        LEFT JOIN `CONDITION` ON (`LENS`.`condition_id` = `CONDITION`.`condition_id`))
        LEFT JOIN `NEGATIVE_SIZE` ON (`LENSMODEL`.`negative_size_id` = `NEGATIVE_SIZE`.`negative_size_id`))
        LEFT JOIN `NEGATIVE` ON (`NEGATIVE`.`lens_id` = `LENS`.`lens_id`))

migrations/040-cameramodel-info.sql  view on Meta::CPAN

        `NEGATIVE_SIZE`.`negative_size` AS `Negative size`,
        `LENSMODEL`.`coating` AS `Coating`,
        `LENSMODEL`.`hood` AS `Hood`,
        `LENSMODEL`.`exif_lenstype` AS `EXIF LensType`,
        PRINTBOOL(`LENSMODEL`.`rectilinear`) AS `Rectilinear`,
        CONCAT(`LENSMODEL`.`length`,
                '×',
                `LENSMODEL`.`diameter`,
                'mm') AS `Dimensions (l×w)`,
        CONCAT(`LENSMODEL`.`image_circle`, 'mm') AS `Image circle`,
        `LENSMODEL`.`formula` AS `Optical formula`,
        `LENSMODEL`.`shutter_model` AS `Shutter model`
    FROM
        (((`LENSMODEL`
        LEFT JOIN `MOUNT` ON (`LENSMODEL`.`mount_id` = `MOUNT`.`mount_id`))
        LEFT JOIN `MANUFACTURER` ON (`LENSMODEL`.`manufacturer_id` = `MANUFACTURER`.`manufacturer_id`))
        LEFT JOIN `NEGATIVE_SIZE` ON (`LENSMODEL`.`negative_size_id` = `NEGATIVE_SIZE`.`negative_size_id`))
    WHERE
        `LENSMODEL`.`fixed_mount` = 0
    GROUP BY `LENSMODEL`.`lensmodel_id`;



( run in 0.577 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )