@bslau/hmm_prisma_schema 1.1.1 → 1.1.2
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 +21 -21
- package/prisma/migrations/20240730025834_init/migration.sql +96 -96
- package/prisma/migrations/20240730053855_init/migration.sql +25 -25
- package/prisma/migrations/20240730060242_init/migration.sql +25 -25
- package/prisma/migrations/20240801042613_init/migration.sql +19 -19
- package/prisma/migrations/20240806010155_introspected_change/migration.sql +26 -26
- package/prisma/migrations/20240806010300_init/migration.sql +38 -38
- package/prisma/migrations/20240806010520_init/migration.sql +26 -26
- package/prisma/migrations/20240806014057_init/migration.sql +28 -28
- package/prisma/migrations/20240806014113_init/migration.sql +30 -30
- package/prisma/migrations/20240806021256_init/migration.sql +48 -48
- package/prisma/migrations/20240806034906_init/migration.sql +26 -26
- package/prisma/migrations/20240807043238_init/migration.sql +38 -38
- package/prisma/migrations/20240807051740_init/migration.sql +19 -19
- package/prisma/migrations/20240808065630_init/migration.sql +20 -20
- package/prisma/migrations/20240902061655_init/migration.sql +43 -43
- package/prisma/migrations/20240903004603_init/migration.sql +44 -44
- package/prisma/migrations/20240903005945_init/migration.sql +35 -35
- package/prisma/migrations/migration_lock.toml +2 -2
- package/prisma/schema.prisma +186 -186
|
@@ -1,48 +1,48 @@
|
|
|
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
|
+
/*
|
|
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 +1,26 @@
|
|
|
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
|
+
/*
|
|
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 +1,38 @@
|
|
|
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
|
+
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 +1,19 @@
|
|
|
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
|
+
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 +1,20 @@
|
|
|
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
|
+
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 +1,43 @@
|
|
|
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
|
+
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 +1,44 @@
|
|
|
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
|
+
/*
|
|
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 +1,35 @@
|
|
|
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
|
|
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
|
|
@@ -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"
|