eiriksm/site-schema

允许您全面了解网站架构,例如用于CI

安装次数: 1,047,279

依赖项: 0

建议者: 0

安全: 0

星级: 9

观察者: 1

分支: 1

公开问题: 2

类型:drupal-drush

1.3.0 2023-07-20 06:30 UTC

This package is auto-updated.

Last update: 2024-09-13 12:13:47 UTC


README

Test Packagist

获取Drupal网站架构的完整视图(更新和更新后)。

这可以用来始终检查您网站的数据库更新架构,以便您能够意识到更新对网站的影响。

例如,如果您正在接收贡献模块的自动化更新,可能希望不要自动合并和部署包含数据库更新的模块。

此命令输出您网站的完整视图,即所有模块的数据库架构版本和所有模块的post_update钩子。这样,您可以提交您网站的完整视图,如果文件中存在差异,则CI将失败。

安装

使用composer安装。

composer require eiriksm/site-schema

使用方法

$ drush site-schema --help
Get the site schema for the current site.

Examples:
  site:schema Get the complete schema in text

Options:
  --format[=FORMAT] The format to output. [default: "table"]
  --fields=FIELDS   Limit output to only the listed elements. Name top-level elements by key, e.g. "--fields=name,date", or use dot notation to select a nested element, e.g.
                    "--fields=a.b.c as example".
  --field=FIELD     Select just one field, and force format to 'string'.

Aliases: site-schema

示例

输出整个架构

$ drush site-schema
 ------------- -------------------------------- ---------------------------------------------------------------------------
  Type          Module                           Value
 ------------- -------------------------------- ---------------------------------------------------------------------------
  schema        admin_toolbar                    8001
  schema        admin_toolbar_tools              8000
  ... shortened here for convenience ...
  schema        views_ui                         8000
  post_update                                    block_content_post_update_add_views_reusable_filter
  post_update                                    block_post_update_disable_blocks_with_missing_contexts
  post_update                                    block_post_update_disabled_region_update
  post_update                                    block_post_update_fix_negate_in_conditions
  post_update                                    comment_post_update_add_ip_address_setting
  post_update                                    comment_post_update_enable_comment_admin_view
  ... and so on

以json格式输出整个架构

$ drush site-schema --format=json
[
    {
        "type": "schema",
        "module": "admin_toolbar",
        "value": "8001"
    },
    {
        "type": "schema",
        "module": "admin_toolbar_tools",
        "value": "8000"
    },
    ... And so on.

...或yaml格式

$ drush site-schema --format=yaml
-
  type: schema
  module: admin_toolbar
  value: '8001'
-
  type: schema
  module: admin_toolbar_tools
  value: '8000'
-
# And so on.

然后您可能希望将其输出到文件?只需这样做!

$ drush site-schema --format=json > site-schema.json

然后您可以提交该文件,并使用版本控制跟踪您的网站架构。

许可

GPL-2.0+