Skip to content

Commit 00f2d76

Browse files
Added transactions and fixed wrong data type for MySql
1 parent f2fc8a9 commit 00f2d76

8 files changed

+36
-10
lines changed

MSSQL/ConfigurationDbContext.sql

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
BEGIN TRANSACTION
12

23
--Add New Tables
34

@@ -297,4 +298,6 @@ ALTER TABLE Clients
297298
--DROP TABLE ApiProperties
298299
--DROP TABLE ApiSecrets
299300
--DROP TABLE IdentityClaims
300-
--DROP TABLE IdentityProperties
301+
--DROP TABLE IdentityProperties
302+
303+
COMMIT TRANSACTION

MSSQL/PersistedGrantDbContext.sql

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
BEGIN TRANSACTION
3+
24
-- Alter Existing Tables
35

46
-- DeviceCodes
@@ -23,4 +25,6 @@ ALTER TABLE PersistedGrants
2325
ADD ConsumedTime DATETIME2 (7) NULL
2426

2527
CREATE NONCLUSTERED INDEX IX_PersistedGrants_SubjectId_SessionId_Type
26-
ON PersistedGrants(SubjectId ASC, SessionId ASC, Type ASC);
28+
ON PersistedGrants(SubjectId ASC, SessionId ASC, Type ASC);
29+
30+
COMMIT TRANSACTION;

MySql/ConfigurationDbContext.sql

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
START TRANSACTION;
12

23
-- Add New Tables
34

@@ -243,8 +244,10 @@ SET SQL_SAFE_UPDATES = @OLDSAFEUPDATEVALUE;
243244

244245
-- Delete Old Tables
245246

246-
-- DROP TABLE `ApiClaims`
247-
-- DROP TABLE `ApiProperties`
248-
-- DROP TABLE `ApiSecrets`
249-
-- DROP TABLE `IdentityClaims`
250-
-- DROP TABLE `IdentityProperties`
247+
-- DROP TABLE `ApiClaims`;
248+
-- DROP TABLE `ApiProperties`;
249+
-- DROP TABLE `ApiSecrets`;
250+
-- DROP TABLE `IdentityClaims`;
251+
-- DROP TABLE `IdentityProperties`;
252+
253+
COMMIT;

MySql/PersistedGrantDbContext.sql

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
START TRANSACTION;
2+
13
-- Alter Existing Tables
24

35
-- DeviceCodes
@@ -19,6 +21,8 @@ ALTER TABLE `PersistedGrants`
1921
ADD `Description` nvarchar(200) NULL;
2022

2123
ALTER TABLE `PersistedGrants`
22-
ADD `ConsumedTime` datetime2(7) NULL;
24+
ADD `ConsumedTime` date NULL;
2325

2426
ALTER TABLE `PersistedGrants` ADD INDEX `IX_PersistedGrants_SubjectId_SessionId_Type` (`SubjectId`, `SessionId`, Type);
27+
28+
COMMIT;

Postgres/ConfigurationDbContext.sql

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
BEGIN;
12

23
-- Add New Tables
34

@@ -243,4 +244,6 @@ ALTER TABLE "Clients"
243244
-- DROP TABLE "ApiProperties";
244245
-- DROP TABLE "ApiSecrets";
245246
-- DROP TABLE "IdentityClaims";
246-
-- DROP TABLE "IdentityProperties";
247+
-- DROP TABLE "IdentityProperties";
248+
249+
COMMIT;

Postgres/PersistedGrantDbContext.sql

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
BEGIN;
12

23
-- Alter Existing Tables
34

@@ -23,3 +24,5 @@ ALTER TABLE "PersistedGrants"
2324
ADD "ConsumedTime" timestamp without time zone NULL;
2425

2526
CREATE INDEX "IX_PersistedGrants_SubjectId_SessionId_Type" ON "PersistedGrants" ("SubjectId", "SessionId", "Type");
27+
28+
COMMIT;

Sqlite/ConfigurationDbContext.sql

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
BEGIN TRANSACTION;
12

23
-- Add New Tables
34

@@ -385,3 +386,5 @@ CREATE UNIQUE INDEX "IX_Clients_ClientId" ON "Clients" ("ClientId");
385386
-- DROP TABLE "ApiScopeClaims_Backup";
386387
-- DROP TABLE "ApiScopes_Backup";
387388
-- DROP TABLE "Clients_Backup";
389+
390+
COMMIT;

Sqlite/PeristedGrantDbContext.sql

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
BEGIN TRANSACTION;
12

23
-- Alter Existing Tables
34

@@ -12,4 +13,6 @@ ALTER TABLE "PersistedGrants" ADD "SessionId" TEXT NULL;
1213
ALTER TABLE "PersistedGrants" ADD "Description" TEXT NULL;
1314
ALTER TABLE "PersistedGrants" ADD "ConsumedTime" TEXT NULL;
1415

15-
CREATE INDEX "IX_PersistedGrants_SubjectId_SessionId_Type" ON "PersistedGrants" ("SubjectId", "SessionId", "Type");
16+
CREATE INDEX "IX_PersistedGrants_SubjectId_SessionId_Type" ON "PersistedGrants" ("SubjectId", "SessionId", "Type");
17+
18+
COMMIT;

0 commit comments

Comments
 (0)