Skip to content

Commit

Permalink
Update SQL scripts to use Files view instead of table
Browse files Browse the repository at this point in the history
DNN 7.1 removed the Folder column from the Files table, but the view
still has it
  • Loading branch information
Joshua Bradley authored and bdukes committed Mar 23, 2015
1 parent 47bafae commit 7c8ed94
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ select
from {databaseOwner}[{objectQualifier}engageams_vItems] i
join {databaseOwner}[{objectQualifier}EngageAMSDocumentVersion] dv on (i.ItemVersionID = dv.ItemVersionID)
join {databaseOwner}[{objectQualifier}EngageAMSItemVersion] iv on (i.ItemVersionID = iv.ItemVersionID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on dv.FileName = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on dv.FileName = 'fileid=' + convert(varchar, fl.FileID)

GO

Expand Down Expand Up @@ -257,7 +257,7 @@ from
{databaseOwner}[{objectQualifier}engageams_vitems] i
join {databaseOwner}[{objectQualifier}EngageAMSMediaVersion] mv on (i.ItemVersionID = mv.ItemVersionID)
join {databaseOwner}[{objectQualifier}EngageAMSItemVersion] iv on (i.ItemVersionID = iv.ItemVersionID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on mv.FileName = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on mv.FileName = 'fileid=' + convert(varchar, fl.FileID)

GO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ FROM
{databaseOwner}[{objectQualifier}EngageAMSItem] i
join {databaseOwner}[{objectQualifier}EngageAMSItemType] it on (i.ItemTypeID = it.ItemTypeID)
join {databaseOwner}[{objectQualifier}EngageAMSItemVersion] iv on (i.ItemID = iv.ItemID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)



Expand Down Expand Up @@ -196,7 +196,7 @@ from
{databaseOwner}[{objectQualifier}engageams_vItems] i
join {databaseOwner}[{objectQualifier}EngageAMSDocumentVersion] dv on (i.ItemVersionID = dv.ItemVersionID)
join {databaseOwner}[{objectQualifier}EngageAMSItemVersion] iv on (i.ItemVersionID = iv.ItemVersionID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on dv.FileName = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on dv.FileName = 'fileid=' + convert(varchar, fl.FileID)



Expand Down Expand Up @@ -225,7 +225,7 @@ from
{databaseOwner}[{objectQualifier}engageams_vitems] i
join {databaseOwner}[{objectQualifier}EngageAMSMediaVersion] mv on (i.ItemVersionID = mv.ItemVersionID)
join {databaseOwner}[{objectQualifier}EngageAMSItemVersion] iv on (i.ItemVersionID = iv.ItemVersionID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on mv.FileName = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on mv.FileName = 'fileid=' + convert(varchar, fl.FileID)



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ FROM
{databaseOwner}[{objectQualifier}EngageAMSItem] i
join {databaseOwner}[{objectQualifier}EngageAMSItemType] it on (i.ItemTypeID = it.ItemTypeID)
join {databaseOwner}[{objectQualifier}EngageAMSItemVersion] iv on (i.ItemID = iv.ItemID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
GO

SET ANSI_NULLS OFF
Expand Down Expand Up @@ -194,7 +194,7 @@ from
{databaseOwner}[{objectQualifier}engageams_vItems] i
join {databaseOwner}[{objectQualifier}EngageAMSDocumentVersion] dv on (i.ItemVersionID = dv.ItemVersionID)
join {databaseOwner}[{objectQualifier}EngageAMSItemVersion] iv on (i.ItemVersionID = iv.ItemVersionID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on dv.FileName = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on dv.FileName = 'fileid=' + convert(varchar, fl.FileID)



Expand Down Expand Up @@ -223,7 +223,7 @@ from
{databaseOwner}[{objectQualifier}engageams_vitems] i
join {databaseOwner}[{objectQualifier}EngageAMSMediaVersion] mv on (i.ItemVersionID = mv.ItemVersionID)
join {databaseOwner}[{objectQualifier}EngageAMSItemVersion] iv on (i.ItemVersionID = iv.ItemVersionID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on mv.FileName = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on mv.FileName = 'fileid=' + convert(varchar, fl.FileID)



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ FROM
{databaseOwner}[{objectQualifier}Publish_Item] i
join {databaseOwner}[{objectQualifier}Publish_ItemType] it on (i.ItemTypeID = it.ItemTypeID)
join {databaseOwner}[{objectQualifier}Publish_ItemVersion] iv on (i.ItemID = iv.ItemID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)

GO

Expand Down Expand Up @@ -395,7 +395,7 @@ from
{databaseOwner}[{objectQualifier}Publish_vwItems] i
join {databaseOwner}[{objectQualifier}Publish_DocumentVersion] dv on (i.ItemVersionID = dv.ItemVersionID)
join {databaseOwner}[{objectQualifier}Publish_ItemVersion] iv on (i.ItemVersionID = iv.ItemVersionID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on dv.FileName = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on dv.FileName = 'fileid=' + convert(varchar, fl.FileID)

GO

Expand Down Expand Up @@ -442,7 +442,7 @@ from
{databaseOwner}[{objectQualifier}Publish_vwItems] i
join {databaseOwner}[{objectQualifier}Publish_MediaVersion] mv on (i.ItemVersionID = mv.ItemVersionID)
join {databaseOwner}[{objectQualifier}Publish_ItemVersion] iv on (i.ItemVersionID = iv.ItemVersionID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on mv.FileName = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on mv.FileName = 'fileid=' + convert(varchar, fl.FileID)

GO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ FROM
{databaseOwner}[{objectQualifier}Publish_Item] i
join {databaseOwner}[{objectQualifier}Publish_ItemType] it on (i.ItemTypeID = it.ItemTypeID)
join {databaseOwner}[{objectQualifier}Publish_ItemVersion] iv on (i.ItemID = iv.ItemID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)


GO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ FROM
{databaseOwner}[{objectQualifier}Publish_Item] i
join {databaseOwner}[{objectQualifier}Publish_ItemType] it on (i.ItemTypeID = it.ItemTypeID)
join {databaseOwner}[{objectQualifier}Publish_ItemVersion] iv on (i.ItemID = iv.ItemID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
GO

if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Publish_vwParentItems]') and OBJECTPROPERTY(id, N'IsView') = 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ FROM
{databaseOwner}[{objectQualifier}Publish_Item] i
join {databaseOwner}[{objectQualifier}Publish_ItemType] it on (i.ItemTypeID = it.ItemTypeID)
join {databaseOwner}[{objectQualifier}Publish_ItemVersion] iv on (i.ItemID = iv.ItemID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
GO

if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Publish_vwParentItems]') and OBJECTPROPERTY(id, N'IsView') = 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ FROM
{databaseOwner}[{objectQualifier}Publish_Item] i
join {databaseOwner}[{objectQualifier}Publish_ItemType] it on (i.ItemTypeID = it.ItemTypeID)
join {databaseOwner}[{objectQualifier}Publish_ItemVersion] iv on (i.ItemID = iv.ItemID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
GO

if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Publish_vwParentItems]') and OBJECTPROPERTY(id, N'IsView') = 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ FROM
{databaseOwner}[{objectQualifier}Publish_Item] i
join {databaseOwner}[{objectQualifier}Publish_ItemType] it on (i.ItemTypeID = it.ItemTypeID)
join {databaseOwner}[{objectQualifier}Publish_ItemVersion] iv on (i.ItemID = iv.ItemID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
GO

if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Publish_vwParentItems]') and OBJECTPROPERTY(id, N'IsView') = 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ FROM
{databaseOwner}[{objectQualifier}Publish_Item] i
join {databaseOwner}[{objectQualifier}Publish_ItemType] it on (i.ItemTypeID = it.ItemTypeID)
join {databaseOwner}[{objectQualifier}Publish_ItemVersion] iv on (i.ItemID = iv.ItemID)
left outer join {databaseOwner}[{objectQualifier}Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
GO

if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Publish_vwParentItems]') and OBJECTPROPERTY(id, N'IsView') = 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ FROM
join {databaseOwner}[{objectQualifier}Publish_ItemType] it on (i.ItemTypeID = it.ItemTypeID)
join {databaseOwner}[{objectQualifier}Publish_ItemVersion] iv on (i.ItemID = iv.ItemID)
left outer join {databaseOwner}[{objectQualifier}Publish_ItemVersionSettings] ivs on (iv.ItemVersionId = ivs.ItemVersionId and ivs.controlname ='lblAuthorName' and ivs.PropertyName ='Text')
left outer join {databaseOwner}[{objectQualifier}Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
left outer join {databaseOwner}[{objectQualifier}vw_Files] fl on iv.Thumbnail = 'fileid=' + convert(varchar, fl.FileID)
GO

if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Publish_vwParentItems]') and OBJECTPROPERTY(id, N'IsView') = 1)
Expand Down

0 comments on commit 7c8ed94

Please sign in to comment.