mirror of
https://github.com/Terranom674/Piwigo_Bratonien_Tools.git
synced 2026-09-19 14:04:34 +00:00
Allow watermark profiles without assigned file
This commit is contained in:
@@ -23,7 +23,7 @@ function bratonien_tools_create_tables()
|
|||||||
pwg_query("CREATE TABLE IF NOT EXISTS `$profiles` (
|
pwg_query("CREATE TABLE IF NOT EXISTS `$profiles` (
|
||||||
id int(11) NOT NULL AUTO_INCREMENT,
|
id int(11) NOT NULL AUTO_INCREMENT,
|
||||||
name varchar(255) NOT NULL,
|
name varchar(255) NOT NULL,
|
||||||
watermark_file varchar(255) NOT NULL,
|
watermark_file varchar(255) DEFAULT NULL,
|
||||||
xpos int(11) NOT NULL DEFAULT 90,
|
xpos int(11) NOT NULL DEFAULT 90,
|
||||||
ypos int(11) NOT NULL DEFAULT 90,
|
ypos int(11) NOT NULL DEFAULT 90,
|
||||||
xrepeat int(11) NOT NULL DEFAULT 0,
|
xrepeat int(11) NOT NULL DEFAULT 0,
|
||||||
@@ -36,6 +36,12 @@ function bratonien_tools_create_tables()
|
|||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;");
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;");
|
||||||
|
|
||||||
|
// Piwigo's mass_inserts() serializes empty strings as SQL NULL. A profile is
|
||||||
|
// deliberately allowed to exist before a watermark file is assigned, so the
|
||||||
|
// database column must accept NULL as well. This migration also repairs
|
||||||
|
// installations created by Bratonien Tools 0.2.0 before this was corrected.
|
||||||
|
pwg_query("ALTER TABLE `$profiles` MODIFY watermark_file varchar(255) DEFAULT NULL");
|
||||||
|
|
||||||
if (!bratonien_tools_column_exists($profiles, 'xrepeat'))
|
if (!bratonien_tools_column_exists($profiles, 'xrepeat'))
|
||||||
{
|
{
|
||||||
pwg_query("ALTER TABLE `$profiles` ADD xrepeat int(11) NOT NULL DEFAULT 0 AFTER ypos");
|
pwg_query("ALTER TABLE `$profiles` ADD xrepeat int(11) NOT NULL DEFAULT 0 AFTER ypos");
|
||||||
|
|||||||
Reference in New Issue
Block a user