Skip to content

Commit

Permalink
Merge pull request #6 from Maowse/master
Browse files Browse the repository at this point in the history
Removed username/password params from more cfquery calls
  • Loading branch information
jkeczan committed Apr 28, 2015
2 parents b112c43 + 8cd9698 commit e3731d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions adapters/MicrosoftSQLServer.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
<cfargument name="name" type="string" required="true" hint="table name">
<cfargument name="columnName" type="any" required="true" hint="column name">
<cfset var loc = {}>
<cfquery name="loc.constraints" datasource="#application.wheels.dataSourceName#" username="#application.wheels.dataSourceUserName#" password="#application.wheels.dataSourcePassword#">
<cfquery name="loc.constraints" datasource="#application.wheels.dataSourceName#" >
SELECT
constraint_name
FROM
Expand All @@ -187,7 +187,7 @@
<cfargument name="name" type="string" required="true" hint="table name">
<cfargument name="columnName" type="any" required="true" hint="column name">
<cfset var loc = {}>
<cfquery name="loc.constraints" datasource="#application.wheels.dataSourceName#" username="#application.wheels.dataSourceUserName#" password="#application.wheels.dataSourcePassword#">
<cfquery name="loc.constraints" datasource="#application.wheels.dataSourceName#" >
EXEC sp_helpconstraint #quoteTableName(LCase(arguments.name))#, 'nomsg'
</cfquery>
<cfif StructKeyExists(loc, "constraints") And loc.constraints.RecordCount NEQ "" And loc.constraints.RecordCount GT 0>
Expand All @@ -211,7 +211,7 @@
<cfargument name="columnName" type="any" required="true" hint="column name">
<cfset var loc = {}>
<!--- Based on info presented in `http://stackoverflow.com/questions/765867/list-of-all-index-index-columns-in-sql-server-db` --->
<cfquery name="loc.indexes" datasource="#application.wheels.dataSourceName#" username="#application.wheels.dataSourceUserName#" password="#application.wheels.dataSourcePassword#">
<cfquery name="loc.indexes" datasource="#application.wheels.dataSourceName#" >
SELECT
t.name AS table_name,
col.name AS column_name,
Expand Down
8 changes: 4 additions & 4 deletions dbmigrate.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@

<cffunction name="$setVersionAsMigrated" access="private">
<cfargument name="version" required="true" type="string">
<cfquery datasource="#application.wheels.dataSourceName#" username="#application.wheels.dataSourceUserName#" password="#application.wheels.dataSourcePassword#">
<cfquery datasource="#application.wheels.dataSourceName#">
INSERT INTO schemainfo (version) VALUES (<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.version#">)
</cfquery>
</cffunction>

<cffunction name="$removeVersionAsMigrated" access="private">
<cfargument name="version" required="true" type="string">
<cfquery datasource="#application.wheels.dataSourceName#" username="#application.wheels.dataSourceUserName#" password="#application.wheels.dataSourcePassword#">
<cfquery datasource="#application.wheels.dataSourceName#" >
DELETE FROM schemainfo WHERE version = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.version#">
</cfquery>
</cffunction>
Expand Down Expand Up @@ -222,11 +222,11 @@
<cffunction name="$getVersionsPreviouslyMigrated" access="private" returntype="string">
<cfset var loc = {}>
<cftry>
<cfquery name="loc.qMigratedVersions" datasource="#application.wheels.dataSourceName#" username="#application.wheels.dataSourceUserName#" password="#application.wheels.dataSourcePassword#">
<cfquery name="loc.qMigratedVersions" datasource="#application.wheels.dataSourceName#" >
SELECT version FROM schemainfo ORDER BY version ASC
</cfquery>
<cfcatch type="database">
<cfquery datasource="#application.wheels.dataSourceName#" username="#application.wheels.dataSourceUserName#" password="#application.wheels.dataSourcePassword#">
<cfquery datasource="#application.wheels.dataSourceName#" >
CREATE TABLE schemainfo (version VARCHAR(25))
</cfquery>
<cfreturn "0">
Expand Down

0 comments on commit e3731d1

Please sign in to comment.