[Mydatabasepilot-cvs] MyDatabasePilot/Query alterTable.cfm,1.20,1.21
Status: Alpha
Brought to you by:
nanoface
From: <nan...@us...> - 2003-06-20 21:14:12
|
Update of /cvsroot/mydatabasepilot/MyDatabasePilot/Query In directory sc8-pr-cvs1:/tmp/cvs-serv3792/Query Modified Files: alterTable.cfm Log Message: Internal Structure Changed: [ 758157 ] Converted Some Code to <CFScript> Index: alterTable.cfm =================================================================== RCS file: /cvsroot/mydatabasepilot/MyDatabasePilot/Query/alterTable.cfm,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** alterTable.cfm 20 Jun 2003 20:50:53 -0000 1.20 --- alterTable.cfm 20 Jun 2003 21:14:08 -0000 1.21 *************** *** 192,228 **** <cfset htmlSQL = "#htmlSQL# <span class=""KeyWord"">PRIMARY KEY</span>" /> </cfif> ! <!--- ToDo: [reference_definition] ---> ! ! <!---||| Location of new Field : [FIRST | AFTER column_name ] |||---> ! <!--- If location is set to "Beginning" ... ---> ! <cfif ATTRIBUTES.alterSpec[i].colLocation IS "Beginning"> ! <!--- If it's the first column to be added ... ---> ! <cfif i is 1> ! <!--- Add FIRST Keyword to Output Strings ---> ! <cfset rawSQL = "#rawSQL# FIRST" /> ! <cfset htmlSQL = "#htmlSQL# <span class=""KeyWord"">FIRST</span>" /> ! <!--- Otherwise ... ---> ! <cfelse> ! <!--- Add AFTER Keyword to Output Strings ---> ! <cfset rawSQL = "#rawSQL# AFTER" /> ! <cfset htmlSQL = "#htmlSQL# <span class=""KeyWord"">AFTER</span>" /> ! <!--- Set index of Last Column ---> ! <cfset lastColumn = i-1> ! <!--- Make sure last column to be added has a specified name ---> ! <cfif ATTRIBUTES.alterSpec[lastColumn].colName IS ""> ! <cfset rawSQL = "#rawSQL# NameNotSpecified_#lastColumn#" /> ! <cfset htmlSQL = "#htmlSQL# <span class=""Missing"">NameNotSpecified_#lastColumn#</span>" /> ! <!--- Otherwise ... ---> ! <cfelse> ! <!--- Set location to AFTER the last column to be added ---> ! <cfset rawSQL = "#rawSQL# #ATTRIBUTES.alterSpec[lastColumn].colName#" /> ! <cfset htmlSQL = "#htmlSQL# <span class=""String"">#ATTRIBUTES.alterSpec[lastColumn].colName#</span>" /> ! </cfif> ! </cfif> ! <!--- Elseif Loctaion is not set to "End", that means a location is specified between other coloumns ... ---> ! <cfelseif ATTRIBUTES.alterSpec[i].colLocation IS NOT "End"> ! <cfscript> // Add AFTER Keyword to Output Strings rawSQL = "#rawSQL# AFTER"; --- 192,229 ---- <cfset htmlSQL = "#htmlSQL# <span class=""KeyWord"">PRIMARY KEY</span>" /> </cfif> + + <cfscript> + // ToDo: [reference_definition] ! //----------------------------------------------------- ! // Location of new Field : [FIRST | AFTER column_name ] ! //----------------------------------------------------- ! ! // If location is set to "Beginning" ... ! if(ATTRIBUTES.alterSpec[i].colLocation IS "Beginning"){ ! // If it's the first column to be added ... ! if(i IS 1){ ! // Add FIRST Keyword to Output Strings ! rawSQL = "#rawSQL# FIRST"; ! htmlSQL = "#htmlSQL# <span class=""KeyWord"">FIRST</span>"; ! }else{ ! // Add AFTER Keyword to Output Strings ! rawSQL = "#rawSQL# AFTER"; ! htmlSQL = "#htmlSQL# <span class=""KeyWord"">AFTER</span>"; ! lastColumn = i-1; // Set index of Last Column ! ! // Make sure last column to be added has a specified name ! if(ATTRIBUTES.alterSpec[lastColumn].colName IS ""){ ! rawSQL = "#rawSQL# NameNotSpecified_#lastColumn#"; ! htmlSQL = "#htmlSQL# <span class=""Missing"">NameNotSpecified_#lastColumn#</span>"; ! }else{ ! // Set location to AFTER the last column to be added ! rawSQL = "#rawSQL# #ATTRIBUTES.alterSpec[lastColumn].colName#"; ! htmlSQL = "#htmlSQL# <span class=""String"">#ATTRIBUTES.alterSpec[lastColumn].colName#</span>"; ! } ! } ! // Elseif Loctaion is not set to "End", that means a location is specified between other coloumns ... ! }else if(ATTRIBUTES.alterSpec[i].colLocation IS NOT "End"){ // Add AFTER Keyword to Output Strings rawSQL = "#rawSQL# AFTER"; *************** *** 247,252 **** } } ! </cfscript> ! </cfif> </cfif> </cfcase> --- 248,253 ---- } } ! } ! </cfscript> </cfif> </cfcase> |