From ae5ccb40f2a6a0150e7cd00419001594b5aed328 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Mon, 28 Sep 2020 07:52:00 +0000 Subject: [PATCH 1/2] Add date_create to Customer. #513 --- src/Entity/Customer.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Entity/Customer.php b/src/Entity/Customer.php index 9ba043c9..281c9fa9 100644 --- a/src/Entity/Customer.php +++ b/src/Entity/Customer.php @@ -6,6 +6,8 @@ use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; use Symfony\Component\Validator\Constraints as Assert; +use DateTime; + use App\Ramcar\CustomerClassification; /** @@ -184,6 +186,12 @@ class Customer */ protected $flag_dpa_consent; + // date customer was created + /** + * @ORM\Column(type="datetime") + */ + protected $date_create; + public function __construct() { $this->numbers = new ArrayCollection(); @@ -214,6 +222,8 @@ class Customer $this->flag_promo_email = false; $this->flag_promo_sms = false; $this->flag_dpa_consent = false; + + $this->date_create = new DateTime(); } public function getID() From 2d0b539f092b441aa7ea7094df099fb65343c9fa Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Mon, 28 Sep 2020 08:08:11 +0000 Subject: [PATCH 2/2] Add sql script to update date_create to current date for Customer. #513 --- initial_sql/sql_update_customer_date_create.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 initial_sql/sql_update_customer_date_create.sql diff --git a/initial_sql/sql_update_customer_date_create.sql b/initial_sql/sql_update_customer_date_create.sql new file mode 100644 index 00000000..50102db3 --- /dev/null +++ b/initial_sql/sql_update_customer_date_create.sql @@ -0,0 +1,2 @@ +UPDATE customer SET date_create=NOW() WHERE date_create="0000-00-00 00:00:00"; +