{"id":16847665,"url":"https://github.com/lordsimal/cakephp-dbml","last_synced_at":"2025-07-31T21:02:08.831Z","repository":{"id":62519055,"uuid":"471153412","full_name":"LordSimal/cakephp-dbml","owner":"LordSimal","description":"A CakePHP 4 plugin to export DBML","archived":false,"fork":false,"pushed_at":"2024-07-28T16:27:17.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T04:27:49.615Z","etag":null,"topics":["cakephp","cakephp-plugin","cakephp4","dbml","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LordSimal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-17T21:52:04.000Z","updated_at":"2024-07-28T16:27:21.000Z","dependencies_parsed_at":"2024-07-28T17:58:31.447Z","dependency_job_id":null,"html_url":"https://github.com/LordSimal/cakephp-dbml","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordSimal%2Fcakephp-dbml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordSimal%2Fcakephp-dbml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordSimal%2Fcakephp-dbml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LordSimal%2Fcakephp-dbml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LordSimal","download_url":"https://codeload.github.com/LordSimal/cakephp-dbml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246144978,"owners_count":20730493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cakephp","cakephp-plugin","cakephp4","dbml","php"],"created_at":"2024-10-13T13:08:40.820Z","updated_at":"2025-03-29T05:41:12.950Z","avatar_url":"https://github.com/LordSimal.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# CakePHP 4 DBML plugin\n\n[![Latest Stable Version](https://poser.pugx.org/lordsimal/cakephp-dbml/v)](https://packagist.org/packages/lordsimal/cakephp-dbml) [![Total Downloads](https://poser.pugx.org/lordsimal/cakephp-dbml/downloads)](https://packagist.org/packages/lordsimal/cakephp-dbml) [![Latest Unstable Version](https://poser.pugx.org/lordsimal/cakephp-dbml/v/unstable)](https://packagist.org/packages/lordsimal/cakephp-dbml) [![License](https://poser.pugx.org/lordsimal/cakephp-dbml/license)](https://packagist.org/packages/lordsimal/cakephp-dbml) [![PHP Version Require](https://poser.pugx.org/lordsimal/cakephp-dbml/require/php)](https://packagist.org/packages/lordsimal/cakephp-dbml)\n\nThis plugin generates a DBML file from your current present CakePHP table files including plugin ones.\n\nSee https://www.dbml.org/, https://dbdiagram.io and https://dbdocs.io/ to get more information about DBML.\n\n\n## Installation\n\nThe recommended way to install this plugin via [composer](https://getcomposer.org) is:\n\n```\ncomposer require lordsimal/cakephp-dbml --dev\n```\n\nThen execute\n\n```\nbin/cake plugin load LordSimal/CakephpDbml\n```\n\n**or** add this to your `src/Application.php` manually\n\n```\npublic function bootstrap(): void\n{\n    parent::bootstrap();\n    \n    // Other plugins\n    $this-\u003eaddPlugin('LordSimal/CakephpDbml');\n}\n```\n\n\n## How to use\n\nAfter installing the plugin you now have a new command available to you:\n\n```\nbin/cake generate_dbml \n```\n\nAfter executing that you should have a new file in your applications root folder called `dbml-export.dbml`\n\nThis text file can then be copy-pasted into e.g. https://dbdiagram.io where you can very easily drag\u0026drop your tables into a structure which is more visually appealing\n\n### Possible warning messages\n\nIt is possible that you get warning messages like these:\n\n```\n-\u003e % bin/cake generate_dbml   \nTable for Tokens (tokens) from Plugin \"Tools\" is not present\n```\n\nThis means that you current database schema doesn't have that table but your code (or in this case the plugin \"Tools\") contains a table file which has been detected.\n\n\n## Configuration\n\nAll default config-keys can be seen in this plugins `config/config.php` file\n\n* `Dbml.path` =\u003e The path where the generated file will be placed\n* `Dbml.filename` =\u003e The filename\n* `Dbml.blacklistedPlugins`=\u003e Array of plugins which should be skipped\n* `Dbml.blacklistedTables` =\u003e Array of table names which should be skipped\n\nYou can **extend** any of these values just by adding the following to your `config/app_local.php`\n\n```\nreturn [\n    'Dbml' =\u003e [\n        'blacklistedPlugins' =\u003e [\n            'CakeDC/Users',\n        ],\n        'blacklistedTables' =\u003e [\n            'social_accounts',\n            'token',\n            'queued_jobs',\n            'queue_processes'\n        ]\n    ],\n];\n```\n\n\n## How does it work?\n\nExecuting the command from above will look through all your **table files** (in your app as well as all installed plugins) and load their schema data including relations.\n\nBy default it does exclude the plugins `DebugKit` as well as `Migrations` which are present in new CakePHP applications\n\nIf you want to have more information on which tables and which associations are being detected execute the command like so\n\n```\nbin/cake generate_dbml -v\n```\n\nAfter gathering all the table and association data they get formatted into a structure which is more easily written to the DBML file.\n\n\n## Acknowledgement\n\nBig shoutout to @dereuromark and especially his https://github.com/dereuromark/cakephp-model-graph plugin which definitely inspired and helped me create this plugin!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flordsimal%2Fcakephp-dbml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flordsimal%2Fcakephp-dbml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flordsimal%2Fcakephp-dbml/lists"}