phalcon-devtools icon indicating copy to clipboard operation
phalcon-devtools copied to clipboard

phalcon migration generate reference onDelete &onUpdate empty in postgresql

Open AnatolyAstapov opened this issue 9 years ago • 2 comments

Hello, have a problem: run command for generate migration: phalcon migration generate

in all table files empty reference on update and on delete.

result example:

new Reference(
                        'content_resource_id_fkey',
                        [
                            'referencedTable' => 'resources',
                            'columns' => ['resource_id'],
                            'referencedColumns' => ['id'],
                            'onUpdate' => '',
                            'onDelete' => ''
                        ]
                    )

its really onUpdate -> 'NO ACTION' onDelete -> 'CASCADE'

i in manual set in all files correct reference, after "phalcon migration run" - all reference set in correctly, but if generate new migration, reference reset again. (file has empty action for update and delete)

Details

  • DB: Postgresql 9.6
  • Phalcon DevTools Version: 3.0.5
  • Phalcon Version: 3.0.3
  • AdminLTE Version: 2.3.6
  • OS: Darwin mactosic 16.4.0 Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64
  • PHP Version: 7.0.13
  • PHP SAPI: cli
  • PHP Bin: /Applications/MAMP/bin/php/php7.0.13/bin/php
  • PHP Extension Dir: /Applications/MAMP/bin/php/php7.0.13/lib/php/extensions/no-debug-non-zts-20151012
  • PHP Bin Dir: /Applications/MAMP/bin/php/php7.0.13/bin
  • Loaded PHP config: /Applications/MAMP/bin/php/php7.0.13/conf/php.ini

AnatolyAstapov avatar Mar 17 '17 18:03 AnatolyAstapov

@AnatolyAstapov It has been fix earlier. Could you try latest stable version? Added foreign key and after generating migration I had this

'references' => [
                    new Reference(
                        'test_key',
                        [
                            'referencedTable' => 'foreign_key_parent',
                            'referencedSchema' => 'public',
                            'columns' => ['child_int'],
                            'referencedColumns' => ['refer_int'],
                            'onUpdate' => 'NO ACTION',
                            'onDelete' => 'CASCADE'
                        ]
                    )
                ],

I propose close this issue, because problem was fixed.

Phalcon DevTools Version: 3.2.3 Phalcon Version: 3.2.1

sergeysviridenko avatar Sep 14 '17 08:09 sergeysviridenko

Closing, this is fixed. If there are bugs, we can follow up in separate issues.

sergeyklay avatar Sep 27 '17 12:09 sergeyklay