DB change c_survey_invite.reminder_date can be null

pull/2744/head
Julio Montoya 7 years ago
parent 540e0a04b0
commit 5411926e80
  1. 3
      src/CoreBundle/Migrations/Schema/V200/Version20.php
  2. 28
      src/CourseBundle/Entity/CSurveyAnswer.php
  3. 2
      src/CourseBundle/Entity/CSurveyInvitation.php

@ -213,6 +213,9 @@ class Version20 extends AbstractMigrationChamilo
$this->addSql('UPDATE user SET created_at = registration_date WHERE CAST(created_at AS CHAR(20)) = "0000-00-00 00:00:00"');
$this->addSql('UPDATE user SET updated_at = registration_date WHERE CAST(updated_at AS CHAR(20)) = "0000-00-00 00:00:00"');
$this->addSql('ALTER TABLE c_survey_invitation CHANGE reminder_date reminder_date DATETIME DEFAULT NULL');
$this->addSql('UPDATE c_survey_invitation SET reminder_date = NULL WHERE CAST(reminder_date AS CHAR(20)) = "0000-00-00 00:00:00"');
/*$table = $schema->getTable('course_rel_class');
if (!$table->hasColumn('c_id')) {
$this->addSql("ALTER TABLE course_rel_class ADD c_id int NOT NULL");

@ -76,6 +76,34 @@ class CSurveyAnswer
*/
protected $user;
/**
* CSurveyAnswer constructor.
*/
public function __construct()
{
$this->answerId = 0;
}
/**
* @return int
*/
public function getIid(): int
{
return $this->iid;
}
/**
* @param int $iid
*
* @return CSurveyAnswer
*/
public function setIid(int $iid): CSurveyAnswer
{
$this->iid = $iid;
return $this;
}
/**
* Set surveyId.
*

@ -74,7 +74,7 @@ class CSurveyInvitation
/**
* @var \DateTime
*
* @ORM\Column(name="reminder_date", type="datetime", nullable=false)
* @ORM\Column(name="reminder_date", type="datetime", nullable=true)
*/
protected $reminderDate;

Loading…
Cancel
Save