Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrkmg/yiidbupgrader
Yii DbUpgrader Component
https://github.com/mrkmg/yiidbupgrader
Last synced: 16 days ago
JSON representation
Yii DbUpgrader Component
- Host: GitHub
- URL: https://github.com/mrkmg/yiidbupgrader
- Owner: mrkmg
- Created: 2012-12-11T18:04:13.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-03-27T14:51:07.000Z (over 11 years ago)
- Last Synced: 2024-10-04T09:59:05.077Z (about 1 month ago)
- Language: PHP
- Size: 125 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
yiiDbUpgrader
=============Yii DbUpgrader Component can be used to automate upgrading a database to a new version(s).
Installation
============Copy `DbUpgrader.php` to `protected/components/`
Usage
=====- Create a folder in your Yii data folder (`protected/data`) called `dbversion`.
- Each time you make changes to the database, place the sql code for those changes into numbered sql files in that directory. The follow are both valid:```
1.sql
2.sql
3.sql
4.sql
``````
001.sql
002.sql
003.sql
004.sql
```- Somewhere in your code, you can run the following to actually perform the check and upgrade.
```php
$dbu = new DbUpgrader;
$dbu->runUpgrade();
```- If you want a verbose output (useful for cli access and logging)
```php
$dbu = new DbUpgrader;
$dbu->runUpgrade(true);
```License
=======The MIT License (MIT)
Copyright (c) 2013 MrKMGPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.