| 9 | | Still TODO: |
| | 18 | ==== Schema Change |
| | 19 | |
| | 20 | This implementation includes a new table `web_order_request_external` that associates with `web_order_request_id` FK. This will allow us to persist the external request data and track which orders originate from genesys or any other external entity we ultimately enable. This uses a guid pk and I'd appreciate any feedback on the details here: |
| | 21 | |
| | 22 | |
| | 23 | {{{ |
| | 24 | SET ANSI_NULLS ON |
| | 25 | GO |
| | 26 | |
| | 27 | SET QUOTED_IDENTIFIER ON |
| | 28 | GO |
| | 29 | |
| | 30 | CREATE TABLE [dbo].[web_order_request_external]( |
| | 31 | [web_order_request_external_id] [uniqueidentifier] NOT NULL, |
| | 32 | [web_order_request_id] [int] NULL, |
| | 33 | [auth_key] [uniqueidentifier] NOT NULL, |
| | 34 | [schemaless_request_items] [nvarchar](max) NOT NULL, |
| | 35 | [schemaless_requestor_data] [nvarchar](max) NOT NULL, |
| | 36 | [created_date] [datetime2](7) NOT NULL, |
| | 37 | CONSTRAINT [PK_web_order_request_external] PRIMARY KEY NONCLUSTERED |
| | 38 | ( |
| | 39 | [web_order_request_external_id] ASC |
| | 40 | )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] |
| | 41 | ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] |
| | 42 | GO |
| | 43 | |
| | 44 | ALTER TABLE [dbo].[web_order_request_external] ADD CONSTRAINT [DF_web_order_request_external_web_order_request_external_id] DEFAULT (newid()) FOR [web_order_request_external_id] |
| | 45 | GO |
| | 46 | |
| | 47 | ALTER TABLE [dbo].[web_order_request_external] WITH CHECK ADD CONSTRAINT [FK_web_order_request_external_web_order_request_external] FOREIGN KEY([web_order_request_external_id]) |
| | 48 | REFERENCES [dbo].[web_order_request_external] ([web_order_request_external_id]) |
| | 49 | GO |
| | 50 | |
| | 51 | ALTER TABLE [dbo].[web_order_request_external] CHECK CONSTRAINT [FK_web_order_request_external_web_order_request_external] |
| | 52 | GO |
| | 53 | }}} |
| | 54 | |
| | 55 | |
| | 56 | ==== Still TODO: |