Coder Social home page Coder Social logo

Comments (8)

 avatar commented on May 5, 2024

10th Dec 2009, Predominant said:


(Comment by: mensler)

Changes:
version:1.2.5
type:bug
title:No unsigned columns in test suite tables

from cakephp.

 avatar commented on May 5, 2024

10th Dec 2009, Predominant said:


(Comment by: mark_story)

BIGINT() is not a supported integer length at this point in time. Only INT() is supported.

Moving to enhancement as this is a limitation of the underlying ORM.

Changes:
version:1.3-dev
type:enhancement

from cakephp.

 avatar commented on May 5, 2024

30th Aug 2012, Mark Story said:


Bigint support will be part of 2.3.0

from cakephp.

 avatar commented on May 5, 2024

30th Aug 2012, euromark said:


but does that solve the initial issue? with "unsigned" not being supported?

from cakephp.

 avatar commented on May 5, 2024

30th Aug 2012, Mark Story said:


I guess not. I missed the unsigned part, and only saw the references to bigint's.

from cakephp.

 avatar commented on May 5, 2024

30th Aug 2012, euromark said:


also, allowing unsigned columns outside of the test suite (in the app itself) would probably be outside the scope of this ticket but still quite interesting.

from cakephp.

 avatar commented on May 5, 2024

1st Aug 2013, luke83 said:


In the diff file attached there are little changes to handle unsigned in Mysql DboSource.

Using this code schema console is able to handle unsigned fields in generate/create/update feature.

AllDatabase test cases pass with no failure.

This patch should fix #17, #2396 and #278

PS: Another solution (waiting core fix) to avoid core touching is to use this (inefficient) class as DataSource:

<?php

App::uses('Mysql', 'Model/Datasource/Database');

class iMysql extends Mysql {
    public function describe($model) {
        $fields = parent::describe($model);
        $table = $this->fullTableName($model);

        $cols = $this->_execute('SHOW FULL COLUMNS FROM ' . $table);
        if (!$cols) {
            throw new CakeException(__d('cake_dev', 'Could not describe table for %s', $table));
        }

        while ($column = $cols->fetch(PDO::FETCH_OBJ)) {
            $fields[$column->Field]['unsigned'] = strpos($column->Type, 'unsigned') !== false;
        }

        return $fields;
    }

    protected function _buildFieldParameters($columnString, $columnData, $position) {
        if ($position == 'beforeDefault' && isset($columnData['unsigned']) && $columnData['unsigned']) {
            $columnString .= ' UNSIGNED';
        }
        return parent::_buildFieldParameters($columnString, $columnData, $position);
    }

}

from cakephp.

lorenzo avatar lorenzo commented on May 5, 2024

I think that for schemas that are very database specific developers should use a different Fixture base class, there is no need for CakePHP to cover every mysql-ism when there are better options available for managing schemas like that. One example is this plugin https://github.com/lorenzo/cakephp-fixturize

from cakephp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.