phalcon / phalcon/migrations

[NFR]: [PGsql] Column default function value

Open
#113 2 comments 0 reactions 1 assignee View on GitHub

@niden is already working on this.

Since May 14, 2026.

NFR PostgreSQL
Dominant language
PHP
Stars
28
Forks
25
Avg merge
9h 39m
Merged PRs (30d)
2

Description

It will be cool if we can add a default function value for the column

new Column(
      'id',
      [
          'type' => Column::TYPE_CHAR,
          'default' => "uuid_generate_v4()",
          'notNull' => true,
          'size' => 36,
          'first' => true
      ]
  ),

image

INSERT INTO dma.city (  country_id, name, lat, lng, population, status, title) 
            VALUES ( 'FR','france',1.0, 1.0, 100000000, 1 , 'France' );

image


Beautiful solution

  • SQL :
ALTER TABLE dma.city ALTER COLUMN id SET DEFAULT uuid_generate_v4()
  • PHP (expected) :
new Column(
      'id',
      [
          'type' => Column::TYPE_CHAR,
          'notNull' => true,
          'size' => 36,
          'first' => true,
          'function'=>  "uuid_generate_v4()"
      ]
  ),

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.