startSetup(); $adapter = $installer->getConnection(); $tableNameAttribute = $installer->getTable('orange35_accumulativepromo/accumulativepromo'); if (!$adapter->isTableExists($tableNameAttribute)) { $table = $adapter->newTable($tableNameAttribute) ->addColumn('promo_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( 'unsigned' => true, 'nullable' => false, 'primary' => true, ), 'Promo id') ->addColumn('orders_period', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( 'unsigned' => true, 'default' => '0', ), 'Orders Period') ->addColumn('orders_total_start', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( 'unsigned' => true, 'default' => '0', ), 'Orders Total Start') ->addColumn('orders_total_end', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( 'unsigned' => true, 'default' => '0', ), 'Orders Total End') //->addIndex($installer->getIdxName('orange35_colorpicker/attribute', array('is_colorpicker')), array('is_colorpicker')) ->setComment('Accumulative Discounts Data'); $adapter->createTable($table); } $adapter = $installer->getConnection(); $tableNameAttribute = $installer->getTable('orange35_accumulativepromo/orderstotalperiod'); if (!$adapter->isTableExists($tableNameAttribute)) { $table = $adapter->newTable($tableNameAttribute) ->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( 'auto_increment' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true, ), 'Id') ->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( 'unsigned' => true, 'default' => '0', ), 'Customer Id') ->addColumn('period', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( 'unsigned' => true, 'default' => '0', ), 'Orders Period') ->addColumn('orders_total', Varien_Db_Ddl_Table::TYPE_FLOAT, null, array( 'unsigned' => true, 'default' => '0', ), 'Orders Grand Total for Period') ->addColumn('date_modified', Varien_Db_Ddl_Table::TYPE_DATETIME, null, array( 'unsigned' => true, ), 'Date Modified') //->addIndex($installer->getIdxName('orange35_colorpicker/attribute', array('is_colorpicker')), array('is_colorpicker')) ->setComment('Accumulative Discounts Data'); $adapter->createTable($table); } $installer->endSetup();