From 08d33e0aa3ba40882436f8e4341a7cd596c7fe6b Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Fri, 5 Aug 2016 15:14:24 +0200
Subject: [PATCH] [BUGFIX] Make EXT:filemetadata work with MySQL strict mode

EXT:filemetadata delivers a lot of sys_file_metadata fields
with NOT NULL in it, which does not make sense.

MySQL strict mode does not work with this SQL definition.

Resolves: #77418
Releases: master, 7.6
Change-Id: Ia93c3fd88066ba148b26eb8044fa297d8572c86f
Reviewed-on: https://review.typo3.org/49389
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Thomas Schlumberger <thomas@b13.de>
Tested-by: Thomas Schlumberger <thomas@b13.de>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
---
 typo3/sysext/filemetadata/ext_tables.sql | 44 ++++++++++++------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/typo3/sysext/filemetadata/ext_tables.sql b/typo3/sysext/filemetadata/ext_tables.sql
index 9ea920225f09..f8a8b98b8d07 100644
--- a/typo3/sysext/filemetadata/ext_tables.sql
+++ b/typo3/sysext/filemetadata/ext_tables.sql
@@ -2,43 +2,43 @@
 # Table structure for table 'sys_file_metadata'
 #
 CREATE TABLE sys_file_metadata (
-	visible int(11) unsigned DEfAULT '1' NOT NULL,
-	status varchar(24) DEFAULT '' NOT NULL,
-	keywords text NOT NULL,
-	caption varchar(255) DEFAULT '' NOT NULL,
-	creator_tool varchar(255) DEFAULT '' NOT NULL,
-	download_name varchar(255) DEFAULT '' NOT NULL,
-	creator varchar(255) DEFAULT '' NOT NULL,
-	publisher varchar(45) DEFAULT '' NOT NULL,
-	source varchar(255) DEFAULT '' NOT NULL,
-	copyright varchar(255) DEFAULT '' NOT NULL,
-	location_country varchar(45) DEFAULT '' NOT NULL,
-	location_region varchar(45) DEFAULT '' NOT NULL,
-	location_city varchar(45) DEFAULT '' NOT NULL,
-	latitude decimal(24,14) DEFAULT '0.00000000000000' NOT NULL,
-	longitude decimal(24,14) DEFAULT '0.00000000000000' NOT NULL,
+	visible int(11) unsigned DEFAULT '1',
+	status varchar(24) DEFAULT '',
+	keywords text,
+	caption varchar(255) DEFAULT '',
+	creator_tool varchar(255) DEFAULT '',
+	download_name varchar(255) DEFAULT '',
+	creator varchar(255) DEFAULT '',
+	publisher varchar(45) DEFAULT '',
+	source varchar(255) DEFAULT '',
+	copyright varchar(255) DEFAULT '',
+	location_country varchar(45) DEFAULT '',
+	location_region varchar(45) DEFAULT '',
+	location_city varchar(45) DEFAULT '',
+	latitude decimal(24,14) DEFAULT '0.00000000000000',
+	longitude decimal(24,14) DEFAULT '0.00000000000000',
 	ranking int(11) unsigned DEFAULT '0',
 	content_creation_date int(11) unsigned DEFAULT '0',
 	content_modification_date int(11) unsigned DEFAULT '0',
 	note text NOT NULL,
 
 	# px,mm,cm,m,p, ...
-	unit char(3) DEFAULT '' NOT NULL,
+	unit char(3) DEFAULT '',
 
 	# AUDIO + VIDEO
-	duration float unsigned DEFAULT '0' NOT NULL,
+	duration float unsigned DEFAULT '0',
 
 	# RGB,sRGB,YUV, ...
-	color_space varchar(4) DEFAULT '' NOT NULL,
+	color_space varchar(4) DEFAULT '',
 
 	# TEXT ASSET
 	# text document include x pages
-	pages int(4) unsigned DEFAULT '0' NOT NULL,
+	pages int(4) unsigned DEFAULT '0',
 
 	# TEXT + AUDIO + VIDEO
 	# correspond to the language of the document
-	language varchar(12) DEFAULT '' NOT NULL,
+	language varchar(12) DEFAULT '',
 
 	# FE permissions
-	fe_groups tinytext NOT NULL,
-);
\ No newline at end of file
+	fe_groups tinytext
+);
-- 
GitLab