@bslau/hmm_prisma_schema 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/prisma/migrations/20241001001812_init/migration.sql +19 -0
- package/prisma/migrations/20241001003443_init/migration.sql +28 -0
- package/prisma/migrations/20241001004057_init/migration.sql +29 -0
- package/prisma/migrations/20241001005234_init/migration.sql +28 -0
- package/prisma/schema.prisma +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
BEGIN TRY
|
|
2
|
+
|
|
3
|
+
BEGIN TRAN;
|
|
4
|
+
|
|
5
|
+
-- AlterTable
|
|
6
|
+
ALTER TABLE [dbo].[HotMetalLabResult] ADD [testId] NVARCHAR(1000) NOT NULL CONSTRAINT [HotMetalLabResult_testId_df] DEFAULT '';
|
|
7
|
+
|
|
8
|
+
COMMIT TRAN;
|
|
9
|
+
|
|
10
|
+
END TRY
|
|
11
|
+
BEGIN CATCH
|
|
12
|
+
|
|
13
|
+
IF @@TRANCOUNT > 0
|
|
14
|
+
BEGIN
|
|
15
|
+
ROLLBACK TRAN;
|
|
16
|
+
END;
|
|
17
|
+
THROW
|
|
18
|
+
|
|
19
|
+
END CATCH
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- A unique constraint covering the columns `[testId]` on the table `HotMetalLabResult` will be added. If there are existing duplicate values, this will fail.
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
BEGIN TRY
|
|
8
|
+
|
|
9
|
+
BEGIN TRAN;
|
|
10
|
+
|
|
11
|
+
-- AlterTable
|
|
12
|
+
ALTER TABLE [dbo].[HotMetalLabResult] DROP CONSTRAINT [HotMetalLabResult_testId_df];
|
|
13
|
+
|
|
14
|
+
-- CreateIndex
|
|
15
|
+
ALTER TABLE [dbo].[HotMetalLabResult] ADD CONSTRAINT [HotMetalLabResult_testId_key] UNIQUE NONCLUSTERED ([testId] DESC);
|
|
16
|
+
|
|
17
|
+
COMMIT TRAN;
|
|
18
|
+
|
|
19
|
+
END TRY
|
|
20
|
+
BEGIN CATCH
|
|
21
|
+
|
|
22
|
+
IF @@TRANCOUNT > 0
|
|
23
|
+
BEGIN
|
|
24
|
+
ROLLBACK TRAN;
|
|
25
|
+
END;
|
|
26
|
+
THROW
|
|
27
|
+
|
|
28
|
+
END CATCH
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the column `testId` on the `HotMetalLabResult` table. All the data in the column will be lost.
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
BEGIN TRY
|
|
8
|
+
|
|
9
|
+
BEGIN TRAN;
|
|
10
|
+
|
|
11
|
+
-- DropIndex
|
|
12
|
+
ALTER TABLE [dbo].[HotMetalLabResult] DROP CONSTRAINT [HotMetalLabResult_testId_key];
|
|
13
|
+
|
|
14
|
+
-- AlterTable
|
|
15
|
+
ALTER TABLE [dbo].[HotMetalLabResult] DROP COLUMN [testId];
|
|
16
|
+
ALTER TABLE [dbo].[HotMetalLabResult] ADD [testSampleId] NVARCHAR(1000) NOT NULL CONSTRAINT [HotMetalLabResult_testSampleId_df] DEFAULT '';
|
|
17
|
+
|
|
18
|
+
COMMIT TRAN;
|
|
19
|
+
|
|
20
|
+
END TRY
|
|
21
|
+
BEGIN CATCH
|
|
22
|
+
|
|
23
|
+
IF @@TRANCOUNT > 0
|
|
24
|
+
BEGIN
|
|
25
|
+
ROLLBACK TRAN;
|
|
26
|
+
END;
|
|
27
|
+
THROW
|
|
28
|
+
|
|
29
|
+
END CATCH
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- A unique constraint covering the columns `[testSampleId]` on the table `HotMetalLabResult` will be added. If there are existing duplicate values, this will fail.
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
BEGIN TRY
|
|
8
|
+
|
|
9
|
+
BEGIN TRAN;
|
|
10
|
+
|
|
11
|
+
-- AlterTable
|
|
12
|
+
ALTER TABLE [dbo].[HotMetalLabResult] DROP CONSTRAINT [HotMetalLabResult_testSampleId_df];
|
|
13
|
+
|
|
14
|
+
-- CreateIndex
|
|
15
|
+
ALTER TABLE [dbo].[HotMetalLabResult] ADD CONSTRAINT [HotMetalLabResult_testSampleId_key] UNIQUE NONCLUSTERED ([testSampleId] DESC);
|
|
16
|
+
|
|
17
|
+
COMMIT TRAN;
|
|
18
|
+
|
|
19
|
+
END TRY
|
|
20
|
+
BEGIN CATCH
|
|
21
|
+
|
|
22
|
+
IF @@TRANCOUNT > 0
|
|
23
|
+
BEGIN
|
|
24
|
+
ROLLBACK TRAN;
|
|
25
|
+
END;
|
|
26
|
+
THROW
|
|
27
|
+
|
|
28
|
+
END CATCH
|
package/prisma/schema.prisma
CHANGED
|
@@ -141,6 +141,7 @@ model Station {
|
|
|
141
141
|
|
|
142
142
|
model HotMetalLabResult {
|
|
143
143
|
id Int @id @default(autoincrement())
|
|
144
|
+
testSampleId String @unique(sort: Desc)
|
|
144
145
|
hotMetal HotMetal @relation(fields: [hotMetalId], references: [id])
|
|
145
146
|
hotMetalId Int
|
|
146
147
|
testDateTime DateTime @db.DateTimeOffset
|