-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.- creación de setUp Install Schema app/code/Pfay/Contacts/Setup/InstallSchema.php 2.- Actualizamos y compilamos con asignación de permisos php bin/magento module:enable Pfay_Contacts php bin/magento setup:upgrade php bin/magento setup:di:compile chmod -R 777 var/ pub/ 3.- Verificamos creación de tabla pfay_contacts en BDD ============= OPCIONAL ================================== SI NO SE CREO LA TABLA : 1.- Eliminamos registro desde la BDD : mysql> delete from setup_module where module like '%Pfay_Contacts'; Query OK, 1 row affected (0.04 sec) 2.- eliminadnos registro de modulo activo desde app/etc/config.php 3.- actualizamos , recompilamos y damos permisos php bin/magento module:enable Pfay_Contacts php bin/magento setup:upgrade php bin/magento setup:di:compile chmod -R 777 var/ pub/
- Loading branch information
1 parent
c221740
commit 08703f0
Showing
2 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
namespace Pfay\Contacts\Setup; | ||
|
||
use Magento\Framework\Setup\InstallSchemaInterface; | ||
use Magento\Framework\Setup\ModuleContextInterface; | ||
use Magento\Framework\Setup\SchemaSetupInterface; | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
*/ | ||
class InstallSchema implements InstallSchemaInterface | ||
{ | ||
/** | ||
* @param SchemaSetupInterface $setup | ||
* @param ModuleContextInterface $context | ||
* @throws \Zend_Db_Exception | ||
*/ | ||
|
||
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) | ||
{ | ||
$setup->startSetup(); | ||
/** | ||
* Create table 'pfay_contacts' | ||
*/ | ||
|
||
if (!$setup->getConnection()->isTableExists($setup->getTable('pfay_contacts'))) { | ||
$table = $setup->getConnection() | ||
->newTable($setup->getTable('pfay_contacts')) | ||
->addColumn( | ||
'pfay_contacts_id', | ||
\Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, | ||
null, | ||
['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], | ||
'Contacts ID' | ||
) | ||
->addColumn( | ||
'name', | ||
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT, | ||
100, | ||
['nullable' => false, 'default' => 'simple'], | ||
'Name' | ||
) | ||
->addColumn( | ||
'email', | ||
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT, | ||
100, | ||
['nullable' => false, 'default' => 'simple'], | ||
'Email' | ||
) | ||
->setComment('Pfay Contacts Table') | ||
->setOption('type', 'InnoDB') | ||
->setOption('charset', 'utf8'); | ||
|
||
$setup->getConnection()->createTable($table); | ||
} | ||
$setup->endSetup(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters