Rename thd segment desc field to description to avoid SQL errors
authorclebeaupin
Wed, 24 Mar 2010 11:47:38 +0100
changeset 17 b40169630952
parent 16 1cff4b07c3aa
child 18 a4385e322356
Rename thd segment desc field to description to avoid SQL errors
web/thdProject/config/doctrine/schema.yml
web/thdProject/data/sql/schema.sql
web/thdProject/lib/filter/doctrine/base/BaseThdFilmFormFilter.class.php
web/thdProject/lib/filter/doctrine/base/BaseThdSegmentFormFilter.class.php
web/thdProject/lib/form/doctrine/base/BaseThdSegmentForm.class.php
web/thdProject/lib/model/doctrine/base/BaseThdSegment.class.php
--- a/web/thdProject/config/doctrine/schema.yml	Wed Mar 24 06:55:16 2010 +0100
+++ b/web/thdProject/config/doctrine/schema.yml	Wed Mar 24 11:47:38 2010 +0100
@@ -70,7 +70,7 @@
     tags:
       type: string(1024)
       notnull: false
-    desc:
+    description:
       type: string(2147483647)
       notnull: false
     video_ref:
--- a/web/thdProject/data/sql/schema.sql	Wed Mar 24 06:55:16 2010 +0100
+++ b/web/thdProject/data/sql/schema.sql	Wed Mar 24 11:47:38 2010 +0100
@@ -1,7 +1,7 @@
-CREATE TABLE thd_film (id INT, ref INT NOT NULL, title VARCHAR(255) NOT NULL, pitch TEXT NOT NULL, duration INT NOT NULL, directors TEXT NOT NULL, actors TEXT NOT NULL, slug_url VARCHAR(255) NOT NULL, original_title VARCHAR(255), production_year BIGINT, uniqueid VARCHAR(36) NOT NULL, PRIMARY KEY(id)) ENGINE = INNODB;
+CREATE TABLE thd_film (id INT, ref INT NOT NULL, title VARCHAR(255) NOT NULL, pitch TEXT NOT NULL, duration INT NOT NULL, directors TEXT NOT NULL, actors TEXT NOT NULL, slug_url VARCHAR(255) NOT NULL, original_title VARCHAR(255), production_year BIGINT, uniqueid VARCHAR(36) NOT NULL, UNIQUE INDEX uniqueidindex_idx (uniqueid), PRIMARY KEY(id)) ENGINE = INNODB;
 CREATE TABLE thd_image (id INT AUTO_INCREMENT, film_ref INT NOT NULL, type TINYINT NOT NULL, file VARCHAR(255) NOT NULL, INDEX film_ref_idx (film_ref), PRIMARY KEY(id)) ENGINE = INNODB;
-CREATE TABLE thd_segment (id INT AUTO_INCREMENT, title VARCHAR(255) NOT NULL, video_ref INT NOT NULL, start DOUBLE NOT NULL, end DOUBLE NOT NULL, user_id INT NOT NULL, creation_date DATETIME NOT NULL, uniqueid VARCHAR(36) NOT NULL, INDEX video_ref_idx (video_ref), PRIMARY KEY(id)) ENGINE = INNODB;
-CREATE TABLE thd_video (id INT AUTO_INCREMENT, ref INT NOT NULL, film_ref INT NOT NULL, file VARCHAR(255) NOT NULL, title VARCHAR(255), INDEX ref_idx (ref), INDEX film_ref_idx (film_ref), PRIMARY KEY(id)) ENGINE = INNODB;
+CREATE TABLE thd_video (id INT AUTO_INCREMENT, ref INT NOT NULL, film_ref INT NOT NULL, file VARCHAR(255) NOT NULL, title VARCHAR(255), INDEX film_ref_idx (film_ref), PRIMARY KEY(id)) ENGINE = INNODB;
+CREATE TABLE thd_segment (id INT AUTO_INCREMENT, title VARCHAR(255), tags TEXT, description TEXT, video_ref INT NOT NULL, start DOUBLE NOT NULL, end DOUBLE NOT NULL, user_id INT NOT NULL, creation_date DATETIME NOT NULL, uniqueid VARCHAR(36) NOT NULL, UNIQUE INDEX uniqueidindex_idx (uniqueid), INDEX video_ref_idx (video_ref), PRIMARY KEY(id)) ENGINE = INNODB;
 ALTER TABLE thd_image ADD FOREIGN KEY (film_ref) REFERENCES thd_film(ref);
+ALTER TABLE thd_video ADD FOREIGN KEY (film_ref) REFERENCES thd_film(ref);
 ALTER TABLE thd_segment ADD FOREIGN KEY (video_ref) REFERENCES thd_video(ref);
-ALTER TABLE thd_video ADD FOREIGN KEY (film_ref) REFERENCES thd_film(ref);
--- a/web/thdProject/lib/filter/doctrine/base/BaseThdFilmFormFilter.class.php	Wed Mar 24 06:55:16 2010 +0100
+++ b/web/thdProject/lib/filter/doctrine/base/BaseThdFilmFormFilter.class.php	Wed Mar 24 11:47:38 2010 +0100
@@ -23,6 +23,7 @@
       'slug_url'        => new sfWidgetFormFilterInput(),
       'original_title'  => new sfWidgetFormFilterInput(),
       'production_year' => new sfWidgetFormFilterInput(),
