mirror of
https://github.com/bitwarden/server.git
synced 2025-06-24 20:58:49 -05:00
PM-20574 removed revisionDate, update procedures and used views
This commit is contained in:
parent
360ee89d4e
commit
22a89cc8da
@ -5,13 +5,12 @@ using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.Dirt.Entities;
|
||||
|
||||
public class OrganizationApplication : ITableObject<Guid>, IRevisable
|
||||
public class OrganizationApplication : ITableObject<Guid>
|
||||
{
|
||||
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()
|
||||
{
|
||||
|
@ -5,14 +5,13 @@ using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Core.Dirt.Entities;
|
||||
|
||||
public class OrganizationReport : ITableObject<Guid>, IRevisable
|
||||
public class OrganizationReport : ITableObject<Guid>
|
||||
{
|
||||
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()
|
||||
{
|
||||
|
@ -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
|
||||
);
|
||||
|
@ -4,10 +4,6 @@ AS
|
||||
SET NOCOUNT ON;
|
||||
|
||||
SELECT
|
||||
[Id],
|
||||
[OrganizationId],
|
||||
[Applications],
|
||||
[CreationDate],
|
||||
[RevisionDate]
|
||||
*
|
||||
FROM [dbo].[OrganizationApplicationView]
|
||||
WHERE [Id] = @Id;
|
||||
|
@ -4,10 +4,6 @@ AS
|
||||
SET NOCOUNT ON;
|
||||
|
||||
SELECT
|
||||
[Id],
|
||||
[OrganizationId],
|
||||
[Applications],
|
||||
[CreationDate],
|
||||
[RevisionDate]
|
||||
*
|
||||
FROM [dbo].[OrganizationApplicationView]
|
||||
WHERE [OrganizationId] = @OrganizationId;
|
||||
|
@ -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;
|
@ -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
|
||||
);
|
||||
|
@ -4,11 +4,6 @@ AS
|
||||
SET NOCOUNT ON;
|
||||
|
||||
SELECT
|
||||
[Id],
|
||||
[OrganizationId],
|
||||
[Date],
|
||||
[ReportData],
|
||||
[CreationDate],
|
||||
[RevisionDate]
|
||||
FROM [dbo].[OrganizationReport]
|
||||
*
|
||||
FROM [dbo].[OrganizationReportView]
|
||||
WHERE [Id] = @Id;
|
||||
|
@ -4,11 +4,6 @@ AS
|
||||
SET NOCOUNT ON;
|
||||
|
||||
SELECT
|
||||
[Id],
|
||||
[OrganizationId],
|
||||
[Date],
|
||||
[ReportData],
|
||||
[CreationDate],
|
||||
[RevisionDate]
|
||||
FROM [dbo].[OrganizationReport]
|
||||
*
|
||||
FROM [dbo].[OrganizationReportView]
|
||||
WHERE [OrganizationId] = @OrganizationId;
|
||||
|
@ -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;
|
@ -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
|
||||
|
@ -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,16 +35,14 @@ 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
|
||||
|
@ -18,8 +18,7 @@ public partial class _2025061300_OrganizationReportsql : Migration
|
||||
OrganizationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
Applications = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
RevisionDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@ -42,8 +41,7 @@ public partial class _2025061300_OrganizationReportsql : Migration
|
||||
Date = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
ReportData = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
RevisionDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||
CreationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
|
@ -17,8 +17,7 @@ public partial class _2025061300_OrganizationReportsql : Migration
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
OrganizationId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Applications = table.Column<string>(type: "text", nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
RevisionDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
CreationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@ -39,8 +38,7 @@ public partial class _2025061300_OrganizationReportsql : Migration
|
||||
OrganizationId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
ReportData = table.Column<string>(type: "text", nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
RevisionDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
CreationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
|
@ -17,8 +17,7 @@ public partial class _2025061300_OrganizationReportsql : Migration
|
||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
OrganizationId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
Applications = table.Column<string>(type: "TEXT", nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
RevisionDate = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
CreationDate = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@ -39,8 +38,7 @@ public partial class _2025061300_OrganizationReportsql : Migration
|
||||
OrganizationId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
Date = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
ReportData = table.Column<string>(type: "TEXT", nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
RevisionDate = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
CreationDate = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user