Use CURRENT_TIMESTAMP as default value for timestampable entries.

Furthermore the database migration generation is now detects correctly if there were no changes to DB.
This commit is contained in:
Jan Böhmer 2019-09-02 15:03:20 +02:00
parent 0ec73618ac
commit 4026f6be3f
6 changed files with 97 additions and 8 deletions

View file

@ -85,7 +85,7 @@ class AttachmentType extends StructuralDBElement
/**
* @var string
* @ORM\Column(type="string", length=65535)
* @ORM\Column(type="text")
*/
protected $filetype_filter;

View file

@ -42,14 +42,14 @@ trait TimestampTrait
{
/**
* @var \DateTime The date when this element was modified the last time.
* @ORM\Column(type="datetimetz", name="last_modified")
* @ORM\Column(type="datetime", name="last_modified", options={"default"="CURRENT_TIMESTAMP"})
* @Groups({"extended", "full"})
*/
protected $lastModified;
/**
* @var \DateTime The date when this element was created.
* @ORM\Column(type="datetimetz", name="datetime_added")
* @ORM\Column(type="datetime", name="datetime_added", options={"default"="CURRENT_TIMESTAMP"})
* @Groups({"extended", "full"})
*/
protected $addedDate;

View file

@ -85,7 +85,7 @@ class Footprint extends PartsContainingDBElement
/**
* @var string
* @ORM\Column(type="string", length=65536)
* @ORM\Column(type="text")
*/
protected $filename;
@ -96,7 +96,7 @@ class Footprint extends PartsContainingDBElement
/**
* @var string
* @ORM\Column(type="string", length=65536)
* @ORM\Column(type="text")
*/
protected $filename_3d;

View file

@ -148,14 +148,14 @@ class Part extends AttachmentContainingDBElement
/**
* @ColumnSecurity(type="datetime")
* @ORM\Column(type="datetimetz", name="datetime_added")
* @ORM\Column(type="datetime", name="datetime_added", options={"default"="CURRENT_TIMESTAMP"})
*/
protected $addedDate;
/**
* @var \DateTime The date when this element was modified the last time.
* @ORM\Column(type="datetimetz", name="last_modified")
* @ColumnSecurity(type="datetime")
* @ORM\Column(type="datetime", name="last_modified", options={"default"="CURRENT_TIMESTAMP"})
*/
protected $lastModified;

View file

@ -66,7 +66,7 @@ class PartLot extends DBElement
/**
* @var ?\DateTime Set a time until when the lot must be used.
* Set to null, if the lot can be used indefinitley.
* @ORM\Column(type="datetimetz", name="expiration_date", nullable=true)
* @ORM\Column(type="datetime", name="expiration_date", nullable=true)
*/
protected $expiration_date;