@bslau/hmm_prisma_schema 1.1.1 → 1.1.3

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.
Files changed (25) hide show
  1. package/package.json +21 -21
  2. package/prisma/migrations/20240910061111_init/migration.sql +170 -0
  3. package/prisma/migrations/20240923010138_init/migration.sql +32 -0
  4. package/prisma/migrations/20240923011413_init/migration.sql +37 -0
  5. package/prisma/migrations/20240923013530_init/migration.sql +32 -0
  6. package/prisma/migrations/20240924014028_init/migration.sql +27 -0
  7. package/prisma/migrations/migration_lock.toml +2 -2
  8. package/prisma/schema.prisma +185 -186
  9. package/prisma/migrations/20240730025834_init/migration.sql +0 -96
  10. package/prisma/migrations/20240730053855_init/migration.sql +0 -25
  11. package/prisma/migrations/20240730060242_init/migration.sql +0 -25
  12. package/prisma/migrations/20240801042613_init/migration.sql +0 -19
  13. package/prisma/migrations/20240806010155_introspected_change/migration.sql +0 -26
  14. package/prisma/migrations/20240806010300_init/migration.sql +0 -38
  15. package/prisma/migrations/20240806010520_init/migration.sql +0 -26
  16. package/prisma/migrations/20240806014057_init/migration.sql +0 -28
  17. package/prisma/migrations/20240806014113_init/migration.sql +0 -30
  18. package/prisma/migrations/20240806021256_init/migration.sql +0 -48
  19. package/prisma/migrations/20240806034906_init/migration.sql +0 -26
  20. package/prisma/migrations/20240807043238_init/migration.sql +0 -38
  21. package/prisma/migrations/20240807051740_init/migration.sql +0 -19
  22. package/prisma/migrations/20240808065630_init/migration.sql +0 -20
  23. package/prisma/migrations/20240902061655_init/migration.sql +0 -43
  24. package/prisma/migrations/20240903004603_init/migration.sql +0 -44
  25. package/prisma/migrations/20240903005945_init/migration.sql +0 -35
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
- {
2
- "name": "@bslau/hmm_prisma_schema",
3
- "version": "1.1.1",
4
- "main": "index.js",
5
- "author": "CIPA Development Team",
6
- "license": "ISC",
7
- "description": "HMM PRISMA Schema",
8
- "scripts": {
9
- "generate": "npx prisma generate",
10
- "postinstall": "npm run generate",
11
- "test": "echo \"Error: no test specified\" && exit 1"
12
- },
13
- "devDependencies": {
14
- "@prisma/client": "^5.18.0",
15
- "prisma": "^5.18.0"
16
- },
17
- "peerDependencies": {
18
- "@prisma/client": "5.18.0"
19
- },
20
- "types": "./index.d.ts"
21
- }
1
+ {
2
+ "name": "@bslau/hmm_prisma_schema",
3
+ "version": "1.1.3",
4
+ "main": "index.js",
5
+ "author": "CIPA Development Team",
6
+ "license": "ISC",
7
+ "description": "HMM PRISMA Schema",
8
+ "scripts": {
9
+ "generate": "npx prisma generate",
10
+ "postinstall": "npm run generate",
11
+ "test": "echo \"Error: no test specified\" && exit 1"
12
+ },
13
+ "devDependencies": {
14
+ "@prisma/client": "^5.18.0",
15
+ "prisma": "^5.18.0"
16
+ },
17
+ "peerDependencies": {
18
+ "@prisma/client": "5.18.0"
19
+ },
20
+ "types": "./index.d.ts"
21
+ }
@@ -0,0 +1,170 @@
1
+ BEGIN TRY
2
+
3
+ BEGIN TRAN;
4
+
5
+ -- CreateTable
6
+ CREATE TABLE [dbo].[Cast] (
7
+ [id] INT NOT NULL IDENTITY(1,1),
8
+ [sequenceCastBlastFurnace] INT NOT NULL,
9
+ [datetimeOpeningTapHole] DATETIMEOFFSET,
10
+ [furnace] INT NOT NULL,
11
+ [identityTapHole] INT,
12
+ [datetimeGunUpTapHole] DATETIMEOFFSET,
13
+ [diameterTappingJackBit] INT,
14
+ [lengthTapHole] FLOAT(53),
15
+ [codeIronSlagFlowedFirst] NVARCHAR(1000),
16
+ [durationDelayCast] INT,
17
+ [reasonDelay] INT,
18
+ [codeOpeningTaphole] NVARCHAR(1000),
19
+ [minutesToOpen] INT,
20
+ [codeConditionTapholeCh] NVARCHAR(1000),
21
+ [massIronBeforeSlag] INT,
22
+ [durationIronBeforeSlag] INT,
23
+ [massSlagBeforeIron] INT,
24
+ [durationSlagBeforeIron] INT,
25
+ [identityClayBox] INT,
26
+ [codeTypeClay] NVARCHAR(1000),
27
+ [volumeClayGunUp] FLOAT(53),
28
+ [clayVolumeRate] FLOAT(53),
29
+ [pressureRam] FLOAT(53),
30
+ [preGunUpTemp] FLOAT(53),
31
+ [gunupMaxTemp] FLOAT(53),
32
+ [gunOnHoleDuration] FLOAT(53),
33
+ [codeKish] NVARCHAR(1000),
34
+ [codeTypeGunUp] INT,
35
+ [codeFceDry] NVARCHAR(1000),
36
+ [codeWindCheck] NVARCHAR(1000),
37
+ [createdAt] DATETIME2 NOT NULL CONSTRAINT [Cast_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
38
+ [updatedAt] DATETIME2 NOT NULL,
39
+ CONSTRAINT [Cast_pkey] PRIMARY KEY CLUSTERED ([id]),
40
+ CONSTRAINT [Cast_sequenceCastBlastFurnace_key] UNIQUE NONCLUSTERED ([sequenceCastBlastFurnace] DESC)
41
+ );
42
+
43
+ -- CreateTable
44
+ CREATE TABLE [dbo].[HotMetal] (
45
+ [id] INT NOT NULL IDENTITY(1,1),
46
+ [mesId] INT,
47
+ [castSequence] INT NOT NULL,
48
+ [torpedoId] INT NOT NULL,
49
+ [dateTimeStartFill] DATETIMEOFFSET,
50
+ [dateTimeEndFill] DATETIMEOFFSET,
51
+ [identityBlastFurnace] INT NOT NULL,
52
+ [noPosnTldlTapHole] INT NOT NULL,
53
+ [temperatureHotMetal] INT,
54
+ [dpLevelTldlAuto] INT,
55
+ [dpLevelTldlManual] INT,
56
+ [capacity] INT,
57
+ [massHotMetalResidueTldl] INT,
58
+ [massHotMetalTldlEstimated] INT,
59
+ [massActual] INT,
60
+ [runRate] FLOAT(53),
61
+ [punchOut] BIT NOT NULL CONSTRAINT [HotMetal_punchOut_df] DEFAULT 0,
62
+ [plannedLevelFill] INT,
63
+ [startLevelFill] INT,
64
+ [tareWeight] INT,
65
+ [fillConstraintId] NVARCHAR(1000),
66
+ [numberOfFillConstraints] INT,
67
+ [massHotMetalAdded] INT,
68
+ [createdAt] DATETIME2 NOT NULL CONSTRAINT [HotMetal_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
69
+ [updatedAt] DATETIME2 NOT NULL,
70
+ CONSTRAINT [HotMetal_pkey] PRIMARY KEY CLUSTERED ([id]),
71
+ CONSTRAINT [HotMetal_castSequence_torpedoId_key] UNIQUE NONCLUSTERED ([castSequence],[torpedoId])
72
+ );
73
+
74
+ -- CreateTable
75
+ CREATE TABLE [dbo].[Torpedo] (
76
+ [id] INT NOT NULL IDENTITY(1,1),
77
+ [torpedoId] INT NOT NULL,
78
+ [name] NVARCHAR(1000),
79
+ [description] NVARCHAR(1000),
80
+ [createdAt] DATETIME2 NOT NULL CONSTRAINT [Torpedo_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
81
+ [updatedAt] DATETIME2 NOT NULL,
82
+ CONSTRAINT [Torpedo_pkey] PRIMARY KEY CLUSTERED ([id]),
83
+ CONSTRAINT [Torpedo_torpedoId_key] UNIQUE NONCLUSTERED ([torpedoId] DESC)
84
+ );
85
+
86
+ -- CreateTable
87
+ CREATE TABLE [dbo].[Station] (
88
+ [id] INT NOT NULL IDENTITY(1,1),
89
+ [name] NVARCHAR(1000) NOT NULL,
90
+ [value] NVARCHAR(1000) NOT NULL,
91
+ [createdAt] DATETIME2 NOT NULL CONSTRAINT [Station_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
92
+ [updatedAt] DATETIME2 NOT NULL,
93
+ CONSTRAINT [Station_pkey] PRIMARY KEY CLUSTERED ([id])
94
+ );
95
+
96
+ -- CreateTable
97
+ CREATE TABLE [dbo].[HotMetalLabResult] (
98
+ [id] INT NOT NULL IDENTITY(1,1),
99
+ [hotMetalId] INT NOT NULL,
100
+ [testDateTime] DATETIMEOFFSET NOT NULL,
101
+ [sampleType] NVARCHAR(1000) NOT NULL,
102
+ [Si] FLOAT(53),
103
+ [S] FLOAT(53),
104
+ [P] FLOAT(53),
105
+ [Mn] FLOAT(53),
106
+ [Ni] FLOAT(53),
107
+ [Cr] FLOAT(53),
108
+ [Ti] FLOAT(53),
109
+ [C] FLOAT(53),
110
+ [Cu] FLOAT(53),
111
+ [Zn] FLOAT(53),
112
+ [V] FLOAT(53),
113
+ [createdAt] DATETIME2 NOT NULL CONSTRAINT [HotMetalLabResult_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
114
+ [updatedAt] DATETIME2 NOT NULL,
115
+ CONSTRAINT [HotMetalLabResult_pkey] PRIMARY KEY CLUSTERED ([id]),
116
+ CONSTRAINT [HotMetalLabResult_hotMetalId_key] UNIQUE NONCLUSTERED ([hotMetalId])
117
+ );
118
+
119
+ -- CreateTable
120
+ CREATE TABLE [dbo].[Siding] (
121
+ [id] INT NOT NULL IDENTITY(1,1),
122
+ [name] NVARCHAR(1000) NOT NULL,
123
+ [value] NVARCHAR(1000) NOT NULL,
124
+ [createdAt] DATETIME2 NOT NULL CONSTRAINT [Siding_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
125
+ [updatedAt] DATETIME2 NOT NULL,
126
+ CONSTRAINT [Siding_pkey] PRIMARY KEY CLUSTERED ([id])
127
+ );
128
+
129
+ -- CreateTable
130
+ CREATE TABLE [dbo].[TorpedoLocation] (
131
+ [stationId] INT NOT NULL,
132
+ [position] INT NOT NULL,
133
+ [torpedoId] INT NOT NULL,
134
+ [sidingId] INT,
135
+ [createdAt] DATETIME2 NOT NULL CONSTRAINT [TorpedoLocation_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
136
+ [updatedAt] DATETIME2 NOT NULL,
137
+ CONSTRAINT [TorpedoLocation_pkey] PRIMARY KEY CLUSTERED ([stationId],[position]),
138
+ CONSTRAINT [TorpedoLocation_torpedoId_key] UNIQUE NONCLUSTERED ([torpedoId])
139
+ );
140
+
141
+ -- AddForeignKey
142
+ ALTER TABLE [dbo].[HotMetal] ADD CONSTRAINT [HotMetal_castSequence_fkey] FOREIGN KEY ([castSequence]) REFERENCES [dbo].[Cast]([sequenceCastBlastFurnace]) ON DELETE NO ACTION ON UPDATE CASCADE;
143
+
144
+ -- AddForeignKey
145
+ ALTER TABLE [dbo].[HotMetal] ADD CONSTRAINT [HotMetal_torpedoId_fkey] FOREIGN KEY ([torpedoId]) REFERENCES [dbo].[Torpedo]([torpedoId]) ON DELETE NO ACTION ON UPDATE CASCADE;
146
+
147
+ -- AddForeignKey
148
+ ALTER TABLE [dbo].[HotMetalLabResult] ADD CONSTRAINT [HotMetalLabResult_hotMetalId_fkey] FOREIGN KEY ([hotMetalId]) REFERENCES [dbo].[HotMetal]([id]) ON DELETE NO ACTION ON UPDATE CASCADE;
149
+
150
+ -- AddForeignKey
151
+ ALTER TABLE [dbo].[TorpedoLocation] ADD CONSTRAINT [TorpedoLocation_stationId_fkey] FOREIGN KEY ([stationId]) REFERENCES [dbo].[Station]([id]) ON DELETE NO ACTION ON UPDATE CASCADE;
152
+
153
+ -- AddForeignKey
154
+ ALTER TABLE [dbo].[TorpedoLocation] ADD CONSTRAINT [TorpedoLocation_torpedoId_fkey] FOREIGN KEY ([torpedoId]) REFERENCES [dbo].[Torpedo]([torpedoId]) ON DELETE NO ACTION ON UPDATE CASCADE;
155
+
156
+ -- AddForeignKey
157
+ ALTER TABLE [dbo].[TorpedoLocation] ADD CONSTRAINT [TorpedoLocation_sidingId_fkey] FOREIGN KEY ([sidingId]) REFERENCES [dbo].[Siding]([id]) ON DELETE NO ACTION ON UPDATE CASCADE;
158
+
159
+ COMMIT TRAN;
160
+
161
+ END TRY
162
+ BEGIN CATCH
163
+
164
+ IF @@TRANCOUNT > 0
165
+ BEGIN
166
+ ROLLBACK TRAN;
167
+ END;
168
+ THROW
169
+
170
+ END CATCH
@@ -0,0 +1,32 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `sampleType` 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_hotMetalId_key];
13
+
14
+ -- AlterTable
15
+ ALTER TABLE [dbo].[HotMetalLabResult] DROP COLUMN [sampleType];
16
+ ALTER TABLE [dbo].[HotMetalLabResult] ADD [description] NVARCHAR(1000),
17
+ [testLocation] NVARCHAR(1000),
18
+ [testSampleType] NVARCHAR(1000),
19
+ [testSamplingLocation] NVARCHAR(1000);
20
+
21
+ COMMIT TRAN;
22
+
23
+ END TRY
24
+ BEGIN CATCH
25
+
26
+ IF @@TRANCOUNT > 0
27
+ BEGIN
28
+ ROLLBACK TRAN;
29
+ END;
30
+ THROW
31
+
32
+ END CATCH
@@ -0,0 +1,37 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `description` on the `HotMetalLabResult` table. All the data in the column will be lost.
5
+ - You are about to drop the column `testLocation` on the `HotMetalLabResult` table. All the data in the column will be lost.
6
+ - You are about to drop the column `testSampleType` on the `HotMetalLabResult` table. All the data in the column will be lost.
7
+ - You are about to drop the column `testSamplingLocation` on the `HotMetalLabResult` table. All the data in the column will be lost.
8
+ - A unique constraint covering the columns `[hotMetalId]` on the table `HotMetalLabResult` will be added. If there are existing duplicate values, this will fail.
9
+ - Added the required column `sampleType` to the `HotMetalLabResult` table without a default value. This is not possible if the table is not empty.
10
+
11
+ */
12
+ BEGIN TRY
13
+
14
+ BEGIN TRAN;
15
+
16
+ -- AlterTable
17
+ ALTER TABLE [dbo].[HotMetalLabResult] DROP COLUMN [description],
18
+ [testLocation],
19
+ [testSampleType],
20
+ [testSamplingLocation];
21
+ ALTER TABLE [dbo].[HotMetalLabResult] ADD [sampleType] NVARCHAR(1000) NOT NULL;
22
+
23
+ -- CreateIndex
24
+ ALTER TABLE [dbo].[HotMetalLabResult] ADD CONSTRAINT [HotMetalLabResult_hotMetalId_key] UNIQUE NONCLUSTERED ([hotMetalId]);
25
+
26
+ COMMIT TRAN;
27
+
28
+ END TRY
29
+ BEGIN CATCH
30
+
31
+ IF @@TRANCOUNT > 0
32
+ BEGIN
33
+ ROLLBACK TRAN;
34
+ END;
35
+ THROW
36
+
37
+ END CATCH
@@ -0,0 +1,32 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `sampleType` 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_hotMetalId_key];
13
+
14
+ -- AlterTable
15
+ ALTER TABLE [dbo].[HotMetalLabResult] DROP COLUMN [sampleType];
16
+ ALTER TABLE [dbo].[HotMetalLabResult] ADD [description] NVARCHAR(1000),
17
+ [testLocation] NVARCHAR(1000),
18
+ [testSampleType] NVARCHAR(1000),
19
+ [testSamplingLocation] NVARCHAR(1000);
20
+
21
+ COMMIT TRAN;
22
+
23
+ END TRY
24
+ BEGIN CATCH
25
+
26
+ IF @@TRANCOUNT > 0
27
+ BEGIN
28
+ ROLLBACK TRAN;
29
+ END;
30
+ THROW
31
+
32
+ END CATCH
@@ -0,0 +1,27 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `testLocation` on the `HotMetalLabResult` table. All the data in the column will be lost.
5
+ - You are about to drop the column `testSampleType` on the `HotMetalLabResult` table. All the data in the column will be lost.
6
+
7
+ */
8
+ BEGIN TRY
9
+
10
+ BEGIN TRAN;
11
+
12
+ -- AlterTable
13
+ ALTER TABLE [dbo].[HotMetalLabResult] DROP COLUMN [testLocation],
14
+ [testSampleType];
15
+
16
+ COMMIT TRAN;
17
+
18
+ END TRY
19
+ BEGIN CATCH
20
+
21
+ IF @@TRANCOUNT > 0
22
+ BEGIN
23
+ ROLLBACK TRAN;
24
+ END;
25
+ THROW
26
+
27
+ END CATCH
@@ -1,3 +1,3 @@
1
- # Please do not edit this file manually
2
- # It should be added in your version-control system (i.e. Git)
1
+ # Please do not edit this file manually
2
+ # It should be added in your version-control system (i.e. Git)
3
3
  provider = "mssql"
@@ -1,186 +1,185 @@
1
- generator client {
2
- provider = "prisma-client-js"
3
- }
4
-
5
- datasource db {
6
- provider = "sqlserver"
7
- url = env("DATABASE_URL")
8
- shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
9
- }
10
-
11
- model Cast {
12
- id Int @id @default(autoincrement())
13
- sequenceCastBlastFurnace Int @unique(sort: Desc)
14
- datetimeOpeningTapHole DateTime? @db.DateTimeOffset
15
- furnace Int
16
- identityTapHole Int?
17
- datetimeGunUpTapHole DateTime? @db.DateTimeOffset
18
- diameterTappingJackBit Int?
19
- lengthTapHole Float?
20
- codeIronSlagFlowedFirst String?
21
- durationDelayCast Int?
22
- reasonDelay Int?
23
- codeOpeningTaphole String?
24
- minutesToOpen Int?
25
- codeConditionTapholeCh String?
26
- // [?]
27
- // codeTypeRun String?
28
- // [?]
29
- massIronBeforeSlag Int?
30
- // [?]
31
- durationIronBeforeSlag Int?
32
- // [?]
33
- massSlagBeforeIron Int?
34
- // [?]
35
- durationSlagBeforeIron Int?
36
- identityClayBox Int?
37
- codeTypeClay String?
38
- volumeClayGunUp Float?
39
- clayVolumeRate Float?
40
- pressureRam Float?
41
- preGunUpTemp Float?
42
- gunupMaxTemp Float?
43
- gunOnHoleDuration Float?
44
- // [?] Y/N Or Boolean
45
- codeKish String?
46
- codeTypeGunUp Int?
47
- // [?] Y/N Or Boolean
48
- codeFceDry String?
49
- // [?] Y/N Or Boolean
50
- codeWindCheck String?
51
- createdAt DateTime @default(now())
52
- updatedAt DateTime @updatedAt
53
- hotMetalCollection HotMetal[]
54
- // [?]
55
- // numberOfTorpedos null
56
- }
57
-
58
- model HotMetal {
59
- id Int @id @default(autoincrement())
60
- mesId Int?
61
- cast Cast @relation(fields: [castSequence], references: [sequenceCastBlastFurnace], onDelete: NoAction, onUpdate: Cascade)
62
- castSequence Int
63
- torpedo Torpedo @relation(fields: [torpedoId], references: [torpedoId], onDelete: NoAction, onUpdate: Cascade)
64
- torpedoId Int
65
- labResult HotMetalLabResult?
66
- dateTimeStartFill DateTime? @db.DateTimeOffset
67
- dateTimeEndFill DateTime? @db.DateTimeOffset
68
- identityBlastFurnace Int
69
- noPosnTldlTapHole Int
70
- temperatureHotMetal Int?
71
- dpLevelTldlAuto Int?
72
- dpLevelTldlManual Int?
73
- capacity Int?
74
- massHotMetalResidueTldl Int?
75
- massHotMetalTldlEstimated Int?
76
- massActual Int?
77
- runRate Float?
78
- punchOut Boolean @default(false)
79
- plannedLevelFill Int?
80
- startLevelFill Int?
81
- tareWeight Int?
82
- fillConstraintId String?
83
- numberOfFillConstraints Int?
84
- massHotMetalAdded Int?
85
- createdAt DateTime @default(now())
86
- updatedAt DateTime @updatedAt
87
- // name String?
88
- // description String?
89
- // // TODO: confirm default value
90
- // addAlPucks Boolean @default(false)
91
- // alPucksAdded Boolean @default(false)
92
- // // [?] Necessary?
93
- // // castEndDateTime DateTime
94
- // // [?] One to Many or Many to Many
95
- // consumerBy Int?
96
- // desulphurized Boolean @default(false)
97
- // mass Float?
98
- // massUnitOfMeasure String?
99
- // punchOut Boolean?
100
- // runRate Float?
101
- // silicon Float?
102
- // status String?
103
- // sulphur Float?
104
- // // [?] Necessary?
105
- // // Taphole
106
- // temperature Float?
107
- // temperatureUnitOfMeasure String?
108
- // torpedoFillEnd DateTime? @db.DateTimeOffset
109
- // torpedoFillStart DateTime? @db.DateTimeOffset
110
- // torpedoFillLevel Int?
111
- // torpedoes Torpedo[]
112
-
113
- @@unique(name: "cast_torpedo_id", [castSequence, torpedoId])
114
- }
115
-
116
- model Torpedo {
117
- id Int @id @default(autoincrement())
118
- torpedoId Int @unique(sort: Desc)
119
- name String?
120
- description String?
121
- createdAt DateTime @default(now())
122
- updatedAt DateTime @updatedAt
123
- // sixPitRestriction Boolean @default(false)
124
- // sixPitRestrictionStart DateTime?
125
- // sixPitStart DateTime?
126
- // capacityDynamic Float?
127
- // capacityNominal Float?
128
- // comments String?
129
- // emptyWeight Float?
130
- // gasStart DateTime?
131
- hotMetalCollection HotMetal[]
132
- torpedoLocation TorpedoLocation?
133
- }
134
-
135
- model Station {
136
- id Int @id @default(autoincrement())
137
- name String
138
- value String
139
- createdAt DateTime @default(now())
140
- updatedAt DateTime @updatedAt
141
- torpedoLocations TorpedoLocation[]
142
- }
143
-
144
- model HotMetalLabResult {
145
- id Int @id @default(autoincrement())
146
- hotMetal HotMetal @relation(fields: [hotMetalId], references: [id])
147
- hotMetalId Int @unique
148
- testDateTime DateTime @db.DateTimeOffset
149
- sampleType String
150
- Si Float?
151
- S Float?
152
- P Float?
153
- Mn Float?
154
- Ni Float?
155
- Cr Float?
156
- Ti Float?
157
- C Float?
158
- Cu Float?
159
- Zn Float?
160
- V Float?
161
- createdAt DateTime @default(now())
162
- updatedAt DateTime @updatedAt
163
- }
164
-
165
- model Siding {
166
- id Int @id @default(autoincrement())
167
- name String
168
- value String
169
- createdAt DateTime @default(now())
170
- updatedAt DateTime @updatedAt
171
- torpedoLocations TorpedoLocation[]
172
- }
173
-
174
- model TorpedoLocation {
175
- stationId Int
176
- station Station @relation(fields: [stationId], references: [id], onDelete: NoAction, onUpdate: Cascade)
177
- position Int
178
- torpedo Torpedo @relation(fields: [torpedoId], references: [torpedoId], onDelete: NoAction, onUpdate: Cascade)
179
- torpedoId Int @unique
180
- sidingId Int?
181
- siding Siding? @relation(fields: [sidingId], references: [id], onDelete: NoAction, onUpdate: Cascade)
182
- createdAt DateTime @default(now())
183
- updatedAt DateTime @updatedAt
184
-
185
- @@id([stationId, position])
186
- }
1
+ generator client {
2
+ provider = "prisma-client-js"
3
+ }
4
+
5
+ datasource db {
6
+ provider = "sqlserver"
7
+ url = env("DATABASE_URL")
8
+ shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
9
+ }
10
+
11
+ model Cast {
12
+ id Int @id @default(autoincrement())
13
+ sequenceCastBlastFurnace Int @unique(sort: Desc)
14
+ datetimeOpeningTapHole DateTime? @db.DateTimeOffset
15
+ furnace Int
16
+ identityTapHole Int?
17
+ datetimeGunUpTapHole DateTime? @db.DateTimeOffset
18
+ diameterTappingJackBit Int?
19
+ lengthTapHole Float?
20
+ codeIronSlagFlowedFirst String?
21
+ durationDelayCast Int?
22
+ reasonDelay Int?
23
+ codeOpeningTaphole String?
24
+ minutesToOpen Int?
25
+ codeConditionTapholeCh String?
26
+ // [?]
27
+ // codeTypeRun String?
28
+ // [?]
29
+ massIronBeforeSlag Int?
30
+ // [?]
31
+ durationIronBeforeSlag Int?
32
+ // [?]
33
+ massSlagBeforeIron Int?
34
+ // [?]
35
+ durationSlagBeforeIron Int?
36
+ identityClayBox Int?
37
+ codeTypeClay String?
38
+ volumeClayGunUp Float?
39
+ clayVolumeRate Float?
40
+ pressureRam Float?
41
+ preGunUpTemp Float?
42
+ gunupMaxTemp Float?
43
+ gunOnHoleDuration Float?
44
+ // [?] Y/N Or Boolean
45
+ codeKish String?
46
+ codeTypeGunUp Int?
47
+ // [?] Y/N Or Boolean
48
+ codeFceDry String?
49
+ // [?] Y/N Or Boolean
50
+ codeWindCheck String?
51
+ createdAt DateTime @default(now())
52
+ updatedAt DateTime @updatedAt
53
+ hotMetalCollection HotMetal[]
54
+ }
55
+
56
+ model HotMetal {
57
+ id Int @id @default(autoincrement())
58
+ mesId Int?
59
+ cast Cast @relation(fields: [castSequence], references: [sequenceCastBlastFurnace], onDelete: NoAction, onUpdate: Cascade)
60
+ castSequence Int
61
+ torpedo Torpedo @relation(fields: [torpedoId], references: [torpedoId], onDelete: NoAction, onUpdate: Cascade)
62
+ torpedoId Int
63
+ labResult HotMetalLabResult[]
64
+ dateTimeStartFill DateTime? @db.DateTimeOffset
65
+ dateTimeEndFill DateTime? @db.DateTimeOffset
66
+ identityBlastFurnace Int
67
+ noPosnTldlTapHole Int
68
+ temperatureHotMetal Int?
69
+ dpLevelTldlAuto Int?
70
+ dpLevelTldlManual Int?
71
+ capacity Int?
72
+ massHotMetalResidueTldl Int?
73
+ massHotMetalTldlEstimated Int?
74
+ massActual Int?
75
+ runRate Float?
76
+ punchOut Boolean @default(false)
77
+ plannedLevelFill Int?
78
+ startLevelFill Int?
79
+ tareWeight Int?
80
+ fillConstraintId String?
81
+ numberOfFillConstraints Int?
82
+ massHotMetalAdded Int?
83
+ createdAt DateTime @default(now())
84
+ updatedAt DateTime @updatedAt
85
+ // name String?
86
+ // description String?
87
+ // // TODO: confirm default value
88
+ // addAlPucks Boolean @default(false)
89
+ // alPucksAdded Boolean @default(false)
90
+ // // [?] Necessary?
91
+ // // castEndDateTime DateTime
92
+ // // [?] One to Many or Many to Many
93
+ // consumerBy Int?
94
+ // desulphurized Boolean @default(false)
95
+ // mass Float?
96
+ // massUnitOfMeasure String?
97
+ // punchOut Boolean?
98
+ // runRate Float?
99
+ // silicon Float?
100
+ // status String?
101
+ // sulphur Float?
102
+ // // [?] Necessary?
103
+ // // Taphole
104
+ // temperature Float?
105
+ // temperatureUnitOfMeasure String?
106
+ // torpedoFillEnd DateTime? @db.DateTimeOffset
107
+ // torpedoFillStart DateTime? @db.DateTimeOffset
108
+ // torpedoFillLevel Int?
109
+ // torpedoes Torpedo[]
110
+
111
+ @@unique(name: "cast_torpedo_id", [castSequence, torpedoId])
112
+ }
113
+
114
+ model Torpedo {
115
+ id Int @id @default(autoincrement())
116
+ torpedoId Int @unique(sort: Desc)
117
+ name String?
118
+ description String?
119
+ createdAt DateTime @default(now())
120
+ updatedAt DateTime @updatedAt
121
+ // sixPitRestriction Boolean @default(false)
122
+ // sixPitRestrictionStart DateTime?
123
+ // sixPitStart DateTime?
124
+ // capacityDynamic Float?
125
+ // capacityNominal Float?
126
+ // comments String?
127
+ // emptyWeight Float?
128
+ // gasStart DateTime?
129
+ hotMetalCollection HotMetal[]
130
+ torpedoLocation TorpedoLocation?
131
+ }
132
+
133
+ model Station {
134
+ id Int @id @default(autoincrement())
135
+ name String
136
+ value String
137
+ createdAt DateTime @default(now())
138
+ updatedAt DateTime @updatedAt
139
+ torpedoLocations TorpedoLocation[]
140
+ }
141
+
142
+ model HotMetalLabResult {
143
+ id Int @id @default(autoincrement())
144
+ hotMetal HotMetal @relation(fields: [hotMetalId], references: [id])
145
+ hotMetalId Int
146
+ testDateTime DateTime @db.DateTimeOffset
147
+ testSamplingLocation String?
148
+ description String?
149
+ Si Float?
150
+ S Float?
151
+ P Float?
152
+ Mn Float?
153
+ Ni Float?
154
+ Cr Float?
155
+ Ti Float?
156
+ C Float?
157
+ Cu Float?
158
+ Zn Float?
159
+ V Float?
160
+ createdAt DateTime @default(now())
161
+ updatedAt DateTime @updatedAt
162
+ }
163
+
164
+ model Siding {
165
+ id Int @id @default(autoincrement())
166
+ name String
167
+ value String
168
+ createdAt DateTime @default(now())
169
+ updatedAt DateTime @updatedAt
170
+ torpedoLocations TorpedoLocation[]
171
+ }
172
+
173
+ model TorpedoLocation {
174
+ stationId Int
175
+ station Station @relation(fields: [stationId], references: [id], onDelete: NoAction, onUpdate: Cascade)
176
+ position Int
177
+ torpedo Torpedo @relation(fields: [torpedoId], references: [torpedoId], onDelete: NoAction, onUpdate: Cascade)
178
+ torpedoId Int @unique
179
+ sidingId Int?
180
+ siding Siding? @relation(fields: [sidingId], references: [id], onDelete: NoAction, onUpdate: Cascade)
181
+ createdAt DateTime @default(now())
182
+ updatedAt DateTime @updatedAt
183
+
184
+ @@id([stationId, position])
185
+ }
@@ -1,96 +0,0 @@
1
- BEGIN TRY
2
-
3
- BEGIN TRAN;
4
-
5
- -- CreateTable
6
- CREATE TABLE [dbo].[Cast] (
7
- [id] INT NOT NULL IDENTITY(1,1),
8
- [sequenceCastBlastFurnace] INT NOT NULL,
9
- [datetimeOpeningTapHole] DATETIMEOFFSET,
10
- [furnace] INT NOT NULL,
11
- [identityTapHole] INT NOT NULL,
12
- [datetimeGunUpTapHole] DATETIMEOFFSET,
13
- [diameterTappingJackBit] INT,
14
- [lengthTapHole] FLOAT(53),
15
- [codeIronSlagFlowedFirst] NVARCHAR(1000),
16
- [durationDelayCast] INT,
17
- [reasonDelay] INT,
18
- [codeOpeningTaphole] NVARCHAR(1000),
19
- [minutesToOpen] INT,
20
- [codeConditionTapholeCh] NVARCHAR(1000),
21
- [massIronBeforeSlag] INT,
22
- [durationIronBeforeSlag] INT,
23
- [massSlagBeforeIron] INT,
24
- [durationSlagBeforeIron] INT,
25
- [identityClayBox] INT,
26
- [codeTypeClay] NVARCHAR(1000),
27
- [volumeClayGunUp] FLOAT(53),
28
- [clayVolumeRate] FLOAT(53),
29
- [pressureRam] FLOAT(53),
30
- [temperatureClay] INT,
31
- [preGunUpTemp] FLOAT(53),
32
- [gunupMaxTemp] FLOAT(53),
33
- [gunOnHoleDuration] FLOAT(53),
34
- [codeKish] NVARCHAR(1000),
35
- [codeTypeGunUp] INT,
36
- [codeFceDry] NVARCHAR(1000),
37
- [codeWindCheck] NVARCHAR(1000),
38
- CONSTRAINT [Cast_pkey] PRIMARY KEY CLUSTERED ([id]),
39
- CONSTRAINT [Cast_sequenceCastBlastFurnace_key] UNIQUE NONCLUSTERED ([sequenceCastBlastFurnace] DESC)
40
- );
41
-
42
- -- CreateTable
43
- CREATE TABLE [dbo].[HotMetal] (
44
- [id] INT NOT NULL IDENTITY(1,1),
45
- [hotelMetalId] INT,
46
- [castSequence] INT NOT NULL,
47
- [torpedoId] INT NOT NULL,
48
- [dateTimeStartFill] DATETIMEOFFSET,
49
- [dateTimeEndFill] DATETIMEOFFSET,
50
- [identityBlastFurnace] INT NOT NULL,
51
- [noPosnTldlTapHole] INT NOT NULL,
52
- [temperatureHotMetal] INT,
53
- [dpLevelTldlAuto] INT,
54
- [dpLevelTldlManual] INT,
55
- [capacity] INT,
56
- [massHotMetalResidueTldl] INT,
57
- [massHotMetalTldlEstimated] INT,
58
- [massActual] INT,
59
- [punchOut] BIT NOT NULL CONSTRAINT [HotMetal_punchOut_df] DEFAULT 0,
60
- [plannedLevelFill] INT,
61
- [startLevelFill] INT,
62
- [tareWeight] INT,
63
- [fillConstraintId] NVARCHAR(1000),
64
- [numberOfFillConstraints] INT,
65
- [massHotMetalAdded] INT,
66
- CONSTRAINT [HotMetal_pkey] PRIMARY KEY CLUSTERED ([id])
67
- );
68
-
69
- -- CreateTable
70
- CREATE TABLE [dbo].[Torpedo] (
71
- [id] INT NOT NULL IDENTITY(1,1),
72
- [torpedoId] INT NOT NULL,
73
- [name] NVARCHAR(1000),
74
- [description] NVARCHAR(1000),
75
- CONSTRAINT [Torpedo_pkey] PRIMARY KEY CLUSTERED ([id]),
76
- CONSTRAINT [Torpedo_torpedoId_key] UNIQUE NONCLUSTERED ([torpedoId] DESC)
77
- );
78
-
79
- -- AddForeignKey
80
- ALTER TABLE [dbo].[HotMetal] ADD CONSTRAINT [HotMetal_castSequence_fkey] FOREIGN KEY ([castSequence]) REFERENCES [dbo].[Cast]([sequenceCastBlastFurnace]) ON DELETE NO ACTION ON UPDATE CASCADE;
81
-
82
- -- AddForeignKey
83
- ALTER TABLE [dbo].[HotMetal] ADD CONSTRAINT [HotMetal_torpedoId_fkey] FOREIGN KEY ([torpedoId]) REFERENCES [dbo].[Torpedo]([torpedoId]) ON DELETE NO ACTION ON UPDATE CASCADE;
84
-
85
- COMMIT TRAN;
86
-
87
- END TRY
88
- BEGIN CATCH
89
-
90
- IF @@TRANCOUNT > 0
91
- BEGIN
92
- ROLLBACK TRAN;
93
- END;
94
- THROW
95
-
96
- END CATCH
@@ -1,25 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - You are about to drop the column `temperatureClay` on the `Cast` table. All the data in the column will be lost.
5
-
6
- */
7
- BEGIN TRY
8
-
9
- BEGIN TRAN;
10
-
11
- -- AlterTable
12
- ALTER TABLE [dbo].[Cast] DROP COLUMN [temperatureClay];
13
-
14
- COMMIT TRAN;
15
-
16
- END TRY
17
- BEGIN CATCH
18
-
19
- IF @@TRANCOUNT > 0
20
- BEGIN
21
- ROLLBACK TRAN;
22
- END;
23
- THROW
24
-
25
- END CATCH
@@ -1,25 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - A unique constraint covering the columns `[castSequence,torpedoId]` on the table `HotMetal` will be added. If there are existing duplicate values, this will fail.
5
-
6
- */
7
- BEGIN TRY
8
-
9
- BEGIN TRAN;
10
-
11
- -- CreateIndex
12
- ALTER TABLE [dbo].[HotMetal] ADD CONSTRAINT [HotMetal_castSequence_torpedoId_key] UNIQUE NONCLUSTERED ([castSequence], [torpedoId]);
13
-
14
- COMMIT TRAN;
15
-
16
- END TRY
17
- BEGIN CATCH
18
-
19
- IF @@TRANCOUNT > 0
20
- BEGIN
21
- ROLLBACK TRAN;
22
- END;
23
- THROW
24
-
25
- END CATCH
@@ -1,19 +0,0 @@
1
- BEGIN TRY
2
-
3
- BEGIN TRAN;
4
-
5
- -- AlterTable
6
- ALTER TABLE [dbo].[Cast] ALTER COLUMN [identityTapHole] INT NULL;
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
@@ -1,26 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - You are about to drop the column `hotelMetalId` on the `HotMetal` table. All the data in the column will be lost.
5
-
6
- */
7
- BEGIN TRY
8
-
9
- BEGIN TRAN;
10
-
11
- -- AlterTable
12
- ALTER TABLE [dbo].[HotMetal] DROP COLUMN [hotelMetalId];
13
- ALTER TABLE [dbo].[HotMetal] ADD [mesId] INT;
14
-
15
- COMMIT TRAN;
16
-
17
- END TRY
18
- BEGIN CATCH
19
-
20
- IF @@TRANCOUNT > 0
21
- BEGIN
22
- ROLLBACK TRAN;
23
- END;
24
- THROW
25
-
26
- END CATCH
@@ -1,38 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - You are about to drop the column `mesId` on the `HotMetal` table. All the data in the column will be lost.
5
-
6
- */
7
- BEGIN TRY
8
-
9
- BEGIN TRAN;
10
-
11
- -- AlterTable
12
- ALTER TABLE [dbo].[HotMetal] DROP COLUMN [mesId];
13
- ALTER TABLE [dbo].[HotMetal] ADD [hotelMetalId] INT;
14
-
15
- -- CreateTable
16
- CREATE TABLE [dbo].[Station] (
17
- [id] INT NOT NULL IDENTITY(1,1),
18
- [name] NVARCHAR(1000) NOT NULL,
19
- [value] NVARCHAR(1000) NOT NULL,
20
- [parentStationId] INT,
21
- CONSTRAINT [Station_pkey] PRIMARY KEY CLUSTERED ([id])
22
- );
23
-
24
- -- AddForeignKey
25
- ALTER TABLE [dbo].[Station] ADD CONSTRAINT [Station_parentStationId_fkey] FOREIGN KEY ([parentStationId]) REFERENCES [dbo].[Station]([id]) ON DELETE NO ACTION ON UPDATE NO ACTION;
26
-
27
- COMMIT TRAN;
28
-
29
- END TRY
30
- BEGIN CATCH
31
-
32
- IF @@TRANCOUNT > 0
33
- BEGIN
34
- ROLLBACK TRAN;
35
- END;
36
- THROW
37
-
38
- END CATCH
@@ -1,26 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - Added the required column `updatedAt` to the `Station` table without a default value. This is not possible if the table is not empty.
5
-
6
- */
7
- BEGIN TRY
8
-
9
- BEGIN TRAN;
10
-
11
- -- AlterTable
12
- ALTER TABLE [dbo].[Station] ADD [createdAt] DATETIME2 NOT NULL CONSTRAINT [Station_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
13
- [updatedAt] DATETIME2 NOT NULL;
14
-
15
- COMMIT TRAN;
16
-
17
- END TRY
18
- BEGIN CATCH
19
-
20
- IF @@TRANCOUNT > 0
21
- BEGIN
22
- ROLLBACK TRAN;
23
- END;
24
- THROW
25
-
26
- END CATCH
@@ -1,28 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - You are about to drop the `Station` table. If the table is not empty, all the data it contains will be lost.
5
-
6
- */
7
- BEGIN TRY
8
-
9
- BEGIN TRAN;
10
-
11
- -- DropForeignKey
12
- ALTER TABLE [dbo].[Station] DROP CONSTRAINT [Station_parentStationId_fkey];
13
-
14
- -- DropTable
15
- DROP TABLE [dbo].[Station];
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
@@ -1,30 +0,0 @@
1
- BEGIN TRY
2
-
3
- BEGIN TRAN;
4
-
5
- -- CreateTable
6
- CREATE TABLE [dbo].[Station] (
7
- [id] INT NOT NULL IDENTITY(1,1),
8
- [name] NVARCHAR(1000) NOT NULL,
9
- [value] NVARCHAR(1000) NOT NULL,
10
- [parentStationId] INT,
11
- [createdAt] DATETIME2 NOT NULL CONSTRAINT [Station_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
12
- [updatedAt] DATETIME2 NOT NULL,
13
- CONSTRAINT [Station_pkey] PRIMARY KEY CLUSTERED ([id])
14
- );
15
-
16
- -- AddForeignKey
17
- ALTER TABLE [dbo].[Station] ADD CONSTRAINT [Station_parentStationId_fkey] FOREIGN KEY ([parentStationId]) REFERENCES [dbo].[Station]([id]) ON DELETE NO ACTION ON UPDATE NO ACTION;
18
-
19
- COMMIT TRAN;
20
-
21
- END TRY
22
- BEGIN CATCH
23
-
24
- IF @@TRANCOUNT > 0
25
- BEGIN
26
- ROLLBACK TRAN;
27
- END;
28
- THROW
29
-
30
- END CATCH
@@ -1,48 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - Added the required column `updatedAt` to the `Cast` table without a default value. This is not possible if the table is not empty.
5
- - Added the required column `updatedAt` to the `HotMetal` table without a default value. This is not possible if the table is not empty.
6
- - Added the required column `updatedAt` to the `Torpedo` table without a default value. This is not possible if the table is not empty.
7
-
8
- */
9
- BEGIN TRY
10
-
11
- BEGIN TRAN;
12
-
13
- -- DropForeignKey
14
- ALTER TABLE [dbo].[HotMetal] DROP CONSTRAINT [HotMetal_castSequence_fkey];
15
-
16
- -- DropForeignKey
17
- ALTER TABLE [dbo].[HotMetal] DROP CONSTRAINT [HotMetal_torpedoId_fkey];
18
-
19
- -- AlterTable
20
- ALTER TABLE [dbo].[Cast] ADD [createdAt] DATETIME2 NOT NULL CONSTRAINT [Cast_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
21
- [updatedAt] DATETIME2 NOT NULL;
22
-
23
- -- AlterTable
24
- ALTER TABLE [dbo].[HotMetal] ADD [createdAt] DATETIME2 NOT NULL CONSTRAINT [HotMetal_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
25
- [updatedAt] DATETIME2 NOT NULL;
26
-
27
- -- AlterTable
28
- ALTER TABLE [dbo].[Torpedo] ADD [createdAt] DATETIME2 NOT NULL CONSTRAINT [Torpedo_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
29
- [updatedAt] DATETIME2 NOT NULL;
30
-
31
- -- AddForeignKey
32
- ALTER TABLE [dbo].[HotMetal] ADD CONSTRAINT [HotMetal_castSequence_fkey] FOREIGN KEY ([castSequence]) REFERENCES [dbo].[Cast]([sequenceCastBlastFurnace]) ON DELETE CASCADE ON UPDATE CASCADE;
33
-
34
- -- AddForeignKey
35
- ALTER TABLE [dbo].[HotMetal] ADD CONSTRAINT [HotMetal_torpedoId_fkey] FOREIGN KEY ([torpedoId]) REFERENCES [dbo].[Torpedo]([torpedoId]) ON DELETE CASCADE ON UPDATE CASCADE;
36
-
37
- COMMIT TRAN;
38
-
39
- END TRY
40
- BEGIN CATCH
41
-
42
- IF @@TRANCOUNT > 0
43
- BEGIN
44
- ROLLBACK TRAN;
45
- END;
46
- THROW
47
-
48
- END CATCH
@@ -1,26 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - You are about to drop the column `hotelMetalId` on the `HotMetal` table. All the data in the column will be lost.
5
-
6
- */
7
- BEGIN TRY
8
-
9
- BEGIN TRAN;
10
-
11
- -- AlterTable
12
- ALTER TABLE [dbo].[HotMetal] DROP COLUMN [hotelMetalId];
13
- ALTER TABLE [dbo].[HotMetal] ADD [mesId] INT;
14
-
15
- COMMIT TRAN;
16
-
17
- END TRY
18
- BEGIN CATCH
19
-
20
- IF @@TRANCOUNT > 0
21
- BEGIN
22
- ROLLBACK TRAN;
23
- END;
24
- THROW
25
-
26
- END CATCH
@@ -1,38 +0,0 @@
1
- BEGIN TRY
2
-
3
- BEGIN TRAN;
4
-
5
- -- CreateTable
6
- CREATE TABLE [dbo].[HotMetalLabResult] (
7
- [id] INT NOT NULL IDENTITY(1,1),
8
- [hotMetalId] INT NOT NULL,
9
- [Si] FLOAT(53),
10
- [S] FLOAT(53),
11
- [P] FLOAT(53),
12
- [Mn] FLOAT(53),
13
- [Ni] FLOAT(53),
14
- [Cr] FLOAT(53),
15
- [Ti] FLOAT(53),
16
- [C] FLOAT(53),
17
- [Cu] FLOAT(53),
18
- [Zn] FLOAT(53),
19
- [V] FLOAT(53),
20
- CONSTRAINT [HotMetalLabResult_pkey] PRIMARY KEY CLUSTERED ([id]),
21
- CONSTRAINT [HotMetalLabResult_hotMetalId_key] UNIQUE NONCLUSTERED ([hotMetalId])
22
- );
23
-
24
- -- AddForeignKey
25
- ALTER TABLE [dbo].[HotMetalLabResult] ADD CONSTRAINT [HotMetalLabResult_hotMetalId_fkey] FOREIGN KEY ([hotMetalId]) REFERENCES [dbo].[HotMetal]([id]) ON DELETE NO ACTION ON UPDATE CASCADE;
26
-
27
- COMMIT TRAN;
28
-
29
- END TRY
30
- BEGIN CATCH
31
-
32
- IF @@TRANCOUNT > 0
33
- BEGIN
34
- ROLLBACK TRAN;
35
- END;
36
- THROW
37
-
38
- END CATCH
@@ -1,19 +0,0 @@
1
- BEGIN TRY
2
-
3
- BEGIN TRAN;
4
-
5
- -- AlterTable
6
- ALTER TABLE [dbo].[HotMetal] ADD [runRate] FLOAT(53);
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
@@ -1,20 +0,0 @@
1
- BEGIN TRY
2
-
3
- BEGIN TRAN;
4
-
5
- -- AlterTable
6
- ALTER TABLE [dbo].[HotMetalLabResult] ADD [sampleType] NVARCHAR(1000),
7
- [testDateTime] DATETIMEOFFSET;
8
-
9
- COMMIT TRAN;
10
-
11
- END TRY
12
- BEGIN CATCH
13
-
14
- IF @@TRANCOUNT > 0
15
- BEGIN
16
- ROLLBACK TRAN;
17
- END;
18
- THROW
19
-
20
- END CATCH
@@ -1,43 +0,0 @@
1
- BEGIN TRY
2
-
3
- BEGIN TRAN;
4
-
5
- -- DropForeignKey
6
- ALTER TABLE [dbo].[HotMetal] DROP CONSTRAINT [HotMetal_castSequence_fkey];
7
-
8
- -- DropForeignKey
9
- ALTER TABLE [dbo].[HotMetal] DROP CONSTRAINT [HotMetal_torpedoId_fkey];
10
-
11
- -- CreateTable
12
- CREATE TABLE [dbo].[TorpedoLocation] (
13
- [stationId] INT NOT NULL,
14
- [position] INT NOT NULL,
15
- [torpedoId] INT NOT NULL,
16
- CONSTRAINT [TorpedoLocation_pkey] PRIMARY KEY CLUSTERED ([stationId],[position]),
17
- CONSTRAINT [TorpedoLocation_torpedoId_key] UNIQUE NONCLUSTERED ([torpedoId])
18
- );
19
-
20
- -- AddForeignKey
21
- ALTER TABLE [dbo].[HotMetal] ADD CONSTRAINT [HotMetal_castSequence_fkey] FOREIGN KEY ([castSequence]) REFERENCES [dbo].[Cast]([sequenceCastBlastFurnace]) ON DELETE NO ACTION ON UPDATE CASCADE;
22
-
23
- -- AddForeignKey
24
- ALTER TABLE [dbo].[HotMetal] ADD CONSTRAINT [HotMetal_torpedoId_fkey] FOREIGN KEY ([torpedoId]) REFERENCES [dbo].[Torpedo]([torpedoId]) ON DELETE NO ACTION ON UPDATE CASCADE;
25
-
26
- -- AddForeignKey
27
- ALTER TABLE [dbo].[TorpedoLocation] ADD CONSTRAINT [TorpedoLocation_stationId_fkey] FOREIGN KEY ([stationId]) REFERENCES [dbo].[Station]([id]) ON DELETE NO ACTION ON UPDATE CASCADE;
28
-
29
- -- AddForeignKey
30
- ALTER TABLE [dbo].[TorpedoLocation] ADD CONSTRAINT [TorpedoLocation_torpedoId_fkey] FOREIGN KEY ([torpedoId]) REFERENCES [dbo].[Torpedo]([torpedoId]) ON DELETE NO ACTION ON UPDATE CASCADE;
31
-
32
- COMMIT TRAN;
33
-
34
- END TRY
35
- BEGIN CATCH
36
-
37
- IF @@TRANCOUNT > 0
38
- BEGIN
39
- ROLLBACK TRAN;
40
- END;
41
- THROW
42
-
43
- END CATCH
@@ -1,44 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - You are about to drop the column `parentStationId` on the `Station` table. All the data in the column will be lost.
5
-
6
- */
7
- BEGIN TRY
8
-
9
- BEGIN TRAN;
10
-
11
- -- DropForeignKey
12
- ALTER TABLE [dbo].[Station] DROP CONSTRAINT [Station_parentStationId_fkey];
13
-
14
- -- AlterTable
15
- ALTER TABLE [dbo].[Station] DROP COLUMN [parentStationId];
16
-
17
- -- AlterTable
18
- ALTER TABLE [dbo].[TorpedoLocation] ADD [sidingId] INT;
19
-
20
- -- CreateTable
21
- CREATE TABLE [dbo].[Siding] (
22
- [id] INT NOT NULL IDENTITY(1,1),
23
- [name] NVARCHAR(1000) NOT NULL,
24
- [value] NVARCHAR(1000) NOT NULL,
25
- [createdAt] DATETIME2 NOT NULL CONSTRAINT [Siding_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
26
- [updatedAt] DATETIME2 NOT NULL,
27
- CONSTRAINT [Siding_pkey] PRIMARY KEY CLUSTERED ([id])
28
- );
29
-
30
- -- AddForeignKey
31
- ALTER TABLE [dbo].[TorpedoLocation] ADD CONSTRAINT [TorpedoLocation_sidingId_fkey] FOREIGN KEY ([sidingId]) REFERENCES [dbo].[Siding]([id]) ON DELETE NO ACTION ON UPDATE CASCADE;
32
-
33
- COMMIT TRAN;
34
-
35
- END TRY
36
- BEGIN CATCH
37
-
38
- IF @@TRANCOUNT > 0
39
- BEGIN
40
- ROLLBACK TRAN;
41
- END;
42
- THROW
43
-
44
- END CATCH
@@ -1,35 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - Added the required column `updatedAt` to the `HotMetalLabResult` table without a default value. This is not possible if the table is not empty.
5
- - Made the column `sampleType` on table `HotMetalLabResult` required. This step will fail if there are existing NULL values in that column.
6
- - Made the column `testDateTime` on table `HotMetalLabResult` required. This step will fail if there are existing NULL values in that column.
7
- - Added the required column `updatedAt` to the `TorpedoLocation` table without a default value. This is not possible if the table is not empty.
8
-
9
- */
10
- BEGIN TRY
11
-
12
- BEGIN TRAN;
13
-
14
- -- AlterTable
15
- ALTER TABLE [dbo].[HotMetalLabResult] ALTER COLUMN [sampleType] NVARCHAR(1000) NOT NULL;
16
- ALTER TABLE [dbo].[HotMetalLabResult] ALTER COLUMN [testDateTime] DATETIMEOFFSET NOT NULL;
17
- ALTER TABLE [dbo].[HotMetalLabResult] ADD [createdAt] DATETIME2 NOT NULL CONSTRAINT [HotMetalLabResult_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
18
- [updatedAt] DATETIME2 NOT NULL;
19
-
20
- -- AlterTable
21
- ALTER TABLE [dbo].[TorpedoLocation] ADD [createdAt] DATETIME2 NOT NULL CONSTRAINT [TorpedoLocation_createdAt_df] DEFAULT CURRENT_TIMESTAMP,
22
- [updatedAt] DATETIME2 NOT NULL;
23
-
24
- COMMIT TRAN;
25
-
26
- END TRY
27
- BEGIN CATCH
28
-
29
- IF @@TRANCOUNT > 0
30
- BEGIN
31
- ROLLBACK TRAN;
32
- END;
33
- THROW
34
-
35
- END CATCH