cakephp / cakephp/phinx

Documentation for the Literal class

Open
#1,749 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs
Dominant language
PHP
Stars
4.5k
Forks
884
PR merge metrics
No merged PRs in 30d

Description

I looked at https://github.com/cakephp/phinx/blob/master/docs/en/migrations.rst#custom-column-types--default-values but still can't really figure out how to apply this to generate mysql virtual columns. The example sql would be

ALTER TABLE `t_calendar_sources` ADD `c_flag_deleted` boolean GENERATED ALWAYS AS (IF((json_unquote(json_extract(`c_attr`,'$.deleted'))) = 'true', 1, 0)) VIRTUAL NOT NULL;"

Could anyone help out please?

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.

Research direction

Start with the custom column types and default values section in docs/en/migrations.rst and the Literal class referenced by the issue title. Document how to use Literal for the provided MySQL virtual-column SQL example, and make the completed guidance clear enough to reproduce that column.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
database
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.