Closed (outdated)
Project:
Drupal core
Version:
11.x-dev
Component:
database system
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
4 Jun 2007 at 05:25 UTC
Updated:
23 Jun 2025 at 15:27 UTC
Jump to comment: Most recent
Comments
Comment #1
moshe weitzman commenteddoes this patch exist yet? would be swell :)
schema.module attempts to do some of this. it is in Contrib for now.
Comment #2
wim leersSubscribing.
Comment #3
Frando commentedVery interesting. Subscribing. If there's already some code, I'll gladly review it.
Comment #4
morphir commentedadding to my tracker.
Comment #5
bjaspan commentedSubscribing; didn't know abut this patch until now.
I've been thinking along these lines from the very beginning, but it seemed like too much to put into D6. Note that as Moshe says, a lot of the code for this is already written though it is not necessarily organized usefully yet:
- Comparing schema N to N+1 (or any two schema structures) is in schema.module.
- Updating a single field to match the schema is in database.{mysql-common,pgsql}.inc in db_change_field() and db_update_field(). Iterating over that for all fields would be simple.
Currently, all data type transformations for existing fields are handled by the db directly via UPDATE SET new_col = old_col which means any non-trivial update will just lose all data (and probably throw SQL errors). We may want to define our own behavior for that so that, as influenced by the dabbledb.com 7-minute demo, we can handle (say) string->datetime conversion or whatever.
Comment #6
bjaspan commentedComment #7
Crell commentedComment #8
alansaviolobo commentedComment #22
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #23
smustgrave commentedSince there's been no follow up in 3 months going to close out, if still a valid task please re-open
Thanks all!