<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[My Visual Database — Migrating to MySQL default value for Date not null?]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=8858</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=8858&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Migrating to MySQL default value for Date not null?.]]></description>
		<lastBuildDate>Tue, 12 Mar 2024 19:32:41 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50487#p50487</link>
			<description><![CDATA[<p>I am now testing with MySQL community edition 8 and it does not accept neither 0 or 0000-00-00 as a default value if null for a date column. According to the documentation, the minimum date should be 1000-01-01. </p><p>This is just an information in case of anyone would need it.</p>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Tue, 12 Mar 2024 19:32:41 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50487#p50487</guid>
		</item>
		<item>
			<title><![CDATA[Re: Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50401#p50401</link>
			<description><![CDATA[<div class="quotebox"><cite>sparrow wrote:</cite><blockquote><p>Brian, Sorry, I didn&#039;t look at the sender)))</p><br /><p>I&#039;m using a Required parameter but defining the value for the field directly on the form. The value 0 is not informative for me.</p><p>p.s. By the way, MARIADB 10.10.3 does not allow you to create from 0.</p></blockquote></div><p>What you mean by create from 0? Set default value as zero?<br />If that&#039;s the case then most likely MariaDB Ver10.11.2 tcoton&#039;s using also not allowing zero as default value then. Sorry for I&#039;m not so familiar with MariaDB since I&#039;m working with MySQL Community edition ever since and don&#039;t have time to test on it as of the moment. <br />Anyway @tcoton, I think setting it as 0000-00-00 instead is not that tedious. You&#039;ll only set this once.</p>]]></description>
			<author><![CDATA[null@example.com (brian.zaballa)]]></author>
			<pubDate>Mon, 04 Mar 2024 05:36:55 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50401#p50401</guid>
		</item>
		<item>
			<title><![CDATA[Re: Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50398#p50398</link>
			<description><![CDATA[<p>Brian, Sorry, I didn&#039;t look at the sender)))</p><br /><p>I&#039;m using a Required parameter but defining the value for the field directly on the form. The value 0 is not informative for me.</p><p>p.s. By the way, MARIADB 10.10.3 does not allow you to create from 0.</p>]]></description>
			<author><![CDATA[null@example.com (sparrow)]]></author>
			<pubDate>Sat, 02 Mar 2024 09:26:43 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50398#p50398</guid>
		</item>
		<item>
			<title><![CDATA[Re: Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50397#p50397</link>
			<description><![CDATA[<div class="quotebox"><cite>sparrow wrote:</cite><blockquote><p>You are trying to show me that MYSQL does not support 0 or &#039;now&#039; in date and time. This is known. <br />But this is not a drawback of MYSQL, but a feature of SQLITE. <br />For SQLITE, there is no strict correspondence between a given column type and its contents in a cell, <br />and this is described in the SQLite documents.<br />As for the default date value, you can assign it in the form in which you define this value. <br />For example, by writing it in a script.</p></blockquote></div><p>Zero (0) was my solution and working for me, check on my video. I&#039;m aware of the capabilities of sqlite and mysql. I&#039;m addressing that video to tcoton.</p>]]></description>
			<author><![CDATA[null@example.com (brian.zaballa)]]></author>
			<pubDate>Sat, 02 Mar 2024 08:50:35 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50397#p50397</guid>
		</item>
		<item>
			<title><![CDATA[Re: Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50395#p50395</link>
			<description><![CDATA[<p>You are trying to show me that MYSQL does not support 0 or &#039;now&#039; in date and time. This is known. <br />But this is not a drawback of MYSQL, but a feature of SQLITE. <br />For SQLITE, there is no strict correspondence between a given column type and its contents in a cell, <br />and this is described in the SQLite documents.<br />As for the default date value, you can assign it in the form in which you define this value. <br />For example, by writing it in a script.</p>]]></description>
			<author><![CDATA[null@example.com (sparrow)]]></author>
			<pubDate>Sat, 02 Mar 2024 08:25:12 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50395#p50395</guid>
		</item>
		<item>
			<title><![CDATA[Re: Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50394#p50394</link>
			<description><![CDATA[<div class="quotebox"><cite>tcoton wrote:</cite><blockquote><p>@Sparrow </p><p>Yes it does but then, if you set a date column not null, you must set a default value and the default value &#039;now&#039; that works in SQLite does is not accepted by MysQL/MariaDB, there is an error and the table cannot be created,&nbsp; hence my answer with the correct format above your comment.</p><p>Another hiccup when connecting to a fresh database with no tables in MySQL/MariaDB from a MVD project, it tries to create twice the table &quot;_user&quot;, throws a duplicate error and creates a useless table &quot;_mvd_roles&quot;. This never happens when connecting to an empty database from a compiled project. I tried it multiples times when testing my Delete - Import routine. You can also, as I mentioned before, connect the application to an already filled up database containing the exact structure required with no problem at all.</p><p>The subject of this post was really about the default value of a Date column when not null is forced in MySQL.</p></blockquote></div><p>You mention again here the default value being &#039;now&#039;, changing it to zero fixes the problem for me. If possible, maybe you can send here the tables.ini you are working with so that we can test on it.</p>]]></description>
			<author><![CDATA[null@example.com (brian.zaballa)]]></author>
			<pubDate>Sat, 02 Mar 2024 07:10:46 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50394#p50394</guid>
		</item>
		<item>
			<title><![CDATA[Re: Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50393#p50393</link>
			<description><![CDATA[<p>Well, here&#039;s mine, no problem at all.<br /><a href="https://1drv.ms/v/s!AlhiHP7f0ZGDh6Qba-OCP8ooxPE_nw?e=SoEhmh">https://1drv.ms/v/s!AlhiHP7f0ZGDh6Qba-O … w?e=SoEhmh</a></p>]]></description>
			<author><![CDATA[null@example.com (brian.zaballa)]]></author>
			<pubDate>Sat, 02 Mar 2024 06:59:59 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50393#p50393</guid>
		</item>
		<item>
			<title><![CDATA[Re: Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50390#p50390</link>
			<description><![CDATA[<p>Similar errors (“Invalid default value for &#039;Date_Column’) occur if the table has already been created in the database. <br />Both for SQLite and MYSQL/MARIADB.<br />I was unable to reproduce your situation for both DATE and ROLES. <br />All tables are created without errors if the database is clean. <br />After creating the tables, an attempt to set the field flag to mandatory results in an error (“Invalid default value ....)<br />You can attach an example or describe step by step how and what you do to reproduce your situation.</p>]]></description>
			<author><![CDATA[null@example.com (sparrow)]]></author>
			<pubDate>Fri, 01 Mar 2024 10:26:03 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50390#p50390</guid>
		</item>
		<item>
			<title><![CDATA[Re: Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50389#p50389</link>
			<description><![CDATA[<p>@Sparrow </p><p>Yes it does but then, if you set a date column not null, you must set a default value and the default value &#039;now&#039; that works in SQLite does is not accepted by MysQL/MariaDB, there is an error and the table cannot be created,&nbsp; hence my answer with the correct format above your comment.</p><p>Another hiccup when connecting to a fresh database with no tables in MySQL/MariaDB from a MVD project, it tries to create twice the table &quot;_user&quot;, throws a duplicate error and creates a useless table &quot;_mvd_roles&quot;. This never happens when connecting to an empty database from a compiled project. I tried it multiples times when testing my Delete - Import routine. You can also, as I mentioned before, connect the application to an already filled up database containing the exact structure required with no problem at all.</p><p>The subject of this post was really about the default value of a Date column when not null is forced in MySQL.</p>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Thu, 29 Feb 2024 21:32:26 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50389#p50389</guid>
		</item>
		<item>
			<title><![CDATA[Re: Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50388#p50388</link>
			<description><![CDATA[<p>If you create tables in a MYSQL/MARIADB database, you are required to create a connection (name/password and database name) without creating tables in third-party programs. When you start the program and connect to the database, MVD will automatically create tables in your database (subject to all permissions in MYSQL/MARIADB). There are no problems with dates in MYSQL/MARIADB from versions 5.6 to 8 or 10 in MYSQL/MARIADB. Just tested. Brian right</p>]]></description>
			<author><![CDATA[null@example.com (sparrow)]]></author>
			<pubDate>Thu, 29 Feb 2024 20:44:01 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50388#p50388</guid>
		</item>
		<item>
			<title><![CDATA[Re: Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50386#p50386</link>
			<description><![CDATA[<p>I am using MariaDB 10.11.2 and I found the default value that works is : &quot;0000-00-00&quot; which makes sense considering that it matches the default date format.</p>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Thu, 29 Feb 2024 16:03:32 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50386#p50386</guid>
		</item>
		<item>
			<title><![CDATA[Re: Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50381#p50381</link>
			<description><![CDATA[<div class="quotebox"><cite>tcoton wrote:</cite><blockquote><p>Yes, I tried zero and I get the same error saying that it is a wrong default value for a date. However, removing the non null constraint, then modifying the table with the right parameters within MySQL does the trick. It does work also to create the table directly in MySQL before connecting the app, it is just more cumbersome.</p></blockquote></div><p>Maybe something about mysql version. I&#039;m using 5.6.51.</p>]]></description>
			<author><![CDATA[null@example.com (brian.zaballa)]]></author>
			<pubDate>Thu, 29 Feb 2024 05:10:26 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50381#p50381</guid>
		</item>
		<item>
			<title><![CDATA[Re: Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50380#p50380</link>
			<description><![CDATA[<p>Yes, I tried zero and I get the same error saying that it is a wrong default value for a date. However, removing the non null constraint, then modifying the table with the right parameters within MySQL does the trick. It does work also to create the table directly in MySQL before connecting the app, it is just more cumbersome.</p>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Wed, 28 Feb 2024 23:17:56 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50380#p50380</guid>
		</item>
		<item>
			<title><![CDATA[Re: Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50338#p50338</link>
			<description><![CDATA[<div class="quotebox"><cite>tcoton wrote:</cite><blockquote><p>Hi all,</p><p>I am trying to migrate an application that always was working with Sqlite which contains 2 Date columns that should not be null. While it was working fine with Sqlite which stores dates as text, the creation of these columns is problematic when connecting to a blank MySql database when Myvisualdatabase tries to create the tables. It trows the infamous &quot;Invalid default value for &#039;Date_Column&#039;. </p><p>I have tried to change the default value with &quot;CURRENT_DATE&quot; or &quot;CURRENT_TIMESTAMP&quot; in MyVisualDatabase with no luck, I still get the same error when creating the tables in MySQL. Any experience on anyone side?</p></blockquote></div><p>Have you tried setting the default value to zero (0)? basically datetime in mysql is just a float</p>]]></description>
			<author><![CDATA[null@example.com (brian.zaballa)]]></author>
			<pubDate>Fri, 23 Feb 2024 12:39:23 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50338#p50338</guid>
		</item>
		<item>
			<title><![CDATA[Migrating to MySQL default value for Date not null?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50329#p50329</link>
			<description><![CDATA[<p>Hi all,</p><p>I am trying to migrate an application that always was working with Sqlite which contains 2 Date columns that should not be null. While it was working fine with Sqlite which stores dates as text, the creation of these columns is problematic when connecting to a blank MySql database when Myvisualdatabase tries to create the tables. It trows the infamous &quot;Invalid default value for &#039;Date_Column&#039;. </p><p>I have tried to change the default value with &quot;CURRENT_DATE&quot; or &quot;CURRENT_TIMESTAMP&quot; in MyVisualDatabase with no luck, I still get the same error when creating the tables in MySQL. Any experience on anyone side?</p>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Tue, 20 Feb 2024 22:12:56 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50329#p50329</guid>
		</item>
	</channel>
</rss>
