Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More css clean up. Added several migrations for tweaking user table. …
…Resized password field and added several indexes
- Loading branch information
Russ Johnson
committed
Jul 10, 2012
1 parent
b72eb8e
commit a546dcd
Showing
11 changed files
with
90 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!--- | ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| Parameter | Required | Type | Default | Description | | ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| table | Yes | string | | existing table name | | ||
| columnName | Yes | string | | name for column to change | | ||
| columnType | Yes | string | | new type for column | | ||
| referenceName | No | string | | name for new reference column, see documentation for references function, required if columnType is 'reference' | | ||
| default | No | string | | default value for column | | ||
| null | No | boolean | | whether nulls are allowed | | ||
| limit | No | number | | character or integer size limit for column | | ||
| precision | No | number | | precision value for decimal columns, i.e. number of digits the column can hold | | ||
| scale | No | number | | scale value for decimal columns, i.e. number of digits that can be placed to the right of the decimal point (must be less than or equal to precision) | | ||
| addColumns | No | number | false | if true, attempts to add columns and database will likely throw an error if column already exists | | ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
EXAMPLE: | ||
changeColumn(table='members',columnType='string',columnName='status',limit=50); | ||
---> | ||
<cfcomponent extends="plugins.dbmigrate.Migration" hint="Resize password column"> | ||
<cffunction name="up"> | ||
<cfscript> | ||
changeColumn(table='users', columnType='string', columnName='password', limit=100); | ||
</cfscript> | ||
</cffunction> | ||
<cffunction name="down"> | ||
<cfscript> | ||
changeColumn(table='users',columnName='password', limit=50); | ||
</cfscript> | ||
</cffunction> | ||
</cfcomponent> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!--- | ||
|----------------------------------------------------------------------------------------------------------------------------| | ||
| Parameter | Required | Type | Default | Description | | ||
|----------------------------------------------------------------------------------------------------------------------------| | ||
| table | Yes | string | | table name | | ||
| columnNames | Yes | string | | one or more column names to index, comma separated | | ||
| unique | No | boolean | false | if true will create a unique index constraint | | ||
| indexName | No | string | | use for index name. Defaults to table name + underscore + first column name | | ||
|----------------------------------------------------------------------------------------------------------------------------| | ||
EXAMPLE: | ||
addIndex(table='members',columnNames='username',unique=true); | ||
---> | ||
<cfcomponent extends="plugins.dbmigrate.Migration" hint="Add indexes to users"> | ||
<cffunction name="up"> | ||
<cfscript> | ||
addIndex(table='users',columnNames='username',unique=true); | ||
addIndex(table='users',columnNames='email',unique=true); | ||
</cfscript> | ||
</cffunction> | ||
<cffunction name="down"> | ||
<cfscript> | ||
removeIndex(table='users', indexName='users_username'); | ||
addIndex(table='users',columnNames='users_email',unique=true); | ||
</cfscript> | ||
</cffunction> | ||
</cfcomponent> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
ALTER TABLE `users` CHANGE `password` `password` VARCHAR(100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
DROP INDEX `users_username` ON `users`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
CREATE UNIQUE INDEX `users_username` ON `users`(`username`); | ||
CREATE UNIQUE INDEX `users_email` ON `users`(`email`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
.required { | ||
color: red; | ||
} | ||
|
||
ul.alert { | ||
margin: 2px 0; | ||
} | ||
|
||
ul.alert li { | ||
margin: 0; | ||
list-style: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
<cfoutput> | ||
<div class="flash"> | ||
<cfif flashKeyExists('error')> | ||
<div class="message error"> | ||
<p>#flash('error')#</p> | ||
</div> | ||
<cfelseif flashKeyExists('success')> | ||
<div class="message success"> | ||
<p>#flash('success')#</p> | ||
</div> | ||
<cfelseif flashKeyExists('warning')> | ||
<div class="message warning"> | ||
<p>#flash('warning')#</p> | ||
</div> | ||
</cfif> | ||
</div> | ||
<cfif flashKeyExists('error')> | ||
#flash('error')# | ||
<cfelseif flashKeyExists('success')> | ||
<p>#flash('success')#</p> | ||
<cfelseif flashKeyExists('warning')> | ||
<p>#flash('warning')#</p> | ||
<cfelseif flashKeyExists('info')> | ||
<p>#flash('info')#</p> | ||
</cfif> | ||
</cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters