cakephp / cakephp/phinx

New feature : Make Phinx work with Oracle

Open
#2,347 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Context:
I'm working on a project (moreover in PHP7, and if you ask : migration to PHP8 is planned) with an Oracle database.
I found phinx as an interesting migration library.

But it doesn't handle PDO Oci.

Feature requested:
Phinx should be able to use a PDO OCI connection to address Oracle specificities.

As I need it, I wrote a simplified wrapper for it (only handles the "migration table" part for now), and will push it in a PR.

I thought it would be pretty straightforward, however I encountered unexpected issues. To deal with certain Oracle specificities, I've been forced to override and rewrite entire methods (migrated, getVersionLog), that is not very DRY.

Objective:
This issue is here to list Oracle's specificities, and discuss on how improvements of Phinx could reduce this code-copying.

As far as I am concerned :

  • Oracle is not able to deal with a simple string, even ISO-formatted, as date. So, use of dates (notably, migrated method) should be able to be overriden to use TO_DATE as SQL. see #2341
  • Oracle handle case of table columns with a "all-in-caps by default" rule. so SELECT version will lead, when fetched, to an array whose keys are VERSION (in uppercase). see #2345

This list is not exhaustive; the further I go into implementing the OCI Adapter, the more specificities I will probably find.

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 by reviewing the proposed OCI Adapter and the migrated and getVersionLog methods, then compare the Oracle concerns described in #2341 and #2345. Document the remaining Oracle-specific behaviors encountered during implementation and determine how the adapter can support the migration table without copying entire methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.