Closed alexandreIP closed 3 years ago
Yes, the "Provisional" type probably doesn't exist in your matter_type table. That was forgotten. I've updated the "update_category_provisional" migration script. Pull the new code, do a php artisan migrate:rollback
and again php artisan migrate
.
Perfect, thank you !
pi@raspberrypi:/var/www/html/phpipf $ git pull remote: Enumerating objects: 13, done. remote: Counting objects: 100% (13/13), done. remote: Compressing objects: 100% (2/2), done. remote: Total 7 (delta 5), reused 7 (delta 5), pack-reused 0 Dépaquetage des objets: 100% (7/7), fait. Depuis https://github.com/jjdejong/phpip 95d6a98..6d5336a master -> origin/master Mise à jour 95d6a98..6d5336a Fast-forward database/migrations/2020_10_01_130832_update_category_provisional.php | 1 + database/seeders/MatterTypeTableSeeder.php | 9 +++++++++ 2 files changed, 10 insertions(+) pi@raspberrypi:/var/www/html/phpipf $ composer install Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Nothing to install or update Package zendframework/zend-escaper is abandoned, you should avoid using it. Use laminas/laminas-escaper instead. Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: laravel/tinker Discovered Package: laravel/ui Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Package manifest generated successfully. pi@raspberrypi:/var/www/html/phpipf $ php artisan migrate:rollback Rolling back: 2020_09_18_135000_update_tables11 Rolled back: 2020_09_18_135000_update_tables11 (5,345.99ms) Rolling back: 2020_07_30_091000_update_special_countries Rolled back: 2020_07_30_091000_update_special_countries (0.17ms) Rolling back: 2020_07_29_190800_fix_insert_recurring_renewals Rolled back: 2020_07_29_190800_fix_insert_recurring_renewals (0.16ms) Rolling back: 2020_06_23_200200_remove_parent_filed_deps Rolled back: 2020_06_23_200200_remove_parent_filed_deps (0.17ms) pi@raspberrypi:/var/www/html/phpipf $ php artisan migrate Migrating: 2020_06_23_200200_remove_parent_filed_deps Migrated: 2020_06_23_200200_remove_parent_filed_deps (3,582.86ms) Migrating: 2020_07_29_190800_fix_insert_recurring_renewals Migrated: 2020_07_29_190800_fix_insert_recurring_renewals (78.11ms) Migrating: 2020_07_30_091000_update_special_countries Migrated: 2020_07_30_091000_update_special_countries (91.19ms) Migrating: 2020_09_18_135000_update_tables11 Migrated: 2020_09_18_135000_update_tables11 (9,140.20ms) Migrating: 2020_10_01_130832_update_category_provisional Migrated: 2020_10_01_130832_update_category_provisional (309.41ms) Migrating: 2020_12_04_133640_update_matter_alt_ref Migrated: 2020_12_04_133640_update_matter_alt_ref (2,751.31ms) pi@raspberrypi:/var/www/html/phpipf $
Happy new year ! I just made un update from last tim with git pull then with composer install. All went well except unless php artisan migrate (see end of message) The phpip system seems to work.
pi@raspberrypi:/var/www/html/phpipf $ git pull remote: Enumerating objects: 794, done. remote: Counting objects: 100% (794/794), done. remote: Compressing objects: 100% (18/18), done. remote: Total 1870 (delta 777), reused 791 (delta 775), pack-reused 1076 Réception d'objets: 100% (1870/1870), 655.52 KiB | 1.48 MiB/s, fait. Résolution des deltas: 100% (1349/1349), complété avec 115 objets locaux. Depuis https://github.com/jjdejong/phpip 4c682c1..95d6a98 master -> origin/master
pi@raspberrypi:/var/www/html/phpipf $ composer install Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Package operations: 18 installs, 85 updates, 6 removals
symfony/polyfill-intl-normalizer suggests installing ext-intl (For best performance) symfony/http-client-contracts suggests installing symfony/http-client-implementation symfony/polyfill-intl-grapheme suggests installing ext-intl (For best performance) phpoffice/phpword suggests installing dompdf/dompdf (Allows writing PDF) phpoffice/phpword suggests installing ext-gd2 (Allows adding images) Package zendframework/zend-escaper is abandoned, you should avoid using it. Use laminas/laminas-escaper instead. Generating optimized autoload files
pi@raspberrypi:/var/www/html/phpipf $ php artisan migrate Migrating: 2020_06_23_200200_remove_parent_filed_deps Migrated: 2020_06_23_200200_remove_parent_filed_deps (3,267.71ms) Migrating: 2020_07_29_190800_fix_insert_recurring_renewals Migrated: 2020_07_29_190800_fix_insert_recurring_renewals (93.59ms) Migrating: 2020_07_30_091000_update_special_countries Migrated: 2020_07_30_091000_update_special_countries (1,529.77ms) Migrating: 2020_09_18_135000_update_tables11 Migrated: 2020_09_18_135000_update_tables11 (6,458.04ms) Migrating: 2020_10_01_130832_update_category_provisional
Illuminate\Database\QueryException
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (
phpipf
.matter
, CONSTRAINTmatter_type_code_foreign
FOREIGN KEY (type_code
) REFERENCESmatter_type
(code
) ON DELETE SET NULL ON UPDATE CASCADE) (SQL: updatematter
setcategory_code
= PAT,type_code
= PRO wherecategory_code
= PRO)at vendor/laravel/framework/src/Illuminate/Database/Connection.php:678 674▕ // If an exception occurs when attempting to run a query, we'll format the error 675▕ // message to include the bindings with SQL, which will make this exception a 676▕ // lot more helpful to the developer instead of just the database's errors. 677▕ catch (Exception $e) { ➜ 678▕ throw new QueryException( 679▕ $query, $this->prepareBindings($bindings), $e 680▕ ); 681▕ } 682▕
11 database/migrations/2020_10_01_130832_update_category_provisional.php:14 Illuminate\Database\Query\Builder::update(["PAT", "PRO"])
33 artisan:37 Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) pi@raspberrypi:/var/www/html/phpipf $