Commits

Evaldo Junior  committed bbad85f

Migration para a tabela de comentários.

Mudei o campo "datahora" no diagrama da tabela de comentário para
"publicacao"

  • Participants
  • Parent commits 66e0f58

Comments (0)

Files changed (3)

File application/config/migration.php

 | be upgraded / downgraded to.
 |
 */
-$config['migration_version'] = 1;
+$config['migration_version'] = 2;
 
 
 /*

File application/migrations/002_tabela_comentarios.php

+<?php
+
+class Migration_Tabela_comentarios extends CI_Migration {
+
+    public function up()
+    {
+        $this->dbforge->add_field(array(
+            'id' => array(
+                'type' => 'INT',
+                'constraint' => 9,
+                'unsigned' => TRUE,
+                'auto_increment' => TRUE
+            ),
+            'post_id' => array(
+                'type' => 'INT',
+                'constraint' => 9,
+                'unsigned' => TRUE
+            ),
+            'autor' => array(
+                'type' => 'VARCHAR',
+                'constraint' => 20
+            ),
+            'email_autor' => array(
+                'type' => 'VARCHAR',
+                'constraint' => 100
+            ),
+            'texto' => array(
+                'type' => 'TEXT'
+            ),
+            'publicacao' => array(
+                'type' => 'DATETIME'
+            )
+        ));
+
+        $this->dbforge->add_key('id', TRUE);
+
+        $this->dbforge->create_table('comentarios');
+    }
+
+    public function down()
+    {
+        $this->dbforge->drop_table('comentarios');
+    }
+}

File docs/mer.dia

Binary file modified.