Fix c_forum_thread table - refs BT#9892 #TMI

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent e7f388f3e5
commit d34388a172
  1. 6
      main/install/database.sql
  2. 40
      src/Chamilo/CoreBundle/Migrations/Schema/V110/Version20150521113600.php
  3. 4
      src/Chamilo/CourseBundle/Entity/CForumThread.php

@ -3454,10 +3454,10 @@ CREATE TABLE c_forum_thread (
c_id INT NOT NULL,
thread_title varchar(255) default NULL,
forum_id int default NULL,
thread_replies int default 0,
thread_replies int UNSIGNED default 0,
thread_poster_id int default NULL,
thread_poster_name varchar(100) default '',
thread_views int default 0,
thread_views int UNSIGNED default 0,
thread_last_post int default NULL,
thread_date datetime default '0000-00-00 00:00:00',
thread_sticky tinyint unsigned default 0,
@ -4603,5 +4603,5 @@ CREATE TABLE c_attendance_calendar_rel_group (
-- Version
LOCK TABLES settings_current WRITE;
UPDATE settings_current SET selected_value = '1.10.0.39' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.10.0.40' WHERE variable = 'chamilo_database_version';
UNLOCK TABLES;

@ -0,0 +1,40 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Migrations\Schema\V110;
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
/**
* Username changes
*/
class Version20150521113600 extends AbstractMigrationChamilo
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
$this->addSql('ALTER TABLE c_forum_thread MODIFY thread_replies int UNSIGNED NOT NULL DEFAULT 0');
$this->addSql('ALTER TABLE c_forum_thread MODIFY thread_views int UNSIGNED NOT NULL DEFAULT 0');
$this->addSql("
UPDATE settings_current SET selected_value = '1.10.0.40' WHERE variable = 'chamilo_database_version'
");
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
$this->addSql('ALTER TABLE c_forum_thread MODIFY thread_replies int NULL');
$this->addSql('ALTER TABLE c_forum_thread MODIFY thread_views int NULL');
$this->addSql("
UPDATE settings_current SET selected_value = '1.10.0.39' WHERE variable = 'chamilo_database_version'
");
}
}

@ -53,7 +53,7 @@ class CForumThread
/**
* @var integer
*
* @ORM\Column(name="thread_replies", type="integer", nullable=true)
* @ORM\Column(name="thread_replies", type="integer", nullable=false, options={"unsigned":true, "default" = 0})
*/
private $threadReplies;
@ -74,7 +74,7 @@ class CForumThread
/**
* @var integer
*
* @ORM\Column(name="thread_views", type="integer", nullable=true)
* @ORM\Column(name="thread_views", type="integer", nullable=false, options={"unsigned":true, "default" = 0})
*/
private $threadViews;

Loading…
Cancel
Save