CREATE TABLE `pictures` (
	`id_picture` int(10) UNSIGNED auto_increment,
	`id_project` int(10) UNSIGNED,
	`filename` VARCHAR(100) NOT NULL,
	`taken_on` DATETIME,
	`timestamp` DATETIME,
	`rotate` SMALLINT,
	`led` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
	PRIMARY KEY (`id_picture`),
	UNIQUE KEY `uni_file_name` (`filename`)
);

ALTER TABLE pictures ADD INDEX(`id_project`);
ALTER TABLE pictures ADD FOREIGN KEY (`id_project`) REFERENCES projects(`id_project`);