PHPackages                             andmemasin/yii2-myabstract - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. andmemasin/yii2-myabstract

ActiveYii2-extension[Database &amp; ORM](/categories/database)

andmemasin/yii2-myabstract
==========================

my custom activerecord classes

9.0.1(2w ago)09.2k↓83.2%6proprietaryPHPPHP &gt;=8.3.0CI passing

Since Feb 21Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/TonisOrmisson/yii2-myabstract)[ Packagist](https://packagist.org/packages/andmemasin/yii2-myabstract)[ RSS](/packages/andmemasin-yii2-myabstract/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (22)Versions (169)Used By (6)

Yii2-Myabstracts
================

[](#yii2-myabstracts)

[![build](https://github.com/TonisOrmisson/yii2-myabstract/actions/workflows/php.yml/badge.svg)](https://github.com/TonisOrmisson/yii2-myabstract/actions/workflows/php.yml/badge.svg)

Soft delete schema
------------------

[](#soft-delete-schema)

This major version uses Laravel-style soft-delete timestamp semantics by default.

Default lifecycle columns:

- `created_at`
- `updated_at`
- `deleted_at`

Default audit columns:

- `created_by`
- `updated_by`
- `deleted_by`

Active records have `deleted_at IS NULL`. Deleted records have `deleted_at` set to the deletion timestamp.

This package keeps timestamp values as `DATETIME(6)` / `Y-m-d H:i:s.u` values. Laravel's migration helpers commonly create SQL `TIMESTAMP` columns for `created_at`, `updated_at`, and `deleted_at`, but that is not a UNIX integer timestamp. Both `DATETIME(6)` and `TIMESTAMP(6)` are read by Laravel/Eloquent as date objects.

The practical difference is timezone handling: MySQL `DATETIME` stores the exact calendar value written, while MySQL `TIMESTAMP` can be converted according to the DB session timezone. Keeping `DATETIME(6)` avoids timezone surprises during the Yii-to-Laravel transition. A future schema cleanup may convert these columns to `TIMESTAMP(6)` if strict Laravel migration-helper compatibility becomes more important than preserving current DB behavior.

Apps that still use the previous columns must override the column-name properties on their models until their own migrations are complete:

```
public string $userCreatedCol = 'user_created';
public string $userUpdatedCol = 'user_updated';
public string $userClosedCol = 'user_closed';
public string $timeCreatedCol = 'time_created';
public string $timeUpdatedCol = 'time_updated';
public string $timeClosedCol = 'time_closed';
```

Overrides only change column names. They do not preserve the old end-of-time active-row convention; active rows must still have the configured deleted timestamp column set to `NULL`.

Migrating an app module to 9.x
------------------------------

[](#migrating-an-app-module-to-9x)

Migrate one app module or table group at a time.

1. Update the module package constraint to allow `andmemasin/yii2-myabstract:^9`.
2. Add a DB migration that renames the columns:

```
$this->renameColumn('{{table_name}}', 'time_created', 'created_at');
$this->renameColumn('{{table_name}}', 'time_updated', 'updated_at');
$this->renameColumn('{{table_name}}', 'time_closed', 'deleted_at');
$this->renameColumn('{{table_name}}', 'user_created', 'created_by');
$this->renameColumn('{{table_name}}', 'user_updated', 'updated_by');
$this->renameColumn('{{table_name}}', 'user_closed', 'deleted_by');
```

3. Convert active rows to the new Laravel-style soft-delete state:

```
$this->alterColumn('{{table_name}}', 'deleted_at', $this->dateTime(6)->null());
$this->alterColumn('{{table_name}}', 'deleted_by', $this->integer()->null());
$this->update('{{table_name}}', ['deleted_at' => null, 'deleted_by' => null], ['deleted_by' => [0, null]]);
```

Use `dateTime(6)` for this migration phase unless the module explicitly decides to also take on timezone semantics changes. Do not convert to UNIX integer timestamps.

4. Replace indexes that include `user_closed` with equivalent indexes using `deleted_at`.
5. Remove old column-name overrides from migrated models.
6. Keep explicit old-name overrides only on models whose tables are not migrated yet.
7. Search the module for direct references to old names and update queries/search models/tests:

```
rg -n "time_created|time_updated|time_closed|user_created|user_updated|user_closed" modules/andmemasin/
```

8. Run the module tests and PHPStan before release:

```
vendor/bin/codecept run modules/andmemasin//tests
php vendor/bin/phpstan analyze -c modules/andmemasin//phpstan-dev.neon
```

Do not dual-write old and new columns. If a module cannot migrate its tables yet, keep it on the old major version or add explicit old-name overrides until that module gets its own migration.

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance86

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity97

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 99.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Recently: every ~111 days

Total

168

Last Release

15d ago

Major Versions

4.0.2 → 5.0.02022-09-06

5.1.5 → 6.0.02023-07-05

6.1.0 → 7.0.02024-01-29

7.0.7 → 8.0.02024-05-20

8.2.3 → 9.0.02026-06-19

PHP version history (8 changes)2.5.7PHP &gt;=5.6

2.13.0PHP &gt;=7.3

2.16.0PHP &gt;=7.4

3.0.0PHP &gt;=8.0

4.0.0PHP &gt;=8.0.2

6.0.0PHP &gt;=8.1.2

8.2.3PHP &gt;=8.2.0

9.0.0PHP &gt;=8.3.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6357451?v=4)[Tõnis Ormisson](/maintainers/TonisOrmisson)[@TonisOrmisson](https://github.com/TonisOrmisson)

---

Top Contributors

[![TonisOrmisson](https://avatars.githubusercontent.com/u/6357451?v=4)](https://github.com/TonisOrmisson "TonisOrmisson (426 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")

---

Tags

yii2andmemasin

###  Code Quality

TestsCodeception

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/andmemasin-yii2-myabstract/health.svg)

```
[![Health](https://phpackages.com/badges/andmemasin-yii2-myabstract/health.svg)](https://phpackages.com/packages/andmemasin-yii2-myabstract)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[bizley/migration

Migration generator for Yii 2.

296389.5k11](/packages/bizley-migration)[yii2tech/illuminate

Yii2 to Laravel Migration Package

11416.2k](/packages/yii2tech-illuminate)[mootensai/yii2-relation-trait

Yii 2 Models load with relation, &amp; transaction save with relation

49232.7k9](/packages/mootensai-yii2-relation-trait)[nhkey/yii2-activerecord-history

Storage history of changes to ActiveRecord

46148.8k1](/packages/nhkey-yii2-activerecord-history)[dmstr/yii2-db

Database extensions

19656.2k6](/packages/dmstr-yii2-db)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
