patricmutwiri / archive
将随时间增长而增长的归档数据库表拆分到不同的、带有时间后缀的表中,以减轻常用表的负担。
dev-master
2020-04-30 13:32 UTC
Requires
- php: >=7.0
Requires (Dev)
- phpunit/phpunit: ^6
This package is auto-updated.
Last update: 2024-09-29 05:41:44 UTC
README
将随时间增长而增长的归档数据库表拆分到不同的、带有时间后缀的表中,以减轻常用表的负担。
安装
要通过 composer 安装,只需在您的 composer.json
文件中添加以下内容
{ "require": { "patricmutwiri/archive": "dev-master" } }
$ composer update
使用方法
$archive = new Patricmutwiri\Archive\Archive; echo $archive->getDatabases(); // > db1, db2, db3
配置
DATABASES="db1"
TABLES="table1,table2,table3"
ARCHIVE_FROM="2015-12-31" // Archive from which date
ARCHIVE_TO="2000-01-01" // If this is empty, we'll archive all data from ARCHIVE_FROM.
DATE_COLUMN="datetimeadded,created_at,date_time_added" // the column to use as key for dates set in ARCHIVE_FROM and ARCHIVE_TO`
许可证
MIT