[Mydatabasepilot-cvs] MyDatabasePilot/dbProcessInit AddField.cfm,1.18,1.19
Status: Alpha
Brought to you by:
nanoface
From: <nan...@us...> - 2003-06-20 20:21:27
|
Update of /cvsroot/mydatabasepilot/MyDatabasePilot/dbProcessInit In directory sc8-pr-cvs1:/tmp/cvs-serv27768/dbProcessInit Modified Files: AddField.cfm Log Message: Functionality Added: [ 758146 ] Added "ADD UNIQUE" AlterSpec Index: AddField.cfm =================================================================== RCS file: /cvsroot/mydatabasepilot/MyDatabasePilot/dbProcessInit/AddField.cfm,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** AddField.cfm 19 Jun 2003 14:19:52 -0000 1.18 --- AddField.cfm 20 Jun 2003 20:21:24 -0000 1.19 *************** *** 27,31 **** <cfset alterSpec=ArrayNew(1) /> ! <!---||| Loop over each new field |||---> <cfloop from="1" to="#FORM.numberOfFields#" index="i"> <!---||| Set default values of empty string for FORM fields |||---> --- 27,32 ---- <cfset alterSpec=ArrayNew(1) /> ! <!---||| Create ADD COLUMN alterSpec for each new field |||---> ! <!--- Loop over each new field ... ---> <cfloop from="1" to="#FORM.numberOfFields#" index="i"> <!---||| Set default values of empty string for FORM fields |||---> *************** *** 70,73 **** --- 71,100 ---- <cfif IsDefined("FORM.autoIncrement#i#")><cfset alterSpec[i].autoIncrement=TRUE /><cfelse><cfset alterSpec[i].autoIncrement=FALSE /></cfif> </cfloop> + + <!---||| Create Single Column INDEX,UNIQUE,FULLTEXT alterSpec for each new indexed field |||---> + <!--- Loop over each new field and find requested indexes ... ---> + <cfloop from="1" to="#FORM.numberOfFields#" index="i"> + <cfscript> + /* If its a "Unique" index ... */ + if(alterSpec[i].key IS "Unique"){ + tempStruct=StructNew(); // Create a Temporary Structure for each new unique index + tempStruct.format="ADD UNIQUE"; // Create Key "format" + + // ToDo [index_name] + + // Create index column names Array + tempStruct.index_col_names=ArrayNew(1); + tempStruct.index_col_names[1]=alterSpec[i].colName; + + ArrayAppend(alterSpec, tempStruct); // Add the Temporary Sturcture to alterSpec + } + /* Else If its a plain "Index" ... */ + // else if(alterSpec[i].key IS "Index"){} + + /* Else If its a "Fulltext" index ... */ + // else if(alterSpec[i].key IS "Fulltext"){} + </cfscript> + </cfloop> + <!-------------------------------------------------> |