VbzCart/docs/queries/qryStk History: Difference between revisions

From Woozle Writes Code
< VbzCart‎ | docs‎ | queries
Jump to navigation Jump to search
imported>Woozle
(+ORDER BY ID)
m (Woozle moved page VbzCart/VbzCart/queries/qryStk History to VbzCart/docs/queries/qryStk History without leaving a redirect: part 3/5)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
==About==
==About==
* '''Purpose''': {{vbzcart/table|stk_history}} plus {{vbzcart/table|stk_history_legacy}} data, if any, with IDs adjusted to prevent duplicates. Lets you see the complete history including legacy stuff, without polluting the main log with non-fixable legacy data.
* '''Status''': No longer functional; was apparently dropped awhile ago (or not migrated to latest server). Legacy data was merged into revised {{l/vc/table|stk_history}}.
* '''Purpose''': {{l/vc/table|stk_history}} plus {{l/vc/table|stk_history_legacy}} data, if any, with IDs adjusted to prevent duplicates. Lets you see the complete history including legacy stuff, without polluting the main log with non-fixable legacy data.
* '''History''':
* '''History''':
** '''2008-12-29''' Created
** '''2008-12-29''' Created
** '''2008-12-30''' Added "ORDER BY ID" so everything will be in sequence (apparently ORDER BY is assumed to refer to the whole UNION, and can't be used within the individual SELECTs that go into the UNION)
** '''2008-12-30''' Added "ORDER BY ID" so everything will be in sequence (apparently ORDER BY is assumed to refer to the whole UNION, and can't be used within the individual SELECTs that go into the UNION)
** '''2016-03-03''' Officially dropped, though it was already absent from the database.
==SQL==
==SQL==
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryStk_History AS
<mysql>CREATE OR REPLACE VIEW qryStk_History AS
SELECT * FROM stk_history
SELECT * FROM stk_history
UNION
UNION
Line 27: Line 29:
   FROM stk_history_legacy
   FROM stk_history_legacy
ORDER BY ID;</mysql>
ORDER BY ID;</mysql>
<section end=sql />

Latest revision as of 01:56, 25 February 2024

About

  • Status: No longer functional; was apparently dropped awhile ago (or not migrated to latest server). Legacy data was merged into revised Template:L/vc/table.
  • Purpose: Template:L/vc/table plus Template:L/vc/table data, if any, with IDs adjusted to prevent duplicates. Lets you see the complete history including legacy stuff, without polluting the main log with non-fixable legacy data.
  • History:
    • 2008-12-29 Created
    • 2008-12-30 Added "ORDER BY ID" so everything will be in sequence (apparently ORDER BY is assumed to refer to the whole UNION, and can't be used within the individual SELECTs that go into the UNION)
    • 2016-03-03 Officially dropped, though it was already absent from the database.

SQL

<mysql>CREATE OR REPLACE VIEW qryStk_History AS SELECT * FROM stk_history UNION SELECT

 CAST(ID-5000 AS SIGNED) AS ID,
 ID_StkBin,
 ID_StkLine,
 CH_OthType,
 ID_OthCont,
 ID_OthLine,
 IDS_OthCont,
 ID_Item,
 QtyBefore,
 QtyAdded,
 QtyAfter,
 QtyBinBefore,
 QtyBinAfter,
 `When`,
 What,
 Notes
 FROM stk_history_legacy

ORDER BY ID;</mysql>