Adding table extra_field_option_rel_field_option in order to manage extrafield options per role à la Redmine

skala
Julio Montoya 12 years ago
parent 32438ddfc4
commit 96d0dbcb36
  1. 154
      main/inc/Entity/ExtraFieldOptionRelFieldOption.php
  2. 4
      main/install/1.10.0/db_main.sql
  3. 4
      main/install/1.10.0/migrate-db-1.9.0-1.10.0-pre.sql

@ -0,0 +1,154 @@
<?php
namespace Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* ExtraFieldOptionRelFieldOption
*
* @ORM\Table(name="extra_field_option_rel_field_option", uniqueConstraints={@ORM\UniqueConstraint(name="idx", columns={"field_id", "role_id", "field_option_id", "related_field_option_id"})})
* @ORM\Entity
*/
class ExtraFieldOptionRelFieldOption
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var integer
*
* @ORM\Column(name="field_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
*/
private $fieldId;
/**
* @var integer
*
* @ORM\Column(name="field_option_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
*/
private $fieldOptionId;
/**
* @var integer
*
* @ORM\Column(name="related_field_option_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
*/
private $relatedFieldOptionId;
/**
* @var integer
*
* @ORM\Column(name="role_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
*/
private $roleId;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set fieldId
*
* @param integer $fieldId
* @return EntityExtraFieldOptionRelFieldOption
*/
public function setFieldId($fieldId)
{
$this->fieldId = $fieldId;
return $this;
}
/**
* Get fieldId
*
* @return integer
*/
public function getFieldId()
{
return $this->fieldId;
}
/**
* Set fieldOptionId
*
* @param integer $fieldOptionId
* @return EntityExtraFieldOptionRelFieldOption
*/
public function setFieldOptionId($fieldOptionId)
{
$this->fieldOptionId = $fieldOptionId;
return $this;
}
/**
* Get fieldOptionId
*
* @return integer
*/
public function getFieldOptionId()
{
return $this->fieldOptionId;
}
/**
* Set relatedFieldOptionId
*
* @param integer $relatedFieldOptionId
* @return EntityExtraFieldOptionRelFieldOption
*/
public function setRelatedFieldOptionId($relatedFieldOptionId)
{
$this->relatedFieldOptionId = $relatedFieldOptionId;
return $this;
}
/**
* Get relatedFieldOptionId
*
* @return integer
*/
public function getRelatedFieldOptionId()
{
return $this->relatedFieldOptionId;
}
/**
* Set roleId
*
* @param integer $roleId
* @return EntityExtraFieldOptionRelRole
*/
public function setRoleId($roleId)
{
$this->roleId = $roleId;
return $this;
}
/**
* Get roleId
*
* @return integer
*/
public function getRoleId()
{
return $this->roleId;
}
}

@ -3496,5 +3496,7 @@ ALTER TABLE question_field_options ADD INDEX idx_question_field_options_field_id
ALTER TABLE question_field_values ADD INDEX idx_question_field_values_question_id(question_id);
ALTER TABLE question_field_values ADD INDEX idx_question_field_values_field_id(field_id);
CREATE TABLE extra_field_option_rel_field_option(id INT auto_increment, role_id INT, field_id INT, field_option_id INT, related_field_option_id INT, PRIMARY KEY(id));
-- Do not move this
UPDATE settings_current SET selected_value = '1.10.006' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.10.0.007' WHERE variable = 'chamilo_database_version';

@ -263,5 +263,7 @@ ALTER TABLE c_quiz_category MODIFY COLUMN parent_id int default null;
ALTER TABLE track_e_course_access MODIFY COLUMN course_access_id bigint unsigned auto_increment;
CREATE TABLE extra_field_option_rel_field_option(id INT auto_increment, role_id INT, field_id INT, field_option_id INT, related_field_option_id INT, PRIMARY KEY(id));
-- Do not move this
UPDATE settings_current SET selected_value = '1.10.0.006' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.10.0.007' WHERE variable = 'chamilo_database_version';

Loading…
Cancel
Save