From afd2d1f0990bbd610d2568c2bd42310066718316 Mon Sep 17 00:00:00 2001 From: Robert Anderson <randerson@lbsd.net> Date: Fri, 6 Mar 2009 07:45:40 +0000 Subject: [PATCH] Fixed up accounting schema --- database/core.tsql | 53 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/database/core.tsql b/database/core.tsql index 42c3919f..27352e5f 100644 --- a/database/core.tsql +++ b/database/core.tsql @@ -1,6 +1,5 @@ @PRELOAD@ - /* Users */ CREATE TABLE @PREFIX@users ( ID @SERIAL_TYPE@, @@ -78,6 +77,58 @@ CREATE TABLE @PREFIX@users_to_groups ( CREATE INDEX @PREFIX@users_to_groups_idx1 ON @PREFIX@users_to_groups (UserID,GroupID); +/* Accounting */ +CREATE TABLE @PREFIX@accounting ( + ID @SERIAL_TYPE@, + + Username VARCHAR(255) NOT NULL, + + ServiceType INT UNSIGNED NOT NULL, + + FramedProtocol INT UNSIGNED NOT NULL, + + NASPort VARCHAR(255) NOT NULL, + + NASPortType INT UNSIGNED NOT NULL, + + CallingStationID VARCHAR(255) NOT NULL, + + CalledStationID VARCHAR(255) NOT NULL, + + NASPortID VARCHAR(255) NOT NULL, + + AcctSessionID VARCHAR(255) NOT NULL, + + FramedIPAddress VARCHAR(16) NOT NULL, + + AcctAuthentic INT UNSIGNED NOT NULL, + EventTimestamp INT UNSIGNED NOT NULL, + NASIdentifier VARCHAR(255) NOT NULL, + + NASIPAddress VARCHAR(16) NOT NULL, + + AcctDelayTime INT UNSIGNED NOT NULL, + + AcctSessionTime INT UNSIGNED NOT NULL, + + AcctInputOctets INT UNSIGNED NOT NULL, + + AcctInputGigawords INT UNSIGNED NOT NULL, + + AcctInputPackets INT UNSIGNED NOT NULL, + + AcctOutputOctets INT UNSIGNED NOT NULL, + + AcctOutputGigawords INT UNSIGNED NOT NULL, + + AcctOutputPackets INT UNSIGNED NOT NULL, + + AcctStatusType INT UNSIGNED NOT NULL, + + AcctTerminateCause INT UNSIGNED NOT NULL +) @CREATE_TABLE_SUFFIX@; +CREATE INDEX @PREFIX@accounting_idx1 ON @PREFIX@accounting (Username); +/* FIXME: indexes */ -- GitLab