12 lines
524 B
SQL
12 lines
524 B
SQL
-- Permit receipts: the grains (GN) permit number of the receipt, "رقم الارسالية" (legacy form field GNPN, which the legacy never stored).
|
|
-- Run in the primary (NAFITHTCS) schema BEFORE deploying this version of the receipts screen. Safe to re-run; not run by the app.
|
|
DECLARE
|
|
n NUMBER;
|
|
BEGIN
|
|
SELECT COUNT(*) INTO n FROM user_tab_columns WHERE table_name = 'PERMITS_RECEIPTS' AND column_name = 'GNPN';
|
|
IF n = 0 THEN
|
|
EXECUTE IMMEDIATE 'ALTER TABLE PERMITS_RECEIPTS ADD (GNPN NUMBER)';
|
|
END IF;
|
|
END;
|
|
/
|