Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Validate foreign key relationships in data

NotificationsYou must be signed in to change notification settings

API-Skeletons/zf-doctrine-orm-data-validation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitterTotal Downloads

For one reason or another you will build an ORM on top of an existing database. The existing database maynot have referential integrity for all it's relationships.

You now have a database with an ORM and there is probably bad data in the database which does not conformto the relationships defined in the ORM.

This tool is intended for devleopment only.

Foreign Key Validation

Create a report by scanning every relationship defined in your ORM for datawhich is missing it's foreign key. Nullable relationships are not evaluated.

php index.php orm:data-validation:relationship --object-manager="doctrine.entitymanager.orm_default"

This will output TSV with the Count, Distinct Values, Child Field, Child Entity, Parent Entity, and the SQL to duplicate the results for all relationships where data is found in the child which references data not found in the parent.

Configure Zend Framework 2 Module

composerrequire"api-skeletons/zf-doctrine-orm-data-validation":"^1.0"

Add toconfig/development.config.php.dist:

return array('modules' =>array('ZF\\Doctrine\\ORM\\DataValidation'        ...    ),

Enable development mode to copydevelopment.config.php.dist todevelopment.config.php

About

Validate foreign key relationships in data

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp