eiriksm / site-schema
允许您全面了解网站架构,例如用于CI
1.3.0
2023-07-20 06:30 UTC
Requires
- drush/drush: ~9 || ~10 || ~11 || ~12
Requires (Dev)
- phpunit/phpunit: ^6.5||^7||^8||^9
This package is auto-updated.
Last update: 2024-09-13 12:13:47 UTC
README
获取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+