sozsoft-platform/configs/seeds/host/sql/object/Hr_T_Vehicle.sql

39 lines
1.5 KiB
MySQL
Raw Normal View History

2026-10-02 07:09:23 +00:00
IF OBJECT_ID(N'[dbo].[Hr_T_Vehicle]', 'U') IS NULL
BEGIN
CREATE TABLE [dbo].[Hr_T_Vehicle]
(
[Id] uniqueidentifier NOT NULL DEFAULT NEWID(),
[TenantId] uniqueidentifier NULL,
[BranchId] uniqueidentifier NOT NULL,
[Name] nvarchar(128) NOT NULL,
[Brand] nvarchar(64) NULL,
[Model] nvarchar(64) NULL,
[BodyType] nvarchar(64) NULL,
[UsagePlace] nvarchar(64) NULL,
[RegistrationDate] date NULL,
[PlateNumber] nvarchar(16) NOT NULL,
[IsActive] bit NOT NULL DEFAULT 1,
[Status] nvarchar(16) NOT NULL DEFAULT 'Arrived',
[CurrentKm] int NOT NULL DEFAULT 0,
[InspectionStart] date NULL,
[InspectionEnd] date NULL,
[InsuranceStart] date NULL,
[InsuranceEnd] date NULL,
[EmissionStart] date NULL,
[EmissionEnd] date NULL,
[TachographStart] date NULL,
[TachographEnd] date NULL,
[CreationTime] datetime2 NOT NULL DEFAULT GETUTCDATE(),
[CreatorId] uniqueidentifier NULL,
[LastModificationTime] datetime2 NULL,
[LastModifierId] uniqueidentifier NULL,
[IsDeleted] bit NOT NULL DEFAULT 0,
[DeletionTime] datetime2 NULL,
[DeleterId] uniqueidentifier NULL,
CONSTRAINT [PK_Hr_T_Vehicle] PRIMARY KEY NONCLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO