Skip to content

Instantly share code, notes, and snippets.

@ryaan-anthony
Created September 15, 2013 15:18
Show Gist options
  • Select an option

  • Save ryaan-anthony/6571690 to your computer and use it in GitHub Desktop.

Select an option

Save ryaan-anthony/6571690 to your computer and use it in GitHub Desktop.
<?php
$installer = $this;
$installer->startSetup();
$installer->run("
DROP TABLE IF EXISTS {$installer->getTable('weblog/blogpost')};
CREATE TABLE {$installer->getTable('weblog/blogpost')} (
`blogpost_id` int(11) NOT NULL auto_increment,
`title` text,
`post` text,
`date` datetime default NULL,
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`blogpost_id`)
);
INSERT INTO {$installer->getTable('weblog/blogpost')}
VALUES (1, 'My New Title','This is a blog post','2010-07-01 00:00:00','2010-07-02 23:12:30');
INSERT INTO {$installer->getTable('weblog/blogpost')}
VALUES (2, 'Hello World!','Lorum Ipsums Sumthun','2010-07-01 00:00:00','2010-07-02 23:12:30');
");
$installer->endSetup();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment