| Line 17... |
Line 17... |
| 17 |
--
|
17 |
--
|
| 18 |
-- REVERSIBLE: every deleted row is copied to a _bak_ table first. To restore, INSERT ... SELECT back.
|
18 |
-- REVERSIBLE: every deleted row is copied to a _bak_ table first. To restore, INSERT ... SELECT back.
|
| 19 |
-- Membership is frozen into the backups at run time, so a supplier whose internal flag changes later
|
19 |
-- Membership is frozen into the backups at run time, so a supplier whose internal flag changes later
|
| 20 |
-- cannot silently widen or narrow what was removed.
|
20 |
-- cannot silently widen or narrow what was removed.
|
| 21 |
|
21 |
|
| - |
|
22 |
-- Multi-table DELETE (the "DELETE alias FROM" form) needs a default schema even when every table is
|
| - |
|
23 |
-- fully qualified, so select one up front rather than relying on how the client was invoked.
|
| - |
|
24 |
USE inventory;
|
| - |
|
25 |
|
| 22 |
CREATE TABLE inventory._bak_vcp_internal_20260912 AS
|
26 |
CREATE TABLE inventory._bak_vcp_internal_20260912 AS
|
| 23 |
SELECT p.* FROM inventory.vendor_catalog_pricing p
|
27 |
SELECT p.* FROM inventory.vendor_catalog_pricing p
|
| 24 |
JOIN warehouse.supplier s ON s.id = p.vendor_id AND s.internal = 1;
|
28 |
JOIN warehouse.supplier s ON s.id = p.vendor_id AND s.internal = 1;
|
| 25 |
|
29 |
|
| 26 |
CREATE TABLE inventory._bak_vcpl_internal_20260912 AS
|
30 |
CREATE TABLE inventory._bak_vcpl_internal_20260912 AS
|