<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.lib.sun.ac.za/index.php?action=history&amp;feed=atom&amp;title=Xibo</id>
	<title>Xibo - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.lib.sun.ac.za/index.php?action=history&amp;feed=atom&amp;title=Xibo"/>
	<link rel="alternate" type="text/html" href="http://wiki.lib.sun.ac.za/index.php?title=Xibo&amp;action=history"/>
	<updated>2026-05-14T15:12:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.2</generator>
	<entry>
		<id>http://wiki.lib.sun.ac.za/index.php?title=Xibo&amp;diff=45716&amp;oldid=prev</id>
		<title>Ivdl: /* Debugging upgrade error from version 1.8.x to 2.1.2 */</title>
		<link rel="alternate" type="text/html" href="http://wiki.lib.sun.ac.za/index.php?title=Xibo&amp;diff=45716&amp;oldid=prev"/>
		<updated>2019-12-04T06:25:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Debugging upgrade error from version 1.8.x to 2.1.2&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 06:25, 4 December 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot; &gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                                                                                                 &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                                                                                                 &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[PDOException]                                                                                  &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[PDOException]                                                                                  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'createdDt' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;                                                                                               &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'createdDt'&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Inside the db/migrations directory, there is a file named &amp;lt;code&amp;gt;20180131122645_one_region_per_playlist_migration.php&amp;lt;/code&amp;gt;. Open that file and modify lines 13 - 20 as follows:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Inside the db/migrations directory, there is a file named &amp;lt;code&amp;gt;20180131122645_one_region_per_playlist_migration.php&amp;lt;/code&amp;gt;. Open that file and modify lines 13 - 20 as follows:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ivdl</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.lib.sun.ac.za/index.php?title=Xibo&amp;diff=45715&amp;oldid=prev</id>
		<title>Ivdl: Created page with &quot;== Debugging upgrade error from version 1.8.x to 2.1.2 ==  Upon upgrading from a 1.8.x version of Xibo to 2.1.2, you may encounter the following two errors when running &lt;code&gt;...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.lib.sun.ac.za/index.php?title=Xibo&amp;diff=45715&amp;oldid=prev"/>
		<updated>2019-12-04T06:25:16Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Debugging upgrade error from version 1.8.x to 2.1.2 ==  Upon upgrading from a 1.8.x version of Xibo to 2.1.2, you may encounter the following two errors when running &amp;lt;code&amp;gt;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Debugging upgrade error from version 1.8.x to 2.1.2 ==&lt;br /&gt;
&lt;br /&gt;
Upon upgrading from a 1.8.x version of Xibo to 2.1.2, you may encounter the following two errors when running &amp;lt;code&amp;gt;phinx migrate -c phinx.php&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;== 20180131122645 OneRegionPerPlaylistMigration: migrating&lt;br /&gt;
&lt;br /&gt;
[PDOException]&lt;br /&gt;
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'regionId’&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 == 20180131122645 OneRegionPerPlaylistMigration: migrating&lt;br /&gt;
                                                                                               &lt;br /&gt;
[PDOException]                                                                                 &lt;br /&gt;
SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'createdDt'                                                                                                &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inside the db/migrations directory, there is a file named &amp;lt;code&amp;gt;20180131122645_one_region_per_playlist_migration.php&amp;lt;/code&amp;gt;. Open that file and modify lines 13 - 20 as follows:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;13         $playlist = $this-&amp;gt;table('playlist');&lt;br /&gt;
14         $playlist&lt;br /&gt;
15             /*-&amp;gt;addColumn('regionId', 'integer', ['null' =&amp;gt; true])*/&lt;br /&gt;
16             -&amp;gt;addColumn('createdDt', 'datetime', ['default' =&amp;gt; '2019-12-01 00:00:00'])&lt;br /&gt;
17             -&amp;gt;addColumn('modifiedDt', 'datetime', ['default' =&amp;gt; '2019-12-01 00:00:00'])&lt;br /&gt;
18             -&amp;gt;addColumn('duration', 'integer', ['default' =&amp;gt; 0])&lt;br /&gt;
19             -&amp;gt;addColumn('requiresDurationUpdate', 'integer', ['default' =&amp;gt; 0, 'limit' =&amp;gt; \Phinx\Db\Adapter\MysqlAdapter::INT_TINY])&lt;br /&gt;
20             -&amp;gt;save();&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In short:&lt;br /&gt;
&lt;br /&gt;
# Comment out the addColumn call for the regionId, since it already exists&lt;br /&gt;
# Set default values for the createdDt and modifiedDt columns (you can set any value, but the empty value 0000-00-00 00:00:00 is not valid, which is why I chose the first of December for this year as a dummy value.).&lt;br /&gt;
&lt;br /&gt;
Now run &amp;lt;code&amp;gt;phinx migrate -c phinx.php&amp;lt;/code&amp;gt; again and the upgrade should succeed.&lt;br /&gt;
&lt;br /&gt;
I also posted this answer in response to the question posed on the [https://community.xibo.org.uk/t/database-upgrade-error-duplicate-column-2-1-2/21093/2 Xibo forums].&lt;/div&gt;</summary>
		<author><name>Ivdl</name></author>
		
	</entry>
</feed>