diff --git a/src/Core/Dirt/Entities/OrganizationApplication.cs b/src/Core/Dirt/Entities/OrganizationApplication.cs index 259dbd60dd..6d8ed2e92f 100644 --- a/src/Core/Dirt/Entities/OrganizationApplication.cs +++ b/src/Core/Dirt/Entities/OrganizationApplication.cs @@ -5,13 +5,12 @@ using Bit.Core.Utilities; namespace Bit.Core.Dirt.Entities; -public class OrganizationApplication : ITableObject, IRevisable +public class OrganizationApplication : ITableObject { public Guid Id { get; set; } public Guid OrganizationId { get; set; } public string Applications { get; set; } = string.Empty; public DateTime CreationDate { get; set; } = DateTime.UtcNow; - public DateTime RevisionDate { get; set; } = DateTime.UtcNow; public void SetNewId() { diff --git a/src/Core/Dirt/Entities/OrganizationReport.cs b/src/Core/Dirt/Entities/OrganizationReport.cs index 69787b4667..0f327c5c8f 100644 --- a/src/Core/Dirt/Entities/OrganizationReport.cs +++ b/src/Core/Dirt/Entities/OrganizationReport.cs @@ -5,14 +5,13 @@ using Bit.Core.Utilities; namespace Bit.Core.Dirt.Entities; -public class OrganizationReport : ITableObject, IRevisable +public class OrganizationReport : ITableObject { public Guid Id { get; set; } public Guid OrganizationId { get; set; } public DateTime Date { get; set; } public string ReportData { get; set; } = string.Empty; public DateTime CreationDate { get; set; } = DateTime.UtcNow; - public DateTime RevisionDate { get; set; } = DateTime.UtcNow; public void SetNewId() { diff --git a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_Create.sql b/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_Create.sql index 91273d4d3d..c8c58eea27 100644 --- a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_Create.sql +++ b/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_Create.sql @@ -2,8 +2,7 @@ CREATE PROCEDURE [dbo].[OrganizationApplication_Create] @Id UNIQUEIDENTIFIER OUTPUT, @OrganizationId UNIQUEIDENTIFIER, @Applications NVARCHAR(MAX), - @CreationDate DATETIME2(7), - @RevisionDate DATETIME2(7) + @CreationDate DATETIME2(7) AS SET NOCOUNT ON; @@ -12,14 +11,12 @@ AS [Id], [OrganizationId], [Applications], - [CreationDate], - [RevisionDate] + [CreationDate] ) VALUES ( @Id, @OrganizationId, @Applications, - @CreationDate, - @RevisionDate - ); + @CreationDate + ); diff --git a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_ReadById.sql b/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_ReadById.sql index 4421492973..13f9667df6 100644 --- a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_ReadById.sql +++ b/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_ReadById.sql @@ -4,10 +4,6 @@ AS SET NOCOUNT ON; SELECT - [Id], - [OrganizationId], - [Applications], - [CreationDate], - [RevisionDate] + * FROM [dbo].[OrganizationApplicationView] WHERE [Id] = @Id; diff --git a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_ReadByOrganizationId.sql b/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_ReadByOrganizationId.sql index a6cbad9abf..9872c72e8d 100644 --- a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_ReadByOrganizationId.sql +++ b/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_ReadByOrganizationId.sql @@ -4,10 +4,6 @@ AS SET NOCOUNT ON; SELECT - [Id], - [OrganizationId], - [Applications], - [CreationDate], - [RevisionDate] + * FROM [dbo].[OrganizationApplicationView] WHERE [OrganizationId] = @OrganizationId; diff --git a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_Update.sql b/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_Update.sql deleted file mode 100644 index 979a10f095..0000000000 --- a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationApplication_Update.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE PROCEDURE [dbo].[OrganizationApplication_Update] - @Id UNIQUEIDENTIFIER OUTPUT, - @OrganizationId UNIQUEIDENTIFIER, - @Applications NVARCHAR(MAX), - @CreationDate DATETIME2(7), - @RevisionDate DATETIME2(7) -AS - SET NOCOUNT ON; - UPDATE [dbo].[OrganizationApplication] - SET - [OrganizationId] = @OrganizationId, - [Applications] = @Applications, - [RevisionDate] = @RevisionDate - WHERE [Id] = @Id; diff --git a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_Create.sql b/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_Create.sql index 26f92153ad..d0cea4d73b 100644 --- a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_Create.sql +++ b/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_Create.sql @@ -3,8 +3,7 @@ CREATE PROCEDURE [dbo].[OrganizationReport_Create] @OrganizationId UNIQUEIDENTIFIER, @Date DATETIME2(7), @ReportData NVARCHAR(MAX), - @CreationDate DATETIME2(7), - @RevisionDate DATETIME2(7) + @CreationDate DATETIME2(7) AS SET NOCOUNT ON; @@ -13,14 +12,12 @@ AS [OrganizationId], [Date], [ReportData], - [CreationDate], - [RevisionDate] + [CreationDate] ) VALUES ( @Id, @OrganizationId, @Date, @ReportData, - @CreationDate, - @RevisionDate + @CreationDate ); diff --git a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_ReadById.sql b/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_ReadById.sql index 92ac1ff14d..046172a4c3 100644 --- a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_ReadById.sql +++ b/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_ReadById.sql @@ -4,11 +4,6 @@ AS SET NOCOUNT ON; SELECT - [Id], - [OrganizationId], - [Date], - [ReportData], - [CreationDate], - [RevisionDate] - FROM [dbo].[OrganizationReport] + * + FROM [dbo].[OrganizationReportView] WHERE [Id] = @Id; diff --git a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_ReadByOrganizationId.sql b/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_ReadByOrganizationId.sql index a0fd5a548f..6bdcf51f70 100644 --- a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_ReadByOrganizationId.sql +++ b/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_ReadByOrganizationId.sql @@ -4,11 +4,6 @@ AS SET NOCOUNT ON; SELECT - [Id], - [OrganizationId], - [Date], - [ReportData], - [CreationDate], - [RevisionDate] - FROM [dbo].[OrganizationReport] + * + FROM [dbo].[OrganizationReportView] WHERE [OrganizationId] = @OrganizationId; diff --git a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_Update.sql b/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_Update.sql deleted file mode 100644 index f4494becdc..0000000000 --- a/src/Sql/dbo/Dirt/Stored Procedures/OrganizationReport_Update.sql +++ /dev/null @@ -1,16 +0,0 @@ -CREATE PROCEDURE [dbo].[OrganizationReport_Update] - @Id UNIQUEIDENTIFIER OUTPUT, - @OrganizationId UNIQUEIDENTIFIER, - @Date DATETIME2(7), - @ReportData NVARCHAR(MAX), - @CreationDate DATETIME2(7), - @RevisionDate DATETIME2(7) -AS - SET NOCOUNT ON; - - UPDATE [dbo].[OrganizationReport] - SET [OrganizationId] = @OrganizationId, - [Date] = @Date, - [ReportData] = @ReportData, - [RevisionDate] = @RevisionDate - WHERE [Id] = @Id; diff --git a/util/Migrator/DbScripts/2025-06-13-00_OrganizationReport.sql b/util/Migrator/DbScripts/2025-06-13-00_OrganizationReport.sql index ef5ff9a726..ae3c42e6c4 100644 --- a/util/Migrator/DbScripts/2025-06-13-00_OrganizationReport.sql +++ b/util/Migrator/DbScripts/2025-06-13-00_OrganizationReport.sql @@ -7,7 +7,6 @@ BEGIN [Date] DATETIME2 (7) NOT NULL, [ReportData] NVARCHAR(MAX) NOT NULL, [CreationDate] DATETIME2 (7) NOT NULL, - [RevisionDate] DATETIME2 (7) NOT NULL, CONSTRAINT [PK_OrganizationReport] PRIMARY KEY CLUSTERED ([Id] ASC), CONSTRAINT [FK_OrganizationReport_Organization] FOREIGN KEY ([OrganizationId]) REFERENCES [dbo].[Organization] ([Id]) ); @@ -32,8 +31,7 @@ CREATE PROCEDURE [dbo].[OrganizationReport_Create] @OrganizationId UNIQUEIDENTIFIER, @Date DATETIME2(7), @ReportData NVARCHAR(MAX), - @CreationDate DATETIME2(7), - @RevisionDate DATETIME2(7) + @CreationDate DATETIME2(7) AS SET NOCOUNT ON; @@ -42,16 +40,14 @@ AS [OrganizationId], [Date], [ReportData], - [CreationDate], - [RevisionDate] + [CreationDate] ) VALUES ( @Id, @OrganizationId, @Date, @ReportData, - @CreationDate, - @RevisionDate + @CreationDate ); GO @@ -71,13 +67,8 @@ AS SET NOCOUNT ON; SELECT - [Id], - [OrganizationId], - [Date], - [ReportData], - [CreationDate], - [RevisionDate] - FROM [dbo].[OrganizationReport] + * + FROM [dbo].[OrganizationReportView] WHERE [Id] = @Id; GO @@ -88,31 +79,7 @@ AS SET NOCOUNT ON; SELECT - [Id], - [OrganizationId], - [Date], - [ReportData], - [CreationDate], - [RevisionDate] - FROM [dbo].[OrganizationReport] + * + FROM [dbo].[OrganizationReportView] WHERE [OrganizationId] = @OrganizationId; GO - -CREATE OR ALTER PROCEDURE [dbo].[OrganizationReport_Update] - @Id UNIQUEIDENTIFIER OUTPUT, - @OrganizationId UNIQUEIDENTIFIER, - @Date DATETIME2(7), - @ReportData NVARCHAR(MAX), - @CreationDate DATETIME2(7), - @RevisionDate DATETIME2(7) -AS - SET NOCOUNT ON; - - UPDATE [dbo].[OrganizationReport] - SET [OrganizationId] = @OrganizationId, - [Date] = @Date, - [ReportData] = @ReportData, - [RevisionDate] = @RevisionDate - WHERE [Id] = @Id; - -GO diff --git a/util/Migrator/DbScripts/2025-06-13-01_OrganizationApplication.sql b/util/Migrator/DbScripts/2025-06-13-01_OrganizationApplication.sql index 28eee839b4..54c68c870d 100644 --- a/util/Migrator/DbScripts/2025-06-13-01_OrganizationApplication.sql +++ b/util/Migrator/DbScripts/2025-06-13-01_OrganizationApplication.sql @@ -6,7 +6,6 @@ BEGIN [OrganizationId] UNIQUEIDENTIFIER NOT NULL, [Applications] NVARCHAR(MAX) NOT NULL, [CreationDate] DATETIME2 (7) NOT NULL, - [RevisionDate] DATETIME2 (7) NOT NULL, CONSTRAINT [PK_OrganizationApplication] PRIMARY KEY CLUSTERED ([Id] ASC), CONSTRAINT [FK_OrganizationApplication_Organization] FOREIGN KEY ([OrganizationId]) REFERENCES [dbo].[Organization] ([Id]) ); @@ -27,8 +26,7 @@ CREATE OR ALTER PROCEDURE [dbo].[OrganizationApplication_Create] @Id UNIQUEIDENTIFIER OUTPUT, @OrganizationId UNIQUEIDENTIFIER, @Applications NVARCHAR(MAX), - @CreationDate DATETIME2(7), - @RevisionDate DATETIME2(7) + @CreationDate DATETIME2(7) AS SET NOCOUNT ON; @@ -37,17 +35,15 @@ AS [Id], [OrganizationId], [Applications], - [CreationDate], - [RevisionDate] + [CreationDate] ) VALUES ( @Id, @OrganizationId, @Applications, - @CreationDate, - @RevisionDate - ); + @CreationDate + ); GO @@ -69,11 +65,7 @@ AS SET NOCOUNT ON; SELECT - [Id], - [OrganizationId], - [Applications], - [CreationDate], - [RevisionDate] + * FROM [dbo].[OrganizationApplicationView] WHERE [Id] = @Id; @@ -85,29 +77,9 @@ AS SET NOCOUNT ON; SELECT - [Id], - [OrganizationId], - [Applications], - [CreationDate], - [RevisionDate] + * FROM [dbo].[OrganizationApplicationView] WHERE [OrganizationId] = @OrganizationId; GO -CREATE OR ALTER PROCEDURE [dbo].[OrganizationApplication_Update] - @Id UNIQUEIDENTIFIER OUTPUT, - @OrganizationId UNIQUEIDENTIFIER, - @Applications NVARCHAR(MAX), - @CreationDate DATETIME2(7), - @RevisionDate DATETIME2(7) -AS - SET NOCOUNT ON; - UPDATE [dbo].[OrganizationApplication] - SET - [OrganizationId] = @OrganizationId, - [Applications] = @Applications, - [RevisionDate] = @RevisionDate - WHERE [Id] = @Id; - -GO diff --git a/util/MySqlMigrations/Migrations/20250613215532_2025-06-13-00_OrganizationReport.sql.cs b/util/MySqlMigrations/Migrations/20250613215532_2025-06-13-00_OrganizationReport.sql.cs index c0fb3b0791..ac8661efed 100644 --- a/util/MySqlMigrations/Migrations/20250613215532_2025-06-13-00_OrganizationReport.sql.cs +++ b/util/MySqlMigrations/Migrations/20250613215532_2025-06-13-00_OrganizationReport.sql.cs @@ -18,8 +18,7 @@ public partial class _2025061300_OrganizationReportsql : Migration OrganizationId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Applications = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), - CreationDate = table.Column(type: "datetime(6)", nullable: false), - RevisionDate = table.Column(type: "datetime(6)", nullable: false) + CreationDate = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { @@ -42,8 +41,7 @@ public partial class _2025061300_OrganizationReportsql : Migration Date = table.Column(type: "datetime(6)", nullable: false), ReportData = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), - CreationDate = table.Column(type: "datetime(6)", nullable: false), - RevisionDate = table.Column(type: "datetime(6)", nullable: false) + CreationDate = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { diff --git a/util/PostgresMigrations/Migrations/20250613215536_2025-06-13-00_OrganizationReport.sql.cs b/util/PostgresMigrations/Migrations/20250613215536_2025-06-13-00_OrganizationReport.sql.cs index 22900a4da6..370b17a7c1 100644 --- a/util/PostgresMigrations/Migrations/20250613215536_2025-06-13-00_OrganizationReport.sql.cs +++ b/util/PostgresMigrations/Migrations/20250613215536_2025-06-13-00_OrganizationReport.sql.cs @@ -17,8 +17,7 @@ public partial class _2025061300_OrganizationReportsql : Migration Id = table.Column(type: "uuid", nullable: false), OrganizationId = table.Column(type: "uuid", nullable: false), Applications = table.Column(type: "text", nullable: false), - CreationDate = table.Column(type: "timestamp with time zone", nullable: false), - RevisionDate = table.Column(type: "timestamp with time zone", nullable: false) + CreationDate = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { @@ -39,8 +38,7 @@ public partial class _2025061300_OrganizationReportsql : Migration OrganizationId = table.Column(type: "uuid", nullable: false), Date = table.Column(type: "timestamp with time zone", nullable: false), ReportData = table.Column(type: "text", nullable: false), - CreationDate = table.Column(type: "timestamp with time zone", nullable: false), - RevisionDate = table.Column(type: "timestamp with time zone", nullable: false) + CreationDate = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { diff --git a/util/SqliteMigrations/Migrations/20250613215539_2025-06-13-00_OrganizationReport.sql.cs b/util/SqliteMigrations/Migrations/20250613215539_2025-06-13-00_OrganizationReport.sql.cs index c12dc08eda..8e5db7170f 100644 --- a/util/SqliteMigrations/Migrations/20250613215539_2025-06-13-00_OrganizationReport.sql.cs +++ b/util/SqliteMigrations/Migrations/20250613215539_2025-06-13-00_OrganizationReport.sql.cs @@ -17,8 +17,7 @@ public partial class _2025061300_OrganizationReportsql : Migration Id = table.Column(type: "TEXT", nullable: false), OrganizationId = table.Column(type: "TEXT", nullable: false), Applications = table.Column(type: "TEXT", nullable: false), - CreationDate = table.Column(type: "TEXT", nullable: false), - RevisionDate = table.Column(type: "TEXT", nullable: false) + CreationDate = table.Column(type: "TEXT", nullable: false) }, constraints: table => { @@ -39,8 +38,7 @@ public partial class _2025061300_OrganizationReportsql : Migration OrganizationId = table.Column(type: "TEXT", nullable: false), Date = table.Column(type: "TEXT", nullable: false), ReportData = table.Column(type: "TEXT", nullable: false), - CreationDate = table.Column(type: "TEXT", nullable: false), - RevisionDate = table.Column(type: "TEXT", nullable: false) + CreationDate = table.Column(type: "TEXT", nullable: false) }, constraints: table => {