diff --git a/noahs_page_builder.module b/noahs_page_builder.module index 718345e..af242b2 100644 --- a/noahs_page_builder.module +++ b/noahs_page_builder.module @@ -1221,4 +1221,68 @@ function noahs_page_builder_block_access(Block $block, $operation, AccountInterf // Verificar si el módulo Commerce está instalado. return $module_handler->moduleExists($module); - } \ No newline at end of file + } + + /** + * Update base data tables. + */ + + function noahs_page_builder_update_8001() { + if (!\Drupal::database()->schema()->tableExists('noahs_page_builder_page')) { + $schema = [ + 'description' => 'Stores example person entries for demonstration purposes.', + 'fields' => [ + 'page_id' => [ + 'type' => 'serial', + 'not null' => TRUE, + 'description' => 'Primary Key: Unique noahs_page_builder ID.', + ], + 'did' => [ + 'type' => 'varchar', + 'length' => 56, + 'not null' => TRUE, + ], + 'uid' => [ + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => "Creator user's {users}.uid", + ], + 'nid' => [ + 'type' => 'varchar', + 'length' => 56, + 'not null' => TRUE, + 'default' => 0, + 'description' => "Creator from {node}.nid", + ], + 'langcode' => [ + 'type' => 'varchar', + 'length' => 12, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Language', + ], + 'settings' => [ + 'type' => 'text', + 'size' => 'big', + 'default' => '', + 'description' => 'Save the json-html', + ], + 'page_settings' => [ + 'type' => 'text', + 'size' => 'big', + 'default' => '', + 'description' => 'Save the json-html', + ], + ], + 'primary key' => ['page_id'], + ]; + + // Crea la tabla con el esquema definido. + \Drupal::database()->schema()->createTable('noahs_page_builder_page', $schema); + } + } + + + + \ No newline at end of file