USE [Elyse_DB] GO /****** Object: Table [people].[duty_functions] Script Date: Wed 21-10-2026 4:50:15 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [people].[duty_functions]( [function_id] [bigint] IDENTITY(1,1) NOT NULL, [mnem] [nvarchar](10) NULL, [name] [nvarchar](50) NOT NULL, [description] [nvarchar](max) NULL, [list_position] [int] NULL, [created] [datetime2](7) NOT NULL, [created_by] [nvarchar](255) NOT NULL, CONSTRAINT [PK_function_list] PRIMARY KEY CLUSTERED ( [function_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] TEXTIMAGE_ON [PRIMARY] GO SET IDENTITY_INSERT [people].[duty_functions] ON INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (12, N'OPERATIONS', N'Operations Director', N'Job title: Operations Director', NULL, CAST(N'2026-10-10T13:52:15.4806938' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (13, N'MANAGING_D', N'Managing Director', N'Job title: Managing Director', NULL, CAST(N'2026-10-10T13:52:15.4927297' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (14, N'PRODUCTION', N'Production Manager', N'Job title: Production Manager', NULL, CAST(N'2026-10-10T13:52:15.5017935' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (15, N'QA_MANAGER', N'QA Manager', N'Job title: QA Manager', NULL, CAST(N'2026-10-10T13:52:15.5113144' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (16, N'MARKETING_', N'Marketing Coordinator', N'Job title: Marketing Coordinator', NULL, CAST(N'2026-10-10T13:52:15.5203482' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (17, N'SALES_MANA', N'Sales Manager', N'Job title: Sales Manager', NULL, CAST(N'2026-10-10T13:52:15.5283772' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (18, N'MAINTENANC', N'Maintenance Manager', N'Job title: Maintenance Manager', NULL, CAST(N'2026-10-10T13:52:15.5378488' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (19, N'WHS_MANAGE', N'WHS Manager', N'Job title: WHS Manager', NULL, CAST(N'2026-10-10T13:52:15.5500522' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (20, N'COMPLIANCE', N'Compliance Officer', N'Job title: Compliance Officer', NULL, CAST(N'2026-10-10T13:52:15.5616078' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (21, N'HR_MANAGER', N'HR Manager', N'Job title: HR Manager', NULL, CAST(N'2026-10-10T13:52:15.5716490' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (22, N'WHS_OFFICE', N'WHS Officer', N'Job title: WHS Officer', NULL, CAST(N'2026-10-10T13:52:15.5811804' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (23, N'FOOD_SAFET', N'Food Safety Coordinator', N'Job title: Food Safety Coordinator', NULL, CAST(N'2026-10-10T13:52:15.5907520' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (24, N'PRODUCTION', N'Production Supervisor', N'Job title: Production Supervisor', NULL, CAST(N'2026-10-10T13:52:15.6013238' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (25, N'QA_TECHNIC', N'QA Technician', N'Job title: QA Technician', NULL, CAST(N'2026-10-10T13:52:15.6103364' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (26, N'HR_COORDIN', N'HR Coordinator', N'Job title: HR Coordinator', NULL, CAST(N'2026-10-10T13:52:15.6197218' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (27, N'PRODUCT_DE', N'Product Development Manager', N'Job title: Product Development Manager', NULL, CAST(N'2026-10-10T13:52:15.6287656' AS DateTime2), N'DEMO\svc_demo') INSERT [people].[duty_functions] ([function_id], [mnem], [name], [description], [list_position], [created], [created_by]) VALUES (28, N'SUPPLY_CHA', N'Supply Chain Manager', N'Job title: Supply Chain Manager', NULL, CAST(N'2026-10-10T13:52:15.6377898' AS DateTime2), N'DEMO\svc_demo') SET IDENTITY_INSERT [people].[duty_functions] OFF GO SET ANSI_PADDING ON GO /****** Object: Index [UN_function_name] Script Date: Wed 21-10-2026 4:50:16 AM ******/ ALTER TABLE [people].[duty_functions] ADD CONSTRAINT [UN_function_name] UNIQUE NONCLUSTERED ( [name] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] GO ALTER TABLE [people].[duty_functions] ADD CONSTRAINT [DF_duty_functions_created] DEFAULT (sysdatetime()) FOR [created] GO ALTER TABLE [people].[duty_functions] ADD CONSTRAINT [DF_duty_functions_created_by] DEFAULT (original_login()) FOR [created_by] GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Name of a function. e.g. ''Production Manager''.' , @level0type=N'SCHEMA',@level0name=N'people', @level1type=N'TABLE',@level1name=N'duty_functions', @level2type=N'COLUMN',@level2name=N'name' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'List position is an integer which allows a list of options in a table to be set in any order. The value is unconstrained and must be set at the application layer.' , @level0type=N'SCHEMA',@level0name=N'people', @level1type=N'TABLE',@level1name=N'duty_functions', @level2type=N'COLUMN',@level2name=N'list_position' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Function name must be unique.' , @level0type=N'SCHEMA',@level0name=N'people', @level1type=N'TABLE',@level1name=N'duty_functions', @level2type=N'CONSTRAINT',@level2name=N'UN_function_name' GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'This list stores duty functions. e.g. organisational positions or functions such as ''Authoriser of manufacturing SOPs''. COPYRIGHT NOTICE This database schema and stored procedures are protected by copyright. Copyright. Silkwood Software Pty. Ltd. 2023' , @level0type=N'SCHEMA',@level0name=N'people', @level1type=N'TABLE',@level1name=N'duty_functions' GO