From: Nick Porter Date: Tue, 19 Nov 2024 08:15:00 +0000 (+0000) Subject: Add missing triggers to Oracle schema X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e3bce0d0461412e34f2d3eba5c2ad3e4a9d6a4c;p=thirdparty%2Ffreeradius-server.git Add missing triggers to Oracle schema --- diff --git a/raddb/mods-config/sql/main/oracle/schema.sql b/raddb/mods-config/sql/main/oracle/schema.sql index bb8ce5cadf3..f6378461e51 100644 --- a/raddb/mods-config/sql/main/oracle/schema.sql +++ b/raddb/mods-config/sql/main/oracle/schema.sql @@ -101,6 +101,17 @@ CREATE TABLE radgroupcheck ( ); CREATE SEQUENCE radgroupcheck_seq START WITH 1 INCREMENT BY 1; +-- Trigger to emulate a serial # on the primary key +CREATE OR REPLACE TRIGGER radgroupcheck_serialnumber + BEFORE INSERT OR UPDATE OF id ON radgroupcheck + FOR EACH ROW + BEGIN + if ( :new.id = 0 or :new.id is null ) then + SELECT radgroupcheck_seq.nextval into :new.id from dual; + end if; + END; +/ + -- -- Table structure for table 'radgroupreply' -- @@ -113,6 +124,17 @@ CREATE TABLE radgroupreply ( ); CREATE SEQUENCE radgroupreply_seq START WITH 1 INCREMENT BY 1; +-- Trigger to emulate a serial # on the primary key +CREATE OR REPLACE TRIGGER radgroupreply_serialnumber + BEFORE INSERT OR UPDATE OF id ON radgroupreply + FOR EACH ROW + BEGIN + if ( :new.id = 0 or :new.id is null ) then + SELECT radgroupreply_seq.nextval into :new.id from dual; + end if; + END; +/ + -- -- Table structure for table 'radreply' -- @@ -242,3 +264,14 @@ CREATE TABLE nas ( ); CREATE SEQUENCE nas_seq START WITH 1 INCREMENT BY 1; +-- Trigger to emulate a serial # on the primary key +CREATE OR REPLACE TRIGGER nas_serialnumber + BEFORE INSERT OR UPDATE OF id ON nas + FOR EACH ROW + BEGIN + if ( :new.id = 0 or :new.id is null ) then + SELECT nas_seq.nextval into :new.id from dual; + end if; + END; +/ +