Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Trouble updating MySQL table datatype.

  • 01-04-2010 9:47am
    #1
    Registered Users, Registered Users 2 Posts: 2,237 ✭✭✭


    Hi,

    I'm trying to change the datatype of a field in a MySQL table but I keep getting the following error. I'm trying to change from date to datetime.

    I thought it was something to do with data referencing that table soI have removed all data. Still no joy. Any ideas on what could be causing this?

    Cheers.
    SQL query:
    
    ALTER TABLE `lesson_booking_available` CHANGE `date` `date` DATETIME NOT NULL
    
    MySQL said: Documentation
    #1025 - Error on rename of '.\stable\#sql-fc_4c' to '.\stable\lesson_booking_available' (errno: 150) 
    


Comments

  • Registered Users, Registered Users 2 Posts: 3,184 ✭✭✭Kenno90


    Try something like this
    ALTER TABLE lesson_booking_available MODIFY date DATETIME not null;
    


  • Registered Users, Registered Users 2 Posts: 2,237 ✭✭✭techguy


    Cool, looks like it would work.

    I actually deleted all the FK constraints then modified the table. There were only 2 so it wasn't that bad..

    Thanks!


  • Registered Users, Registered Users 2 Posts: 3,184 ✭✭✭Kenno90


    Anytime:D


Advertisement