tinyqc/backup/script_utf8.sql
mahdahar 5cae572916 Refactor application structure, unify entry management, and overhaul UI with DaisyUI
- Reorganized Architecture: Moved Master data management (Controls, Departments, Tests) to a dedicated Master namespace/directory for better modularity.
- Unified Data Entry: Consolidated daily and monthly QC entry views and logic into a single streamlined system.
- UI/UX Modernization:
    - Integrated DaisyUI and Alpine.js for a responsive, themeable, and interactive experience.
    - Replaced legacy layouts with a new DaisyUI-based template.
    - Updated branding with new logo and favicon assets.
    - Cleaned up deprecated JavaScript assets (app.js, charts.js, tables.js).
- Backend Enhancements:
    - Added `ControlEntryModel` and `ResultCommentsController` for improved data handling and auditing.
    - Updated routing to support the new controller structure and consolidated API endpoints.
- Documentation & Assets:
    - Added [docs/PRD.md](cci:7://file:///c:/www/tinyqc/docs/PRD.md:0:0-0:0) and [docs/llms.txt](cci:7://file:///c:/www/tinyqc/docs/llms.txt:0:0-0:0) for project context and requirements.
    - Included database schema scripts and backups in the `backup/` directory.
- Cleanup: Removed legacy TUI progress files and unused commands.
2026-01-19 06:37:37 +07:00

171 lines
4.7 KiB
Transact-SQL

USE [master]
GO
/****** Object: Database [cmod_qc] Script Date: 17/01/2026 18:26:32 ******/
CREATE DATABASE [cmod_qc]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'cmod_qc', FILENAME = N'C:\db\cmod_qc.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'cmod_qc_log', FILENAME = N'C:\db\cmod_qc_log.ldf' , SIZE = 32448KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
WITH CATALOG_COLLATION = DATABASE_DEFAULT, LEDGER = OFF
GO
ALTER DATABASE [cmod_qc] SET COMPATIBILITY_LEVEL = 110
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [cmod_qc].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [cmod_qc] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [cmod_qc] SET ANSI_NULLS OFF
GO
ALTER DATABASE [cmod_qc] SET ANSI_PADDING OFF
GO
ALTER DATABASE [cmod_qc] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [cmod_qc] SET ARITHABORT OFF
GO
ALTER DATABASE [cmod_qc] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [cmod_qc] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [cmod_qc] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [cmod_qc] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [cmod_qc] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [cmod_qc] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [cmod_qc] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [cmod_qc] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [cmod_qc] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [cmod_qc] SET DISABLE_BROKER
GO
ALTER DATABASE [cmod_qc] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [cmod_qc] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [cmod_qc] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [cmod_qc] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [cmod_qc] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [cmod_qc] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [cmod_qc] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [cmod_qc] SET RECOVERY SIMPLE
GO
ALTER DATABASE [cmod_qc] SET MULTI_USER
GO
ALTER DATABASE [cmod_qc] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [cmod_qc] SET DB_CHAINING OFF
GO
ALTER DATABASE [cmod_qc] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )
GO
ALTER DATABASE [cmod_qc] SET TARGET_RECOVERY_TIME = 0 SECONDS
GO
ALTER DATABASE [cmod_qc] SET DELAYED_DURABILITY = DISABLED
GO
ALTER DATABASE [cmod_qc] SET ACCELERATED_DATABASE_RECOVERY = OFF
GO
ALTER DATABASE [cmod_qc] SET QUERY_STORE = OFF
GO
USE [cmod_qc]
GO
/****** Object: Table [dbo].[CONTROL_TEST] Script Date: 17/01/2026 18:26:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CONTROL_TEST](
[id] [int] IDENTITY(1,1) NOT NULL,
[controlid] [int] NULL,
[testid] [int] NULL,
[mean] [float] NULL,
[sd] [float] NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[DAILY_RESULT] Script Date: 17/01/2026 18:26:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DAILY_RESULT](
[id] [int] IDENTITY(1,1) NOT NULL,
[controlid] [int] NULL,
[testid] [int] NULL,
[resdate] [datetime] NULL,
[resvalue] [varchar](50) NULL,
[rescomment] [text] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: Table [dbo].[DICT_CONTROL] Script Date: 17/01/2026 18:26:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DICT_CONTROL](
[id] [int] IDENTITY(1,1) NOT NULL,
[deptid] [int] NULL,
[name] [varchar](50) NULL,
[lot] [varchar](50) NULL,
[producer] [text] NULL,
[expdate] [date] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: Table [dbo].[DICT_DEPT] Script Date: 17/01/2026 18:26:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DICT_DEPT](
[id] [int] IDENTITY(1,1) NOT NULL,
[name] [varchar](50) NULL,
CONSTRAINT [PK_DICT_DEPT] PRIMARY KEY CLUSTERED
(
[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]
GO
/****** Object: Table [dbo].[DICT_TEST] Script Date: 17/01/2026 18:26:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DICT_TEST](
[id] [int] IDENTITY(1,1) NOT NULL,
[deptid] [int] NULL,
[name] [varchar](50) NULL,
[unit] [varchar](50) NULL,
[method] [varchar](50) NULL,
[cva] [varchar](50) NULL,
[ba] [varchar](50) NULL,
[tea] [varchar](50) NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[MONTHLY_COMMENT] Script Date: 17/01/2026 18:26:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MONTHLY_COMMENT](
[id] [int] IDENTITY(1,1) NOT NULL,
[controlid] [int] NOT NULL,
[testid] [int] NOT NULL,
[commonth] [varchar](7) NOT NULL,
[comtext] [text] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
USE [master]
GO
ALTER DATABASE [cmod_qc] SET READ_WRITE
GO