phalcon/migrations
حول
Generate or migrate database changes via migrations.
البيانات والتحليلاتالنمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- ٠
- خلال 15 يومًا
- ٠
- خلال شهر
- جارٍ جمع السجل
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلPhalcon Migrations
Generate or migrate database changes via migrations.
Main idea of Phalcon migrations is to automatically detect changes and morphing without writing manual migrations.
Full documentation
Phalcon Documentation - Database Migrations
Requirements
- PHP >= 8.2
- PHP ext-pdo, with the PDO driver of your database (pdo_mysql, pdo_pgsql or pdo_sqlite)
- PHP ext-posix (Linux)
Installing via Composer
composer require --dev phalcon/migrations
Quick start
What you need for quick start:
- Configuration file (ex:
migrations.php) in root of your project (you can also pass them as parameters inside CLI environment) - Create database tables structure
- Execute command to generate migrations
After that you can execute that migrations (run) in another environment to create same DB structure.
Create configuration file
Configuration filename can be whatever you want.
The file returns a plain array. The .ini and .json formats are also supported, and .yaml and .yml with the PHP yaml extension.
<?php
return [
'database' => [
'adapter' => 'mysql',
'host' => '127.0.0.1',
'username' => 'root',
'password' => '',
'dbname' => 'db-name',
'charset' => 'utf8mb4',
],
'application' => [
'log-in-db' => true,
'no-auto-increment' => true,
'skip-ref-schema' => true,
'skip-foreign-checks' => true,
'migrations' => 'db/migrations',
'ts-based' => true, // true - Use TIMESTAMP as version name, false - use versions
'export-data-from-tables' => [
// Tables names
// Attention! It will export data every new migration
],
],
];
Generate migrations
vendor/bin/phalcon-migrations generate
Or if you have ready to use configuration file.
vendor/bin/phalcon-migrations generate --config=migrations.php
Run migrations
vendor/bin/phalcon-migrations run
Or if you have ready to use configuration file.
vendor/bin/phalcon-migrations run --config=migrations.php
List existing migrations
vendor/bin/phalcon-migrations list
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…