Files
DocprintService/sqlscript/create-a-datalog-table.sql
2026-09-02 10:23:24 +08:00

27 lines
1.0 KiB
Transact-SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- ============================================================
-- 数据变更日志表(A_DataLog)
-- 对应实体:YhCore.Entity.A_DataLog(旧 EF6 EDMX 生成 POCO,主键约定 SerID)
-- 用途:数据变更审计预留表(当前无业务代码使用,仅 DbContext 注册)
-- 数据库:SQL Server(EduCloudDocPrint)
-- 风格:对齐同库 Java 遗留表(SerID 主键自增、varchar 字符串、可空)
-- ============================================================
IF NOT EXISTS (SELECT 1 FROM sys.tables WHERE name = 'A_DataLog')
BEGIN
CREATE TABLE [dbo].[A_DataLog] (
[SerID] INT IDENTITY(1,1) NOT NULL CONSTRAINT [PK_A_DataLog] PRIMARY KEY,
[SchSerID] VARCHAR(200) NULL,
[ModuleName] VARCHAR(50) NULL,
[TableName] VARCHAR(50) NULL,
[OldSerID] INT NULL,
[NowSerID] INT NULL,
[RId] INT NULL
);
PRINT 'A_DataLog table created.';
END
ELSE
BEGIN
PRINT 'A_DataLog table already exists, skip.';
END