Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d354a6b
commit 010d04f
Showing
165 changed files
with
11,110 additions
and
956 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
declare | ||
@personId int = (select top 1 Id from Person where NickName = 'Ted' and LastName = 'Decker') /*Get PersonId for Ted Decker*/ | ||
|
||
delete from GroupMemberHistorical where GroupMemberId in (select Id from GroupMember where PersonId = @personId) | ||
|
||
DECLARE @FakeDatesTable TABLE ( | ||
[EffectiveDateTime] DATETIME | ||
,[ExpireDateTime] DATETIME | ||
,[IsArchived] BIT | ||
,[CurrentRowIndicator] BIT | ||
) | ||
DECLARE @StartDateTime DATETIME = DateAdd(year, - 10, SysDateTime()) | ||
,@StopDateTime DATETIME = SysDateTime() | ||
DECLARE @EffectiveDateTime DATETIME = @StartDateTime | ||
,@ExpireDateTime DATETIME | ||
,@IsArchived BIT = 0 | ||
,@CurrentRowIndicator BIT = 0 | ||
|
||
set nocount on | ||
WHILE (@EffectiveDateTime < @StopDateTime) | ||
BEGIN | ||
SET @ExpireDateTime = dateadd(MI, floor(RAND() * 180*24*60), @EffectiveDateTime) | ||
if @ExpireDateTime >= @StopDateTime begin | ||
set @ExpireDateTime = '9999-01-01 00:00:00.000' | ||
set @CurrentRowIndicator = 1 | ||
end | ||
|
||
INSERT INTO @FakeDatesTable ( | ||
EffectiveDateTime | ||
,ExpireDateTime | ||
,IsArchived | ||
,CurrentRowIndicator | ||
) | ||
VALUES ( | ||
@EffectiveDateTime | ||
,@ExpireDateTime | ||
,@IsArchived | ||
,@CurrentRowIndicator | ||
); | ||
|
||
SET @EffectiveDateTime = @ExpireDateTime; | ||
SET @IsArchived = case when @IsArchived = 1 then 0 else 1 end | ||
END | ||
|
||
set nocount off | ||
|
||
INSERT INTO [dbo].[GroupMemberHistorical] ( | ||
[GroupMemberId] | ||
,[GroupId] | ||
,[GroupRoleId] | ||
,[GroupRoleName] | ||
,[IsLeader] | ||
,[GroupMemberStatus] | ||
,[IsArchived] | ||
,[ArchivedDateTime] | ||
,[ArchivedByPersonAliasId] | ||
,[InactiveDateTime] | ||
,[EffectiveDateTime] | ||
,[ExpireDateTime] | ||
,[CurrentRowIndicator] | ||
,[CreatedDateTime] | ||
,[Guid] | ||
) | ||
SELECT gm.[Id] [GroupMemberId] | ||
,gm.[GroupId] | ||
,gm.[GroupRoleId] | ||
,r.[Name] [GroupRoleName] | ||
,r.[IsLeader] | ||
,gm.[GroupMemberStatus] | ||
,fd.[IsArchived] | ||
,gm.[ArchivedDateTime] | ||
,gm.[ArchivedByPersonAliasId] | ||
,gm.[InactiveDateTime] | ||
,fd.[EffectiveDateTime] | ||
,fd.[ExpireDateTime] | ||
,fd.[CurrentRowIndicator] | ||
,fd.[EffectiveDateTime] [CreatedDateTime] | ||
,NEWID() [Guid] | ||
FROM GroupMember gm | ||
join GroupTypeRole r on gm.GroupRoleId = r.Id | ||
join @FakeDatesTable fd on 1=1 | ||
where gm.PersonId = @personId | ||
and gm.GroupId in (select GroupId from GroupHistorical) | ||
and gm.Id not in (select GroupMemberId from GroupMemberHistorical) | ||
order by gm.Id | ||
|
||
|
||
|
||
|
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,152 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by the Rock.CodeGeneration project | ||
// Changes to this file will be lost when the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
// <copyright> | ||
// Copyright by the Spark Development Network | ||
// | ||
// Licensed under the Rock Community License (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.rockrms.com/license | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// </copyright> | ||
// | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
|
||
namespace Rock.Client | ||
{ | ||
/// <summary> | ||
/// Base client model for AttributeValueHistorical that only includes the non-virtual fields. Use this for PUT/POSTs | ||
/// </summary> | ||
public partial class AttributeValueHistoricalEntity | ||
{ | ||
/// <summary /> | ||
public int Id { get; set; } | ||
|
||
/// <summary /> | ||
public int AttributeValueId { get; set; } | ||
|
||
/// <summary /> | ||
public bool CurrentRowIndicator { get; set; } | ||
|
||
/// <summary /> | ||
public DateTime EffectiveDateTime { get; set; } | ||
|
||
/// <summary /> | ||
public DateTime ExpireDateTime { get; set; } | ||
|
||
/// <summary /> | ||
public Guid? ForeignGuid { get; set; } | ||
|
||
/// <summary /> | ||
public string ForeignKey { get; set; } | ||
|
||
/// <summary> | ||
/// If the ModifiedByPersonAliasId is being set manually and should not be overwritten with current user when saved, set this value to true | ||
/// </summary> | ||
public bool ModifiedAuditValuesAlreadyUpdated { get; set; } | ||
|
||
/// <summary /> | ||
public string Value { get; set; } | ||
|
||
/// <summary /> | ||
public bool? ValueAsBoolean { get; set; } | ||
|
||
/// <summary /> | ||
public DateTime? ValueAsDateTime { get; set; } | ||
|
||
/// <summary /> | ||
public decimal? ValueAsNumeric { get; set; } | ||
|
||
/// <summary /> | ||
public int? ValueAsPersonId { get; set; } | ||
|
||
/// <summary /> | ||
public string ValueFormatted { get; set; } | ||
|
||
/// <summary> | ||
/// Leave this as NULL to let Rock set this | ||
/// </summary> | ||
public DateTime? CreatedDateTime { get; set; } | ||
|
||
/// <summary> | ||
/// This does not need to be set or changed. Rock will always set this to the current date/time when saved to the database. | ||
/// </summary> | ||
public DateTime? ModifiedDateTime { get; set; } | ||
|
||
/// <summary> | ||
/// Leave this as NULL to let Rock set this | ||
/// </summary> | ||
public int? CreatedByPersonAliasId { get; set; } | ||
|
||
/// <summary> | ||
/// If you need to set this manually, set ModifiedAuditValuesAlreadyUpdated=True to prevent Rock from setting it | ||
/// </summary> | ||
public int? ModifiedByPersonAliasId { get; set; } | ||
|
||
/// <summary /> | ||
public Guid Guid { get; set; } | ||
|
||
/// <summary /> | ||
public int? ForeignId { get; set; } | ||
|
||
/// <summary> | ||
/// Copies the base properties from a source AttributeValueHistorical object | ||
/// </summary> | ||
/// <param name="source">The source.</param> | ||
public void CopyPropertiesFrom( AttributeValueHistorical source ) | ||
{ | ||
this.Id = source.Id; | ||
this.AttributeValueId = source.AttributeValueId; | ||
this.CurrentRowIndicator = source.CurrentRowIndicator; | ||
this.EffectiveDateTime = source.EffectiveDateTime; | ||
this.ExpireDateTime = source.ExpireDateTime; | ||
this.ForeignGuid = source.ForeignGuid; | ||
this.ForeignKey = source.ForeignKey; | ||
this.ModifiedAuditValuesAlreadyUpdated = source.ModifiedAuditValuesAlreadyUpdated; | ||
this.Value = source.Value; | ||
this.ValueAsBoolean = source.ValueAsBoolean; | ||
this.ValueAsDateTime = source.ValueAsDateTime; | ||
this.ValueAsNumeric = source.ValueAsNumeric; | ||
this.ValueAsPersonId = source.ValueAsPersonId; | ||
this.ValueFormatted = source.ValueFormatted; | ||
this.CreatedDateTime = source.CreatedDateTime; | ||
this.ModifiedDateTime = source.ModifiedDateTime; | ||
this.CreatedByPersonAliasId = source.CreatedByPersonAliasId; | ||
this.ModifiedByPersonAliasId = source.ModifiedByPersonAliasId; | ||
this.Guid = source.Guid; | ||
this.ForeignId = source.ForeignId; | ||
|
||
} | ||
} | ||
|
||
/// <summary> | ||
/// Client model for AttributeValueHistorical that includes all the fields that are available for GETs. Use this for GETs (use AttributeValueHistoricalEntity for POST/PUTs) | ||
/// </summary> | ||
public partial class AttributeValueHistorical : AttributeValueHistoricalEntity | ||
{ | ||
/// <summary /> | ||
public AttributeValue AttributeValue { get; set; } | ||
|
||
/// <summary> | ||
/// NOTE: Attributes are only populated when ?loadAttributes is specified. Options for loadAttributes are true, false, 'simple', 'expanded' | ||
/// </summary> | ||
public Dictionary<string, Rock.Client.Attribute> Attributes { get; set; } | ||
|
||
/// <summary> | ||
/// NOTE: AttributeValues are only populated when ?loadAttributes is specified. Options for loadAttributes are true, false, 'simple', 'expanded' | ||
/// </summary> | ||
public Dictionary<string, Rock.Client.AttributeValue> AttributeValues { get; set; } | ||
} | ||
} |
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
Oops, something went wrong.