[Mydatabasepilot-cvs] MyDatabasePilot/dbProcessBody AddField.cfm,1.4,1.5
Status: Alpha
Brought to you by:
nanoface
From: <nan...@us...> - 2003-06-01 03:35:38
|
Update of /cvsroot/mydatabasepilot/MyDatabasePilot/dbProcessBody In directory sc8-pr-cvs1:/tmp/cvs-serv12465/dbProcessBody Modified Files: AddField.cfm Log Message: Functionality Added: [ 746862 ] Continued Development of dbProcessBody/AddField.cfm Completed INTEGER, FLOAT, DOUBLE, DECIMAL, DATE, TIME, TIMESTAMP Options Moved Field Name and Type in same column for more condensed look Some development on the INDEX column. (More work required) Added Quick Reference Notes Index: AddField.cfm =================================================================== RCS file: /cvsroot/mydatabasepilot/MyDatabasePilot/dbProcessBody/AddField.cfm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AddField.cfm 29 May 2003 23:41:51 -0000 1.4 --- AddField.cfm 1 Jun 2003 03:35:35 -0000 1.5 *************** *** 10,17 **** <cfparam name="FORM.numberOfFields" default="1" /> <cfparam name="FORM.locationOfFields" default="End" /> - <cfdump var="number of fields: #FORM.numberOfFields# location of fields: #FORM.locationOfFields#"> ! <!---||| Initiate a Read Only lock to ensure the integrity of session variables |||---> ! <cflock timeout = "30" throwontimeout="no" type = "readonly" scope = "session"> <!---||| Create AddField FORM |||---> <cfform action="#currentPath#?#SESSION.URLToken#&dbProcess=AddField&table=#URL.table#" method="post" name="FORM_AddField" enablecab="yes" class="Fancy"> --- 10,15 ---- <cfparam name="FORM.numberOfFields" default="1" /> <cfparam name="FORM.locationOfFields" default="End" /> ! <!---||| Initiate a Read Only lock to ensure the integrity of session variables |||---><cflock timeout = "30" throwontimeout="no" type = "readonly" scope = "session"> <!---||| Create AddField FORM |||---> <cfform action="#currentPath#?#SESSION.URLToken#&dbProcess=AddField&table=#URL.table#" method="post" name="FORM_AddField" enablecab="yes" class="Fancy"> *************** *** 60,65 **** <tr> <td><label class="Fancy">Field No:</label></td> ! <td><label class="Fancy">Field Name:</label></td> ! <td><label class="Fancy">Field Type:</label></td> <td><label class="Fancy">Field Options:</label></td> <td><label class="Fancy">Default Value:</label></td> --- 58,62 ---- <tr> <td><label class="Fancy">Field No:</label></td> ! <td><label class="Fancy">Field Name and Type:</label></td> <td><label class="Fancy">Field Options:</label></td> <td><label class="Fancy">Default Value:</label></td> *************** *** 78,89 **** <!--- Set a default value of empty string ---> <cfparam name="FORM.fieldName#i#" default="" /> - <!--- If the form has been resubmitted by an onChange event than the original values for this form will be used ---> - <!---***Add validate="regular_expression" to below, to ensure user entered a valid field name***---> - <td><cfinput name="fieldName#i#" type="text" value="#Evaluate("FORM.fieldName#i#")#" size="20" maxlength="64" required="yes" message="You must enter a valid field name for New Field number #i#." class="Fancy" /></td> - - <!---||| Allow User to Select Field Type |||---> - <!--- Set a default value of empty string ---> <cfparam name="FORM.fieldType#i#" default="" /> <td> <cfselect name="fieldType#i#" size="1" required="yes" class="Fancy" onChange="this.form.submit()"> <!--- Check to see if empty option was selected, and reselect it accordingly ---> --- 75,85 ---- <!--- Set a default value of empty string ---> <cfparam name="FORM.fieldName#i#" default="" /> <cfparam name="FORM.fieldType#i#" default="" /> + <!--- If the form has been resubmitted by an onChange event than the original values for this form will be used ---> <td> + <!--- Field Name ---> + <!---***Add validate="regular_expression" to below, to ensure user entered a valid field name***---> + <cfinput name="fieldName#i#" type="text" value="#Evaluate("FORM.fieldName#i#")#" size="20" maxlength="64" required="yes" message="You must enter a valid field name for New Field number #i#." class="Fancy" /><br /> + <!--- Field Type ---> <cfselect name="fieldType#i#" size="1" required="yes" class="Fancy" onChange="this.form.submit()"> <!--- Check to see if empty option was selected, and reselect it accordingly ---> *************** *** 277,282 **** <!--- Set default values of empty string for text fields ---> <cfparam name="FORM.length#i#" default="" /> - <cfparam name="FORM.displayWidth#i#" default="" /> <cfparam name="FORM.valueList#i#" default="" /> <td valign="middle"> <!---||| Show Available Field Options Based on Selected Field Type |||---> --- 273,278 ---- <!--- Set default values of empty string for text fields ---> <cfparam name="FORM.length#i#" default="" /> <cfparam name="FORM.valueList#i#" default="" /> + <cfparam name="FORM.numberOfDecimals#i#" default="" /> <td valign="middle"> <!---||| Show Available Field Options Based on Selected Field Type |||---> *************** *** 340,346 **** <!---||| INTEGER Options |||---> <cfcase value="TINYINT,SMALLINT,MEDIUMINT,INT,BIGINT"> ! <!--- Show "Display Width" Option, set value to previous request if it exists ---> <!--- Make sure it is an interger between 1-20, set it to not required ---> ! <nobr><label class="Fancy">Display Width(</label><cfinput name="displayWidth#i#" type="text" value="#Evaluate("FORM.displayWidth#i#")#" size="2" maxlength="2" range="1,20" required="no" message="The legal range for Display Width is 1-20. Please correct this field for row number #i#." validate="integer" class="Fancy" /><label class="Fancy">)</label></nobr><br /> <!--- Show AUTO_INCREMENT Option, set it to checked if already set on a previous request ---> <nobr> --- 336,342 ---- <!---||| INTEGER Options |||---> <cfcase value="TINYINT,SMALLINT,MEDIUMINT,INT,BIGINT"> ! <!--- Show "Length" Option, set value to previous request if it exists ---> <!--- Make sure it is an interger between 1-20, set it to not required ---> ! <nobr><label class="Fancy">Length(</label><cfinput name="length#i#" type="text" value="#Evaluate("FORM.length#i#")#" size="2" maxlength="2" range="1,20" required="no" message="The legal range for length is 1-20 in row number #i#. Please correct this field for row number #i#." validate="integer" class="Fancy" /><label class="Fancy">)</label></nobr><br /> <!--- Show AUTO_INCREMENT Option, set it to checked if already set on a previous request ---> <nobr> *************** *** 381,421 **** </cfcase> ! <!---||| FLOAT and DOUBLE Options |||---> ! <cfcase value="FLOAT,DOUBLE"> ! FLOAT, DOUBLE: Needs to be developped<br /> ! Add:[(m,D)] fields<br /> ! <!--- Show UNSIGNED Option, set it to checked if already set on a previous request ---> ! <nobr> ! <cfif IsDefined("FORM.unsigned#i#")> ! <cfinput name="unsigned#i#" type="checkbox" checked="yes" /> ! <cfelse> ! <cfinput name="unsigned#i#" type="checkbox" /> ! </cfif> ! <label for="unsigned#i#" class="Fancy">UNSIGNED</label> ! </nobr><br /> ! <!--- Show ZEROFILL Option, set it to checked if already set on a previous request ---> <nobr> ! <cfif IsDefined("FORM.zerofill#i#")> ! <cfinput name="zerofill#i#" type="checkbox" checked="yes" /> ! <cfelse> ! <cfinput name="zerofill#i#" type="checkbox" /> ! </cfif> ! <label for="zerofill#i#" class="Fancy">ZEROFILL</label> </nobr><br /> - <!--- Show NOT NULL Option, set it to checked if already set on a previous request ---> - <nobr> - <cfif IsDefined("FORM.notNull#i#")> - <cfinput name="notNull#i#" type="checkbox" checked="yes" /> - <cfelse> - <cfinput name="notNull#i#" type="checkbox" /> - </cfif> - <label for="notNull#i#" class="Fancy">NOT NULL</label> - </nobr> - </cfcase> - - <!---||| DECIMAL Options |||---> - <cfcase value="DECIMAL"> - DECIMAL: Needs to be developped<br /> - Add:[(m[,D])] fields<br /> <!--- Show UNSIGNED Option, set it to checked if already set on a previous request ---> <nobr> --- 377,392 ---- </cfcase> ! <!---||| FLOAT, DOUBLE and DECIMAL Options |||---> ! <cfcase value="FLOAT,DOUBLE,DECIMAL"> ! <!--- Show "Length" and "Decimals" Option, set value to previous request if it exists ---> ! <!--- Make sure it is an interger between 1-24, set it to not required ---> ! <nobr><label class="Fancy">Length, Decimals</label></nobr><br /> <nobr> ! <label class="Fancy">(</label> ! <cfinput name="length#i#" type="text" value="#Evaluate("FORM.length#i#")#" size="2" maxlength="2" range="1,24" required="no" message="The legal range for length is 1-24 in row number #i#. Please correct this field for row number #i#." validate="integer" class="Fancy" /> ! <label class="Fancy">,</label> ! <cfinput name="numberOfDecimals#i#" type="text" value="#Evaluate("FORM.numberOfDecimals#i#")#" size="2" maxlength="2" range="1,24" required="no" message="The legal range for Number of Decimals is 1-24. Please correct this field for row number #i#." validate="integer" class="Fancy" /> ! <label class="Fancy">)</label> </nobr><br /> <!--- Show UNSIGNED Option, set it to checked if already set on a previous request ---> <nobr> *************** *** 449,453 **** <!---||| DATE and TIME Options |||---> <cfcase value="DATE,TIME,DATETIME,YEAR,TIMESTAMP"> ! DATE, TIME, DATETIME, YEAR, TIMESTAMP: Needs to be developped<br /> <!--- Show NOT NULL Option, set it to checked if already set on a previous request ---> <nobr> --- 420,445 ---- <!---||| DATE and TIME Options |||---> <cfcase value="DATE,TIME,DATETIME,YEAR,TIMESTAMP"> ! <!--- Show "Length" Option if Data Type is TIMESTAMP, set value to previous request if it exists ---> ! <!--- Make sure it is an interger between 2-14, set it to not required ---> ! <cfif #Evaluate("FORM.fieldType#i#")# IS "TIMESTAMP"> ! <nobr><label class="Fancy">Length(</label><cfinput name="length#i#" type="text" value="#Evaluate("FORM.length#i#")#" size="2" maxlength="2" range="2,14" required="no" message="The legal range for Length is 2-14 in row number #i#. Please correct this field for row number #i#." validate="integer" class="Fancy" /><label class="Fancy">)</label></nobr><br /> ! </cfif> ! ! <!--- Show "Length" Option if Data Type is TIMESTAMP ---> ! <!--- Set value 2 to checked if already set on a previous request otherwise set value 4 to checked ---> ! <cfif #Evaluate("FORM.fieldType#i#")# IS "YEAR"> ! <nobr> ! <label class="Fancy">Length(</label> ! <cfif #Evaluate("FORM.length#i#")# IS 2> ! <cfinput name="length#i#" type="radio" value="2" checked="yes" /><label class="Fancy">2</label> ! <cfinput name="length#i#" type="radio" value="4" /><label class="Fancy">4</label> ! <cfelse> ! <cfinput name="length#i#" type="radio" value="2" /><label class="Fancy">2</label> ! <cfinput name="length#i#" type="radio" value="4" checked="yes" /><label class="Fancy">4</label> ! </cfif> ! <label class="Fancy">)</label> ! </nobr> ! </cfif> ! <!--- Show NOT NULL Option, set it to checked if already set on a previous request ---> <nobr> *************** *** 480,488 **** <!---||| Allow User to Specify a Single Column Index |||---> <td> ! Primary ! Index ! Unique ! None ! Fulltext </td> </tr> --- 472,490 ---- <!---||| Allow User to Specify a Single Column Index |||---> <td> ! <cfinput name="key#i#" type="radio" value="Primary" /><label class="Fancy">Primary</label><br /> ! <cfinput name="key#i#" type="radio" value="Unique" /><label class="Fancy">Unique</label><br /> ! <cfswitch expression="#Evaluate("FORM.fieldType#i#")#"> ! <cfcase value="TINYTEXT,TEXT,MEDIUMTEXT,LONGTEXT,VARCHAR"> ! <cfinput name="key#i#" type="radio" value="Fulltext" /><label class="Fancy">Fulltext</label><br /> ! </cfcase> ! </cfswitch> ! <cfinput name="key#i#" type="radio" value="Index" /><label class="Fancy">Index</label> ! <cfswitch expression="#Evaluate("FORM.fieldType#i#")#"> ! <cfcase value="TINYBLOB,BLOB,MEDIUMBLOB,LONGBLOB,TINYTEXT,TEXT,MEDIUMTEXT,LONGTEXT,CHAR,VARCHAR"> ! Length() ! </cfcase> ! </cfswitch> ! <br /> ! <cfinput name="key#i#" type="radio" value="None" checked="yes" /><label class="Fancy">None</label> </td> </tr> *************** *** 506,508 **** </fieldset> </cfform> ! </cflock> \ No newline at end of file --- 508,519 ---- </fieldset> </cfform> ! </cflock> ! ! ! <h3>Quick Reference Notes</h3> ! <ul> ! <li>Note that if you specify ZEROFILL for a column, MySQL will automatically add the UNSIGNED attribute to the column.</li> ! <li>BLOB and TEXT field types can not have default values.</li> ! <li>A DEFAULT value has to be a constant, it cannot be a function or an expression.</li> ! <li>When putting an index on a BLOB or TEXT column, you MUST always specify the length of the index.</li> ! </ul> \ No newline at end of file |