Adding DB changes from 1.11.x

pull/2944/head
Julio Montoya 6 years ago
parent 75a1537a35
commit a3ea75af0e
  1. 48
      src/CoreBundle/Entity/GradebookResultAttempt.php
  2. 76
      src/CoreBundle/Entity/MailTemplate.php
  3. 193
      src/CoreBundle/Entity/TrackEAccessComplete.php
  4. 7
      src/CoreBundle/Migrations/Schema/V200/Version20.php

@ -0,0 +1,48 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
/**
* GradebookResultAttempt.
*
* @ORM\Table(name="gradebook_result_attempt")
* @ORM\Entity
*/
class GradebookResultAttempt
{
use TimestampableEntity;
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var bool
*
* @ORM\Column(name="comment", type="text", nullable=true)
*/
protected $comment;
/**
* @var float
*
* @ORM\Column(name="score", type="float", nullable=true)
*/
protected $score;
/**
* @var int
*
* @ORM\Column(name="result_id", type="integer", nullable=false)
*/
protected $resultId;
}

@ -0,0 +1,76 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Doctrine\ORM\Mapping as ORM;
/**
* MailTemplate.
*
* @ORM\Table(name="mail_template")
* @ORM\Entity
*/
class MailTemplate
{
use TimestampableEntity;
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var bool
*
* @ORM\Column(name="name", type="string", nullable=true)
*/
protected $name;
/**
* @var string
*
* @ORM\Column(name="template", type="text", nullable=true)
*/
protected $template;
/**
* @var bool
*
* @ORM\Column(name="type", type="string", nullable=false)
*/
protected $type;
/**
* @var float
*
* @ORM\Column(name="score", type="float", nullable=true)
*/
protected $authorId;
/**
* @var int
*
* @ORM\Column(name="result_id", type="integer", nullable=false)
*/
protected $urlId;
/**
* @var bool
*
* @ORM\Column(name="default_template", type="boolean", nullable=false)
*/
protected $defaultTemplate;
/**
* @var bool
*
* @ORM\Column(name="system", type="integer", nullable=false, options={"default":0})
*/
protected $system;
}

@ -0,0 +1,193 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* TrackEDownloads.
*
* @ORM\Table(name="track_e_downloads", indexes={
* @ORM\Index(name="idx_ted_user_id", columns={"down_user_id"}),
* @ORM\Index(name="idx_ted_c_id", columns={"c_id"}),
* @ORM\Index(name="down_session_id", columns={"down_session_id"})
* })
* @ORM\Entity
*/
class TrackEAccessComplete
{
/**
* @var int
*
* @ORM\Column(name="down_id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $downId;
/**
* @var int
*
* @ORM\Column(name="down_user_id", type="integer", nullable=true)
*/
protected $downUserId;
/**
* @var \DateTime
*
* @ORM\Column(name="down_date", type="datetime", nullable=false)
*/
protected $downDate;
/**
* @var int
*
* @ORM\Column(name="c_id", type="integer", nullable=false)
*/
protected $cId;
/**
* @var string
*
* @ORM\Column(name="down_doc_path", type="string", length=255, nullable=false)
*/
protected $downDocPath;
/**
* @var int
*
* @ORM\Column(name="down_session_id", type="integer", nullable=false)
*/
protected $downSessionId;
/**
* Set downUserId.
*
* @param int $downUserId
*
* @return TrackEDownloads
*/
public function setDownUserId($downUserId)
{
$this->downUserId = $downUserId;
return $this;
}
/**
* Get downUserId.
*
* @return int
*/
public function getDownUserId()
{
return $this->downUserId;
}
/**
* Set downDate.
*
* @param \DateTime $downDate
*
* @return TrackEDownloads
*/
public function setDownDate($downDate)
{
$this->downDate = $downDate;
return $this;
}
/**
* Get downDate.
*
* @return \DateTime
*/
public function getDownDate()
{
return $this->downDate;
}
/**
* Set cId.
*
* @param int $cId
*
* @return TrackEDownloads
*/
public function setCId($cId)
{
$this->cId = $cId;
return $this;
}
/**
* Get cId.
*
* @return int
*/
public function getCId()
{
return $this->cId;
}
/**
* Set downDocPath.
*
* @param string $downDocPath
*
* @return TrackEDownloads
*/
public function setDownDocPath($downDocPath)
{
$this->downDocPath = $downDocPath;
return $this;
}
/**
* Get downDocPath.
*
* @return string
*/
public function getDownDocPath()
{
return $this->downDocPath;
}
/**
* Set downSessionId.
*
* @param int $downSessionId
*
* @return TrackEDownloads
*/
public function setDownSessionId($downSessionId)
{
$this->downSessionId = $downSessionId;
return $this;
}
/**
* Get downSessionId.
*
* @return int
*/
public function getDownSessionId()
{
return $this->downSessionId;
}
/**
* Get downId.
*
* @return int
*/
public function getDownId()
{
return $this->downId;
}
}

@ -229,6 +229,13 @@ class Version20 extends AbstractMigrationChamilo
);
}
$table = $schema->hasTable('gradebook_result_attempt');
if ($table === false) {
$this->addSql(
'CREATE TABLE gradebook_result_attempt (id INT AUTO_INCREMENT NOT NULL, comment LONGTEXT DEFAULT NULL, score DOUBLE PRECISION DEFAULT NULL, result_id INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
);
}
/*$table = $schema->getTable('course_rel_class');
if (!$table->hasColumn('c_id')) {
$this->addSql("ALTER TABLE course_rel_class ADD c_id int NOT NULL");

Loading…
Cancel
Save