<?php

$this->startSetup();
$this->getConnection()->addColumn(
    $this->getTable('slideshow/slideshow'),
    'from_date',
    'datetime NULL default NULL'
);

$this->getConnection()->addColumn(
    $this->getTable('slideshow/slideshow'),
    'to_date',
    'datetime NULL default NULL'
);

$this->endSetup();

<?php
$installer = $this;
$installer->startSetup();

$installer->run("
    ALTER TABLE {$this->getTable('slideshow/slideshow')}
        ADD `from_date` datetime NULL default NULL,
        ADD `to_date` datetime NULL default NULL;
    ");
$installer->endSetup();
--- 
+++ 
@@ -1,10 +1,16 @@
 <?php
-$installer = $this;
-$installer->startSetup();
 
-$installer->run("
-    ALTER TABLE {$this->getTable('slideshow/slideshow')}
-        ADD `from_date` datetime NULL default NULL,
-        ADD `to_date` datetime NULL default NULL;
-    ");
-$installer->endSetup();
+$this->startSetup();
+$this->getConnection()->addColumn(
+    $this->getTable('slideshow/slideshow'),
+    'from_date',
+    'datetime NULL default NULL'
+);
+
+$this->getConnection()->addColumn(
+    $this->getTable('slideshow/slideshow'),
+    'to_date',
+    'datetime NULL default NULL'
+);
+
+$this->endSetup();
Change sql query to check if table already exist

Change sql query to check if table already exist