Coder Social home page Coder Social logo

time field causes errors about migrations HOT 3 CLOSED

cakedc avatar cakedc commented on August 16, 2024
time field causes errors

from migrations.

Comments (3)

predominant avatar predominant commented on August 16, 2024

Placed on hold. Waiting for more information.

from migrations.

neterslandreau avatar neterslandreau commented on August 16, 2024

This is the error:
[005] 003_change_the_parties_times_from_varchar_to_time
> Changing field start_time from parties.

Query: ALTER TABLE `parties` CHANGE `start_time` `start_time` time(255) DEFAULT NULL;

An error occurred when processing the migration:

Migration: 003_change_the_parties_times_from_varchar_to_time
Error: SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(255) DEFAULT NULL' at line 2

The migration script is:
public $migration = array(
'up' => array(
'alter_field' => array(
'parties' => array(
'start_time' => array('type' => 'time', 'null' => true, 'default' => NULL),
'end_time' => array('type' => 'time', 'null' => true, 'default' => NULL),
),
),
),
'down' => array(
'alter_field' => array(
'parties' => array(
'start_time' => array('type' => 'string', 'length' => 255),
'end_time' => array('type' => 'string', 'length' => 255),
),
),
),
);

from migrations.

renan avatar renan commented on August 16, 2024

Actually the CakePHP schema does not support time columns, that's why its does not works.
In order to make it work, CakePHP schema first needs to implement time columns.

Thank you.

from migrations.

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.