+      'uniqueid'        => new sfWidgetFormFilterInput(),
     ));
 
     $this->setValidators(array(
@@ -35,6 +36,7 @@
       'slug_url'        => new sfValidatorPass(array('required' => false)),
       'original_title'  => new sfValidatorPass(array('required' => false)),
       'production_year' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
+      'uniqueid'        => new sfValidatorPass(array('required' => false)),
     ));
 
     $this->widgetSchema->setNameFormat('thd_film_filters[%s]');
@@ -62,6 +64,7 @@
       'slug_url'        => 'Text',
       'original_title'  => 'Text',
       'production_year' => 'Number',
+      'uniqueid'        => 'Text',
     );
   }
 }
\ No newline at end of file
--- a/web/thdProject/lib/filter/doctrine/base/BaseThdSegmentFormFilter.class.php	Wed Mar 24 06:55:16 2010 +0100
+++ b/web/thdProject/lib/filter/doctrine/base/BaseThdSegmentFormFilter.class.php	Wed Mar 24 11:47:38 2010 +0100
@@ -15,20 +15,26 @@
   {
     $this->setWidgets(array(
       'title'         => new sfWidgetFormFilterInput(),
+      'tags'          => new sfWidgetFormFilterInput(),
+      'description'   => new sfWidgetFormFilterInput(),
       'video_ref'     => new sfWidgetFormDoctrineChoice(array('model' => 'ThdVideo', 'add_empty' => true)),
       'start'         => new sfWidgetFormFilterInput(),
       'end'           => new sfWidgetFormFilterInput(),
       'user_id'       => new sfWidgetFormFilterInput(),
       'creation_date' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
+      'uniqueid'      => new sfWidgetFormFilterInput(),
     ));
 
     $this->setValidators(array(
       'title'         => new sfValidatorPass(array('required' => false)),
+      'tags'          => new sfValidatorPass(array('required' => false)),
+      'description'   => new sfValidatorPass(array('required' => false)),
       'video_ref'     => new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'ThdVideo', 'column' => 'id')),
       'start'         => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
       'end'           => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
       'user_id'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
       'creation_date' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
+      'uniqueid'      => new sfValidatorPass(array('required' => false)),
     ));
 
     $this->widgetSchema->setNameFormat('thd_segment_filters[%s]');
@@ -48,11 +54,14 @@
     return array(
       'id'            => 'Number',
       'title'         => 'Text',
+      'tags'          => 'Text',
+      'description'   => 'Text',
       'video_ref'     => 'ForeignKey',
       'start'         => 'Number',
       'end'           => 'Number',
       'user_id'       => 'Number',
       'creation_date' => 'Date',
+      'uniqueid'      => 'Text',
     );
   }
 }
\ No newline at end of file
--- a/web/thdProject/lib/form/doctrine/base/BaseThdSegmentForm.class.php	Wed Mar 24 06:55:16 2010 +0100
+++ b/web/thdProject/lib/form/doctrine/base/BaseThdSegmentForm.class.php	Wed Mar 24 11:47:38 2010 +0100
@@ -15,7 +15,7 @@
       'id'            => new sfWidgetFormInputHidden(),
       'title'         => new sfWidgetFormInput(),
       'tags'          => new sfWidgetFormTextarea(),
-      'desc'          => new sfWidgetFormTextarea(),
+      'description'   => new sfWidgetFormTextarea(),
       'video_ref'     => new sfWidgetFormDoctrineChoice(array('model' => 'ThdVideo', 'add_empty' => false)),
       'start'         => new sfWidgetFormInput(),
       'end'           => new sfWidgetFormInput(),
@@ -28,7 +28,7 @@
       'id'            => new sfValidatorDoctrineChoice(array('model' => 'ThdSegment', 'column' => 'id', 'required' => false)),
       'title'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
       'tags'          => new sfValidatorString(array('max_length' => 1024, 'required' => false)),
-      'desc'          => new sfValidatorString(array('max_length' => 2147483647, 'required' => false)),
+      'description'   => new sfValidatorString(array('max_length' => 2147483647, 'required' => false)),
       'video_ref'     => new sfValidatorDoctrineChoice(array('model' => 'ThdVideo')),
       'start'         => new sfValidatorNumber(),
       'end'           => new sfValidatorNumber(),
--- a/web/thdProject/lib/model/doctrine/base/BaseThdSegment.class.php	Wed Mar 24 06:55:16 2010 +0100
+++ b/web/thdProject/lib/model/doctrine/base/BaseThdSegment.class.php	Wed Mar 24 11:47:38 2010 +0100
@@ -22,7 +22,7 @@
              'type' => 'string',
              'length' => '1024',
              ));
-        $this->hasColumn('desc', 'string', 2147483647, array(
+        $this->hasColumn('description', 'string', 2147483647, array(
              'type' => 'string',
              'length' => '2147483647',
              ));