定制 yourfrog/symfony-bundle_history-table 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yourfrog/symfony-bundle_history-table

Composer 安装命令:

composer require yourfrog/symfony-bundle_history-table

包简介

Bundle for add history table

README 文档

README

Support database

  • MySQL - Completed
  • Postgresql - Completed

Step 1: Use composer and enable Bundle

composer require yourfrog/symfony-bundle_history-table

Now, Composer will automatically download all required files, and install them for you. All that is left to do is to update your AppKernel.php file, and register the new bundle:

<?php

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new HistoryTableBundle\HistoryTableBundle(),
    // ...
);

Step2: Add command to your composer.json under "scripts" section for example

"scripts": {
	"rebuild": [
	    "php bin/console doctrine:schema:drop --force --full-database",
	    "php bin/console doctrine:schema:update --force",
	    "php bin/console app:triggers",
	    "php bin/console doctrine:fixtures:load --no-interaction"
	]
}

Information

After running command "app:triggers" bundle will create new history table and triggers in your database.

  • This bundle is a safty becouse when u are running multiple times command "app:triggers" this will not crush application on production.

For MYSQL

  • single table with prefix "history_" per entity
  • Trigger on "after insert" per entity with name "history_trigger_after_insert_{{ table_name }}" if argument "enable-insert" is set
  • Trigger on "after update" per entity with name "history_trigger_before_delete_{{ table_name }}"
  • Trigger on "before delete" per entity with name "history_trigger_after_update_{{ table_name }}"

Disable history table for entity

For disable create history table u must write annotations on ur entity "@DisableHistoryTable". I think this behavior will be best for application becouse u never missing create history table.

Avaiable Option

  • "enable-insert" to enable insert triggers

统计信息

  • 总下载量: 41
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-08-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固