https://github.com/manojmbharadwaj/laghu
PHP script Migration tool for small projects. Uses SQL query instead of PHP Classes.
https://github.com/manojmbharadwaj/laghu
migration-tool php php-migration
Last synced: 5 months ago
JSON representation
PHP script Migration tool for small projects. Uses SQL query instead of PHP Classes.
- Host: GitHub
- URL: https://github.com/manojmbharadwaj/laghu
- Owner: manojmbharadwaj
- License: mit
- Created: 2019-11-16T04:52:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-16T16:28:24.000Z (over 6 years ago)
- Last Synced: 2024-04-19T03:42:52.422Z (about 2 years ago)
- Topics: migration-tool, php, php-migration
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**Project Intro**
Laghu(Small in Kannada) Migration Tool!
---
## Intro
Laghu is small migration tool. The flow is simple. First we will create a migration file. Add SQL to the created file. Run the migration!.
When we run the migration, the tool check weather the file is all-ready migrated or not. If it is being migrated it won't run the SQL.
The tool will create Migration directory, migration table(laghu_migrations) when you run the script. DO NOT CHANGE DIRECTORY NAME and TABLE NAME unlsess you change the laghu.php script as well.
In small projects I found it is easier to have a migration based on raw SQL scripts than using a framework for it.
## Config
Update config.php with database credentials
## Commands
1. Create Migration:
php laghu.php create [file_suffix]
php laghu.php create ct-user_detail -> this will create the file [timestamp]ct-user_detail in migration directory.
Naming conventions (optional. Suggested for readiblity):
ct -> create table
mt -> modify table
dt -> SQL contains Data
2. Run migration
php laghu.php migrate
The command will run the migration outputs no. of files migrated successfully.