[ 
https://issues.apache.org/jira/browse/VCL-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14538029#comment-14538029
 ] 

ASF subversion and git services commented on VCL-870:
-----------------------------------------------------

Commit 1678766 from [~jfthomps] in branch 'vcl/trunk'
[ https://svn.apache.org/r1678766 ]

VCL-870 - the foreign keys are not in sync between the vcl.sql and 
update-vcl.sql files

The idea with these changes is to allow innocuous changes to cascade, but to 
restrict changes that could be a problem. Updates to id fields for most tables 
are allowed to cascade. It is unlikely that someone would need to change the id 
of most entries, but changing them should not be a problem were someone to do 
it. However, changes to id fields for resources are not allowed because those 
changes cannot be cascaded to resource.subid. In those cases, updates to the 
ids are restricted. Additionally, cascading deletes are not allowed for fields 
where records should never be deleted. These would include (but not be limited 
to) entries in the user, computer, image, managmentnode, and log tables. 
Schedules are allowed to be deleted. So schedule deletes can be cascaded.

changes to update-vcl.sql file:

table structure changes:
-modified affiliation.sitewwwaddress to allow up to 128 chars (was 56)
-modified addition of 3 column unique index for changelog on 
userid,reservationid,remoteIP to be in than order instead of 
reservationid,userid,remoteIP
-added key on continuations.deletefromid
-modified image.prettyname to allow up to 80 chars (was 60)
-modified image.basedoffrevisionid to allow NULL and have the default as NULL
-added key on loginlog.timestamp
-added key on loginlog.authmech
-added key on loginlog.code
-added unique key on managementnode.hostname
-moved where openstackcomputermap and openstackimagerevision table creations 
are located
-modified sublog.blockRequestid to allow NULL and have the default as NULL
-modified sublog.blockStart to allow NULL and have the default as NULL
-modified sublog.blockEnd to allow NULL and have the default as NULL
-added index on sublog.blockRequestid
-modified user.IMtypeid to allow NULL and have the default as NULL
-modified usergroup.initialmaxtime to be mediumint(8) (was smallint(5))
-modified usergroup.totalmaxtime to be mediumint(8) (was smallint(5))
-modified usergroup.maxextendtime to be mediumint(8) (was smallint(5)) and to 
have a default value of 60 (was 30)
-moved where unique keys are changed for userpriv table
-removed index on userpriv.usergroupid
-modified vmhost.vmlimit to be smallint(5) (was tinyint(3))
-modified vmhost.vmprofileid to have no default
-modified unique index on vmhost.computer to be on computerid,vmprofileid
-added unique key on vmtype.name
-modified xmlrpcLog.xmlrpcKeyid to be mediumint(8) (was smallint(5))
-added key on xmlrpcLog.timestamp

data changes:
-update user.IMtypeid to be NULL where there is not a matching entry in the 
IMtype table
-update image.basedoffrevisionid to be NULL where there is not a matching entry 
in the imagerevision table

constraint changes:
-dropped existing constraint on blockComputers.imageid so update is forced
-modified blockComputers.computerid
-modified blockComputers.imageid
-modified blockRequest.imageid
-modified blockRequest.managementnodeid
-dropped existing constraint on changelog.logid so update is forced
-dropped existing constraint on changelog.userid so update is forced
-dropped existing constraint on changelog.computerid so update is forced
-added changelog.computerid
-dropped existing constraint on clickThroughs.userid so update is forced
-dropped existing constraint on clickThroughs.imageid so update is forced
-dropped existing constraint on clickThroughs.imagerevisionid so update is 
forced
-modified clickThroughs.imageid
-dropped existing constraint on computer.vmhostid so update is forced
-dropped existing constraint on computer.ownerid so update is forced
-dropped existing constraint on computer.scheduleid so update is forced
-dropped existing constraint on computer.currentimageid so update is forced
-dropped existing constraint on computer.nextimageid so update is forced
-added computer.vmhostid
-added computer.ownerid
-added computer.scheduleid
-added computer.currentimageid
-modified computer.nextimageid
-dropped existing constraint on computerloadlog.loadstateid so update is forced
-modified computerloadlog.computerid
-modified computerloadlog.loadstateid
-modified computerloadlog.reservationid
-moved location of changes for connectlog
-dropped existing constraint on connectlog.logid so update is forced
-dropped existing constraint on connectlog.userid so update is forced
-modified connectlog.logid
-modified connectlog.userid
-dropped existing constraint on connectmethodmap.OStypeid so update is forced
-dropped existing constraint on connectmethodmap.OSid so update is forced
-dropped existing constraint on connectmethodmap.imagerevisionid so update is 
forced
-modified connectmethodmap.OStypeid
-modified connectmethodmap.OSid
-modified connectmethodmap.imagerevisionid
-added continuations.userid 
-dropped existing constraint on image.ownerid so update is forced
-added image.ownerid
-added image.basedoffrevisionid
-dropped existing constraint on imagerevisioninfo.imagerevisionid so update is 
forced
-modified imagerevisioninfo.imagerevisionid
-dropped existing constraint on localauth.userid so update is forced
-modified localauth.userid
-dropped existing constraint on log.imageid so update is forced
-dropped existing constraint on log.computerid so update is forced
-added log.imageid
-modified log.computerid
-dropped existing constraint on managementnode.imagelibgroupid so update is 
forced
-added managementnode.imagelibgroupid
-dropped existing constraint on nathost.resourceid so update is forced
-modified nathost.resourceid
-dropped existing constraint on natlog.sublogid so update is forced
-modified natlog.sublogid
-dropped existing constraint on natport.connectmethodportid so update is forced
-dropped existing constraint on natport.reservationid so update is forced
-dropped existing constraint on natport.nathostid so update is forced
-modified natport.connectmethodportid
-modified natport.reservationid
-modified natport.nathostid
-dropped existing constraint on openstackcomputermap.computerid so update is 
forced
-modified openstackcomputermap.computerid
-dropped existing constraint on openstackimagerevision.imagerevisionid so 
update is forced
-modified openstackimagerevision.imagerevisionid
-dropped existing constraint on provisioningOSinstalltype.provisioningid so 
update is forced
-dropped existing constraint on provisioningOSinstalltype.OSinsalltypeid so 
update is forced
-dropped existing constraint on querylog.userid so update is forced
-added querylog.userid
-dropped existing constraint on request.userid so update is forced
-added request.userid
-added request.logid
-dropped existing constraint on reservation.computerid so update is forced
-dropped existing constraint on reservation.imageid so update is forced
-added reservation.computerid
-added reservation.imageid
-dropped existing constraint on reservationaccounts.reservationid so update is 
forced
-dropped existing constraint on reservationaccounts.userid so update is forced
-modified reservationaccounts.reservationid
-modified reservationaccounts.userid
-dropped existing constraint on resourcemap.resourcetypeid1 so update is forced
-dropped existing constraint on resourcemap.resourcetypeid2 so update is forced
-dropped existing constraint on scheduletimes.scheduleid so update is forced
-modified scheduletimes.scheduleid
-dropped existing constraint on semaphore.computerid so update is forced
-dropped existing constraint on semaphore.imageid so update is forced
-dropped existing constraint on semaphore.imagerevisionid so update is forced
-dropped existing constraint on semaphore.managementnodeid so update is forced
-modified semaphore.computerid
-modified semaphore.imageid
-modified semaphore.managementnodeid
-dropped existing constraint on serverprofile.ownerid so update is forced
-dropped existing constraint on serverprofile.admingroupid so update is forced
-dropped existing constraint on serverprofile.logingroupid so update is forced
-modified serverprofile.ownerid
-modified serverprofile.admingroupid
-modified serverprofile.logingroupid
-dropped existing constraint on shibauth.userid so update is forced
-modified statgraphcache.affiliationid
-dropped existing constraint on subimages.imageid so update is forced
-dropped existing constraint on subimages.imagemetaid so update is forced
-modified subimages.imageid
-dropped existing constraint on sublog.logid so update is forced
-dropped existing constraint on sublog.imageid so update is forced
-dropped existing constraint on sublog.imagerevisionid so update is forced
-dropped existing constraint on sublog.computerid so update is forced
-dropped existing constraint on sublog.managementnodeid so update is forced
-dropped existing constraint on sublog.predictivemoduleid so update is forced
-dropped existing constraint on sublog.hostcomputerid so update is forced
-modified sublog.imageid
-modified sublog.computerid
-modified sublog.managementnodeid
-modified sublog.hostcomputerid
-added sublog.blockRequestid
-dropped existing constraint on user.affiliationid so update is forced
-dropped existing constraint on user.IMtypeid so update is forced
-added user.affiliationid
-added user.IMtypeid
-dropped existing constraint on usergroup.ownerid so update is forced
-dropped existing constraint on usergroup.affiliationid so update is forced
-modified usergroup.ownerid
-dropped existing constraint on usergroupmembers.userid so update is forced
-added usergroupmembers.userid
-dropped existing constraint on usergrouppriv.userprivtypeid so update is forced
-modified usergrouppriv.userprivtypeid
-dropped existing constraint on userpriv.userid so update is forced
-dropped existing constraint on userpriv.userprivtypeid so update is forced
-added userpriv.userid
-added userpriv.userprivtypeid
-added userpriv.usergroupid
-dropped existing constraint on vmhost.computerid so update is forced
-modified vmhost.computerid
-dropped existing constraint on vmprofile.imageid so update is forced
-added vmprofile.imageid

> the foreign keys are not in sync between the vcl.sql and update-vcl.sql files
> -----------------------------------------------------------------------------
>
>                 Key: VCL-870
>                 URL: https://issues.apache.org/jira/browse/VCL-870
>             Project: VCL
>          Issue Type: Bug
>          Components: database
>            Reporter: Josh Thompson
>             Fix For: 2.5
>
>
> The foreign keys created by the vcl.sql and update-vcl.sql files are not in 
> sync with each other. Some keys are created with things like "ON UPDATE 
> CASCADE" in one file and "ON DELETE CASCADE ON UPDATE CASCADE" in the other 
> file.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to