USE [master]
GO
/****** Object:  Database [ecs_shopee_alarm]    Script Date: 2024/2/17 下午 03:26:24 ******/
CREATE DATABASE [ecs_shopee_alarm]
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'ecs_shopee_alarm', FILENAME = N'E:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\ecs_shopee_alarm.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB )
 LOG ON 
( NAME = N'ecs_shopee_alarm_log', FILENAME = N'E:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\ecs_shopee_alarm_log.ldf' , SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB )
GO
ALTER DATABASE [ecs_shopee_alarm] SET COMPATIBILITY_LEVEL = 130
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [ecs_shopee_alarm].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [ecs_shopee_alarm] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET ARITHABORT OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [ecs_shopee_alarm] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [ecs_shopee_alarm] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET  DISABLE_BROKER 
GO
ALTER DATABASE [ecs_shopee_alarm] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET TRUSTWORTHY OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [ecs_shopee_alarm] SET READ_COMMITTED_SNAPSHOT OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET HONOR_BROKER_PRIORITY OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET RECOVERY FULL 
GO
ALTER DATABASE [ecs_shopee_alarm] SET  MULTI_USER 
GO
ALTER DATABASE [ecs_shopee_alarm] SET PAGE_VERIFY CHECKSUM  
GO
ALTER DATABASE [ecs_shopee_alarm] SET DB_CHAINING OFF 
GO
ALTER DATABASE [ecs_shopee_alarm] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
GO
ALTER DATABASE [ecs_shopee_alarm] SET TARGET_RECOVERY_TIME = 60 SECONDS 
GO
ALTER DATABASE [ecs_shopee_alarm] SET DELAYED_DURABILITY = DISABLED 
GO
ALTER DATABASE [ecs_shopee_alarm] SET QUERY_STORE = OFF
GO
USE [ecs_shopee_alarm]
GO
ALTER DATABASE SCOPED CONFIGURATION SET LEGACY_CARDINALITY_ESTIMATION = OFF;
GO
ALTER DATABASE SCOPED CONFIGURATION SET MAXDOP = 0;
GO
ALTER DATABASE SCOPED CONFIGURATION SET PARAMETER_SNIFFING = ON;
GO
ALTER DATABASE SCOPED CONFIGURATION SET QUERY_OPTIMIZER_HOTFIXES = OFF;
GO
USE [ecs_shopee_alarm]
GO
/****** Object:  Table [dbo].[cashier_alarm_report]    Script Date: 2024/2/17 下午 03:26:24 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cashier_alarm_report](
	[ar_sno] [int] IDENTITY(1,1) NOT NULL,
	[cashier_id] [varchar](10) NOT NULL,
	[store_id] [int] NOT NULL,
	[create_at] [datetime] NOT NULL,
	[alarm_type] [varchar](50) NOT NULL,
	[alarm_code] [int] NOT NULL,
	[alarm_message] [nvarchar](255) NOT NULL,
 CONSTRAINT [PK_cashier_alarm_report] PRIMARY KEY CLUSTERED 
(
	[ar_sno] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[store_alarm_report]    Script Date: 2024/2/17 下午 03:26:24 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[store_alarm_report](
	[store_alarm_id] [int] IDENTITY(1,1) NOT NULL,
	[cashier_id] [varchar](10) NOT NULL,
	[store_id] [int] NOT NULL,
	[create_at] [datetime] NOT NULL,
	[alarm_code] [int] NOT NULL,
	[alarm_name] [nvarchar](255) NOT NULL,
	[alarm_note] [nvarchar](255) NOT NULL,
 CONSTRAINT [PK_store_alarm_report] PRIMARY KEY CLUSTERED 
(
	[store_alarm_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[cashier_alarm_report] ON 

INSERT [dbo].[cashier_alarm_report] ([ar_sno], [cashier_id], [store_id], [create_at], [alarm_type], [alarm_code], [alarm_message]) VALUES (2, N'ESC_S001', 5134, CAST(N'2024-02-16T13:35:49.000' AS DateTime), N'Coin', 12, N'error test msg by Coin')
INSERT [dbo].[cashier_alarm_report] ([ar_sno], [cashier_id], [store_id], [create_at], [alarm_type], [alarm_code], [alarm_message]) VALUES (3, N'ESC_S001', 5134, CAST(N'2024-02-16T14:29:52.000' AS DateTime), N'Coin', 12, N'error test msg by Coin')
INSERT [dbo].[cashier_alarm_report] ([ar_sno], [cashier_id], [store_id], [create_at], [alarm_type], [alarm_code], [alarm_message]) VALUES (4, N'ESC_S001', 5134, CAST(N'2024-02-16T14:30:13.000' AS DateTime), N'Coin', 12, N'error test msg by Coin')
INSERT [dbo].[cashier_alarm_report] ([ar_sno], [cashier_id], [store_id], [create_at], [alarm_type], [alarm_code], [alarm_message]) VALUES (5, N'ESC_S001', 5134, CAST(N'2024-02-16T14:33:39.000' AS DateTime), N'Coin', 12, N'error test msg by Coin')
INSERT [dbo].[cashier_alarm_report] ([ar_sno], [cashier_id], [store_id], [create_at], [alarm_type], [alarm_code], [alarm_message]) VALUES (6, N'ESC_S001', 5134, CAST(N'2024-02-16T14:51:20.000' AS DateTime), N'Coin', 12, N'error test msg by Coin')
INSERT [dbo].[cashier_alarm_report] ([ar_sno], [cashier_id], [store_id], [create_at], [alarm_type], [alarm_code], [alarm_message]) VALUES (7, N'ESC_S001', 5134, CAST(N'2024-02-16T15:16:11.000' AS DateTime), N'Coin', 12, N'error test msg by Coin')
INSERT [dbo].[cashier_alarm_report] ([ar_sno], [cashier_id], [store_id], [create_at], [alarm_type], [alarm_code], [alarm_message]) VALUES (8, N'ESC_S001', 5134, CAST(N'2024-02-16T15:16:41.000' AS DateTime), N'Coin', 12, N'error test msg by Coin')
INSERT [dbo].[cashier_alarm_report] ([ar_sno], [cashier_id], [store_id], [create_at], [alarm_type], [alarm_code], [alarm_message]) VALUES (9, N'ESC_S001', 5134, CAST(N'2024-02-16T15:17:42.000' AS DateTime), N'Coin', 12, N'error test msg by Coin')
INSERT [dbo].[cashier_alarm_report] ([ar_sno], [cashier_id], [store_id], [create_at], [alarm_type], [alarm_code], [alarm_message]) VALUES (10, N'ESC_S001', 5134, CAST(N'2024-02-16T15:35:43.000' AS DateTime), N'Coin', 12, N'error test msg by Coin')
INSERT [dbo].[cashier_alarm_report] ([ar_sno], [cashier_id], [store_id], [create_at], [alarm_type], [alarm_code], [alarm_message]) VALUES (11, N'ESC_S001', 5134, CAST(N'2024-02-16T15:36:57.000' AS DateTime), N'Coin', 12, N'error test msg by Coin')
INSERT [dbo].[cashier_alarm_report] ([ar_sno], [cashier_id], [store_id], [create_at], [alarm_type], [alarm_code], [alarm_message]) VALUES (12, N'ESC_S001', 5134, CAST(N'2024-02-16T15:37:05.000' AS DateTime), N'Coin', 12, N'error test msg by Coin')
INSERT [dbo].[cashier_alarm_report] ([ar_sno], [cashier_id], [store_id], [create_at], [alarm_type], [alarm_code], [alarm_message]) VALUES (13, N'ESC_S001', 5134, CAST(N'2024-02-16T15:37:06.000' AS DateTime), N'Coin', 12, N'error test msg by Coin')
SET IDENTITY_INSERT [dbo].[cashier_alarm_report] OFF
GO
SET IDENTITY_INSERT [dbo].[store_alarm_report] ON 

INSERT [dbo].[store_alarm_report] ([store_alarm_id], [cashier_id], [store_id], [create_at], [alarm_code], [alarm_name], [alarm_note]) VALUES (3, N'ESC_S001', 5134, CAST(N'2024-02-16T14:53:55.000' AS DateTime), 1, N'特定面額鈔過水位', N'特定面額鈔過水位')
SET IDENTITY_INSERT [dbo].[store_alarm_report] OFF
GO
ALTER TABLE [dbo].[cashier_alarm_report] ADD  DEFAULT (getdate()) FOR [create_at]
GO
ALTER TABLE [dbo].[store_alarm_report] ADD  DEFAULT (getdate()) FOR [create_at]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自動遞增序號' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'cashier_alarm_report', @level2type=N'COLUMN',@level2name=N'ar_sno'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'對應cashier表主鍵' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'cashier_alarm_report', @level2type=N'COLUMN',@level2name=N'cashier_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'對應store表主鍵' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'cashier_alarm_report', @level2type=N'COLUMN',@level2name=N'store_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'警報建立時間' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'cashier_alarm_report', @level2type=N'COLUMN',@level2name=N'create_at'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'警報類型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'cashier_alarm_report', @level2type=N'COLUMN',@level2name=N'alarm_type'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'警報code' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'cashier_alarm_report', @level2type=N'COLUMN',@level2name=N'alarm_code'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'警報massage' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'cashier_alarm_report', @level2type=N'COLUMN',@level2name=N'alarm_message'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自動遞增序號' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'store_alarm_report', @level2type=N'COLUMN',@level2name=N'store_alarm_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'對應cashier表主鍵' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'store_alarm_report', @level2type=N'COLUMN',@level2name=N'cashier_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'對應store表主鍵' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'store_alarm_report', @level2type=N'COLUMN',@level2name=N'store_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'警報建立時間' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'store_alarm_report', @level2type=N'COLUMN',@level2name=N'create_at'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'異常code' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'store_alarm_report', @level2type=N'COLUMN',@level2name=N'alarm_code'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'異常名稱' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'store_alarm_report', @level2type=N'COLUMN',@level2name=N'alarm_name'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'備註' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'store_alarm_report', @level2type=N'COLUMN',@level2name=N'alarm_note'
GO
USE [master]
GO
ALTER DATABASE [ecs_shopee_alarm] SET  READ_WRITE 
GO
