-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathInstallSchema.php
More file actions
executable file
·43 lines (37 loc) · 1.22 KB
/
InstallSchema.php
File metadata and controls
executable file
·43 lines (37 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace Comwrap\ElasticsuiteBlog\Setup;
use \Magento\Framework\Setup\InstallSchemaInterface;
use \Magento\Framework\Setup\ModuleContextInterface;
use \Magento\Framework\Setup\SchemaSetupInterface;
use \Magento\Eav\Setup\EavSetup;
#[\AllowDynamicProperties]
class InstallSchema implements InstallSchemaInterface
{
/**
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
* Installs DB schema for the module
*
* @param SchemaSetupInterface $setup The setup interface
* @param ModuleContextInterface $context The module Context
*
* @return void
*/
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$connection = $setup->getConnection();
$table = $setup->getTable('magefan_blog_post');
// Append a column 'is_searchable' into the db.
$connection->addColumn(
$table,
'is_searchable',
[
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN,
'nullable' => false,
'default' => '0',
'comment' => 'If post is searchable',
]
);
$setup->endSetup();
}
}