1
+ <?php
2
+
3
+ use Magento \Framework \DB \Ddl \Table ;
4
+
5
+ require dirname (__FILE__ ) . '/app/bootstrap.php ' ;
6
+ $ bootstrap = \Magento \Framework \App \Bootstrap::create (BP , $ _SERVER );
7
+
8
+ class Outslide extends \Magento \Framework \App \Http
9
+ implements \Magento \Framework \AppInterface {
10
+ public function launch ()
11
+ {
12
+ $ installer = $ this ->_objectManager ->create ('\Magento\Setup\Module\Setup ' );
13
+
14
+ $ installer ->startSetup ();
15
+
16
+ $ table = $ installer ->getConnection ()
17
+ ->newTable ($ installer ->getTable ('magepow_comments ' ))
18
+ ->addColumn (
19
+ 'comment_id ' ,
20
+ Table::TYPE_INTEGER ,
21
+ null ,
22
+ ['identity ' => true , 'nullable ' => false , 'primary ' => true ],
23
+ 'Comment ID '
24
+ )
25
+ ->addColumn ('title ' , Table::TYPE_TEXT , 255 , ['nullable ' => true , 'default ' => null ], 'Title ' )
26
+ ->addColumn ('status ' , Table::TYPE_SMALLINT , null , ['nullable ' => false , 'default ' => '1 ' ], 'Status ' )
27
+ ->addColumn ('store ' , Table::TYPE_TEXT , 255 , ['nullable ' => true , 'default ' => '0 ' ])
28
+ ->addColumn ('created_time ' , Table::TYPE_TIMESTAMP , null , ['nullable ' => false , 'default ' => Table::TIMESTAMP_INIT ], 'Created Time ' )
29
+ ->addColumn ('update_time ' , Table::TYPE_DATETIME , null , ['nullable ' => true , 'default ' => null ], 'Update Time ' )
30
+ ->addIndex ($ installer ->getIdxName ('comment_id ' , ['comment_id ' ]), ['comment_id ' ])
31
+ ->setComment ('Magepow Comments ' );
32
+
33
+ $ installer ->getConnection ()->createTable ($ table );
34
+
35
+ $ installer ->endSetup ();
36
+
37
+ echo 'Done! ' ;
38
+ //the method must end with this line
39
+ return $ this ->_response ;
40
+ }
41
+ }
42
+
43
+ /** @var \Magento\Framework\App\Http $app */
44
+ $ app = $ bootstrap ->createApplication ('Outslide ' );
45
+ $ bootstrap ->run ($ app );
0 commit comments