"Fossies" - the Fresh Open Source Software Archive

Member "freeradius-server-3.0.23/raddb/mods-config/sql/main/mssql/schema.sql" (10 Jun 2021, 9366 Bytes) of package /linux/misc/freeradius-server-3.0.23.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PL/SQL source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "schema.sql": 3.0.22_vs_3.0.23.

    1 -- $Id: 6338c1d1744078cabac25a9768725d4e71863a60 $d$
    2 --
    3 -- schela.sql   rlm_sql - FreeRADIUS SQL Module
    4 --
    5 -- Database schema for MSSQL rlm_sql module
    6 --
    7 -- To load:
    8 --  isql -S db_ip_addr -d db_name -U db_login -P db_passwd -i db_mssql.sql
    9 --
   10 -- Based on: db_mysql.sql (Mike Machado <mike@innercite.com>)
   11 --
   12 --                  Dmitri Ageev <d_ageev@ortcc.ru>
   13 --
   14 
   15 
   16 --
   17 -- Table structure for table 'radacct'
   18 --
   19 
   20 CREATE TABLE [radacct] (
   21     [RadAcctId] [numeric](21, 0) IDENTITY (1, 1) NOT NULL,
   22     [AcctSessionId] [varchar] (64) NOT NULL,
   23     [AcctUniqueId] [varchar] (32) NOT NULL,
   24     [UserName] [varchar] (64) NOT NULL,
   25     [GroupName] [varchar] (64) NOT NULL,
   26     [Realm] [varchar] (64) NOT NULL,
   27     [NASIPAddress] [varchar] (15) NOT NULL,
   28     [NASPortId] [varchar] (32) NULL,
   29     [NASPortType] [varchar] (32) NULL,
   30     [AcctStartTime] [datetime] NOT NULL,
   31     [AcctStopTime] [datetime] NOT NULL,
   32     [AcctSessionTime] [bigint] NULL,
   33     [AcctAuthentic] [varchar] (32) NULL,
   34     [ConnectInfo_start] [varchar] (128) NULL,
   35     [ConnectInfo_stop] [varchar] (128) NULL,
   36     [AcctInputOctets] [bigint] NULL,
   37     [AcctOutputOctets] [bigint] NULL,
   38     [CalledStationId] [varchar] (50) NOT NULL,
   39     [CallingStationId] [varchar] (50) NOT NULL,
   40     [AcctTerminateCause] [varchar] (32) NOT NULL,
   41     [ServiceType] [varchar] (32) NULL,
   42     [FramedProtocol] [varchar] (32) NULL,
   43     [FramedIPAddress] [varchar] (15) NOT NULL,
   44     [FramedIPv6Address] [varchar] (45) NOT NULL,
   45     [FramedIPv6Prefix] [varchar] (45) NOT NULL,
   46     [FramedInterfaceId] [varchar] (44) NOT NULL,
   47     [DelegatedIPv6Prefix] [varchar] (45) NOT NULL,
   48     [AcctStartDelay] [int] NULL,
   49     [AcctStopDelay] [int] NULL,
   50     [Class] [varchar] (64) NULL
   51 ) ON [PRIMARY]
   52 GO
   53 
   54 ALTER TABLE [radacct] WITH NOCHECK ADD
   55     CONSTRAINT [DF_radacct_GroupName] DEFAULT ('') FOR [GroupName],
   56     CONSTRAINT [DF_radacct_AcctSessionId] DEFAULT ('') FOR [AcctSessionId],
   57     CONSTRAINT [DF_radacct_AcctUniqueId] DEFAULT ('') FOR [AcctUniqueId],
   58     CONSTRAINT [DF_radacct_UserName] DEFAULT ('') FOR [UserName],
   59     CONSTRAINT [DF_radacct_Realm] DEFAULT ('') FOR [Realm],
   60     CONSTRAINT [DF_radacct_NASIPAddress] DEFAULT ('') FOR [NASIPAddress],
   61     CONSTRAINT [DF_radacct_NASPortId] DEFAULT (null) FOR [NASPortId],
   62     CONSTRAINT [DF_radacct_NASPortType] DEFAULT (null) FOR [NASPortType],
   63     CONSTRAINT [DF_radacct_AcctStartTime] DEFAULT ('1900-01-01 00:00:00') FOR [AcctStartTime],
   64     CONSTRAINT [DF_radacct_AcctStopTime] DEFAULT ('1900-01-01 00:00:00') FOR [AcctStopTime],
   65     CONSTRAINT [DF_radacct_AcctSessionTime] DEFAULT (null) FOR [AcctSessionTime],
   66     CONSTRAINT [DF_radacct_AcctAuthentic] DEFAULT (null) FOR [AcctAuthentic],
   67     CONSTRAINT [DF_radacct_ConnectInfo_start] DEFAULT (null) FOR [ConnectInfo_start],
   68     CONSTRAINT [DF_radacct_ConnectInfo_stop] DEFAULT (null) FOR [ConnectInfo_stop],
   69     CONSTRAINT [DF_radacct_AcctInputOctets] DEFAULT (null) FOR [AcctInputOctets],
   70     CONSTRAINT [DF_radacct_AcctOutputOctets] DEFAULT (null) FOR [AcctOutputOctets],
   71     CONSTRAINT [DF_radacct_CalledStationId] DEFAULT ('') FOR [CalledStationId],
   72     CONSTRAINT [DF_radacct_CallingStationId] DEFAULT ('') FOR [CallingStationId],
   73     CONSTRAINT [DF_radacct_AcctTerminateCause] DEFAULT ('') FOR [AcctTerminateCause],
   74     CONSTRAINT [DF_radacct_ServiceType] DEFAULT (null) FOR [ServiceType],
   75     CONSTRAINT [DF_radacct_FramedProtocol] DEFAULT (null) FOR [FramedProtocol],
   76     CONSTRAINT [DF_radacct_FramedIPAddress] DEFAULT ('') FOR [FramedIPAddress],
   77     CONSTRAINT [DF_radacct_FramedIPv6Address] DEFAULT ('') FOR [FramedIPv6Address],
   78     CONSTRAINT [DF_radacct_FramedIPv6Prefix] DEFAULT ('') FOR [FramedIPv6Prefix],
   79     CONSTRAINT [DF_radacct_FramedInterfaceId] DEFAULT ('') FOR [FramedInterfaceId],
   80     CONSTRAINT [DF_radacct_DelegatedIPv6Prefix] DEFAULT ('') FOR [DelegatedIPv6Prefix],
   81     CONSTRAINT [DF_radacct_AcctStartDelay] DEFAULT (null) FOR [AcctStartDelay],
   82     CONSTRAINT [DF_radacct_AcctStopDelay] DEFAULT (null) FOR [AcctStopDelay],
   83     CONSTRAINT [DF_radacct_Class] DEFAULT (null) FOR [Class],
   84     CONSTRAINT [PK_radacct] PRIMARY KEY NONCLUSTERED
   85     (
   86         [RadAcctId]
   87     ) ON [PRIMARY]
   88 GO
   89 
   90 CREATE INDEX [UserName] ON [radacct]([UserName]) ON [PRIMARY]
   91 GO
   92 
   93 CREATE INDEX [FramedIPAddress] ON [radacct]([FramedIPAddress]) ON [PRIMARY]
   94 GO
   95 
   96 CREATE INDEX [FramedIPv6Address] ON [radacct]([FramedIPv6Address]) ON [PRIMARY]
   97 GO
   98 
   99 CREATE INDEX [FramedIPv6Prefix] ON [radacct]([FramedIPv6Prefix]) ON [PRIMARY]
  100 GO
  101 
  102 CREATE INDEX [FramedInterfaceId] ON [radacct]([FramedInterfaceId]) ON [PRIMARY]
  103 GO
  104 
  105 CREATE INDEX [DelegatedIPv6Prefix] ON [radacct]([DelegatedIPv6Prefix]) ON [PRIMARY]
  106 GO
  107 
  108 CREATE INDEX [AcctSessionId] ON [radacct]([AcctSessionId]) ON [PRIMARY]
  109 GO
  110 
  111 CREATE UNIQUE INDEX [AcctUniqueId] ON [radacct]([AcctUniqueId]) ON [PRIMARY]
  112 GO
  113 
  114 CREATE INDEX [AcctStartTime] ON [radacct]([AcctStartTime]) ON [PRIMARY]
  115 GO
  116 
  117 CREATE INDEX [AcctStopTime] ON [radacct]([AcctStopTime]) ON [PRIMARY]
  118 GO
  119 
  120 CREATE INDEX [NASIPAddress] ON [radacct]([NASIPAddress]) ON [PRIMARY]
  121 GO
  122 
  123 CREATE INDEX [Class] ON [radacct]([Class]) ON [PRIMARY]
  124 GO
  125 
  126 /* For use by onoff */
  127 CREATE INDEX [RadacctBulkClose] ON [radacct]([NASIPAddress],[AcctStartTime]) WHERE [AcctStopTime] IS NULL ON [PRIMARY]
  128 GO
  129 
  130 
  131 --
  132 -- Table structure for table 'radacct'
  133 --
  134 
  135 CREATE TABLE [radcheck] (
  136     [id] [int] IDENTITY (1, 1) NOT NULL ,
  137     [UserName] [varchar] (64) NOT NULL ,
  138     [Attribute] [varchar] (32) NOT NULL ,
  139     [Value] [varchar] (253) NOT NULL ,
  140     [op] [char] (2) NULL
  141 ) ON [PRIMARY]
  142 GO
  143 
  144 ALTER TABLE [radcheck] WITH NOCHECK ADD
  145     CONSTRAINT [DF_radcheck_UserName] DEFAULT ('') FOR [UserName],
  146     CONSTRAINT [DF_radcheck_Attribute] DEFAULT ('') FOR [Attribute],
  147     CONSTRAINT [DF_radcheck_Value] DEFAULT ('') FOR [Value],
  148     CONSTRAINT [DF_radcheck_op] DEFAULT (null) FOR [op],
  149     CONSTRAINT [PK_radcheck] PRIMARY KEY NONCLUSTERED
  150     (
  151         [id]
  152     ) ON [PRIMARY]
  153 GO
  154 
  155 CREATE INDEX [UserName] ON [radcheck]([UserName]) ON [PRIMARY]
  156 GO
  157 
  158 
  159 --
  160 -- Table structure for table 'radacct'
  161 --
  162 
  163 CREATE TABLE [radgroupcheck] (
  164     [id] [int] IDENTITY (1, 1) NOT NULL ,
  165     [GroupName] [varchar] (64) NOT NULL ,
  166     [Attribute] [varchar] (32) NOT NULL ,
  167     [Value] [varchar] (253) NOT NULL ,
  168     [op] [char] (2) NULL
  169 ) ON [PRIMARY]
  170 GO
  171 
  172 ALTER TABLE [radgroupcheck] WITH NOCHECK ADD
  173     CONSTRAINT [DF_radgroupcheck_GroupName] DEFAULT ('') FOR [GroupName],
  174     CONSTRAINT [DF_radgroupcheck_Attribute] DEFAULT ('') FOR [Attribute],
  175     CONSTRAINT [DF_radgroupcheck_Value] DEFAULT ('') FOR [Value],
  176     CONSTRAINT [DF_radgroupcheck_op] DEFAULT (null) FOR [op],
  177     CONSTRAINT [PK_radgroupcheck] PRIMARY KEY NONCLUSTERED
  178     (
  179         [id]
  180     ) ON [PRIMARY]
  181 GO
  182 
  183 CREATE INDEX [GroupName] ON [radgroupcheck]([GroupName]) ON [PRIMARY]
  184 GO
  185 
  186 
  187 --
  188 -- Table structure for table 'radacct'
  189 --
  190 
  191 CREATE TABLE [radgroupreply] (
  192     [id] [int] IDENTITY (1, 1) NOT NULL ,
  193     [GroupName] [varchar] (64) NOT NULL ,
  194     [Attribute] [varchar] (32) NOT NULL ,
  195     [Value] [varchar] (253) NOT NULL ,
  196     [op] [char] (2) NULL ,
  197     [prio] [int] NOT NULL
  198 ) ON [PRIMARY]
  199 GO
  200 
  201 ALTER TABLE [radgroupreply] WITH NOCHECK ADD
  202     CONSTRAINT [DF_radgroupreply_GroupName] DEFAULT ('') FOR [GroupName],
  203     CONSTRAINT [DF_radgroupreply_Attribute] DEFAULT ('') FOR [Attribute],
  204     CONSTRAINT [DF_radgroupreply_Value] DEFAULT ('') FOR [Value],
  205     CONSTRAINT [DF_radgroupreply_op] DEFAULT (null) FOR [op],
  206     CONSTRAINT [DF_radgroupreply_prio] DEFAULT (0) FOR [prio],
  207     CONSTRAINT [PK_radgroupreply] PRIMARY KEY NONCLUSTERED
  208     (
  209         [id]
  210     ) ON [PRIMARY]
  211 GO
  212 
  213 CREATE INDEX [GroupName] ON [radgroupreply]([GroupName]) ON [PRIMARY]
  214 GO
  215 
  216 
  217 --
  218 -- Table structure for table 'radacct'
  219 --
  220 
  221 CREATE TABLE [radreply] (
  222     [id] [int] IDENTITY (1, 1) NOT NULL ,
  223     [UserName] [varchar] (64) NOT NULL ,
  224     [Attribute] [varchar] (32) NOT NULL ,
  225     [Value] [varchar] (253) NOT NULL ,
  226     [op] [char] (2) NULL
  227 ) ON [PRIMARY]
  228 GO
  229 
  230 ALTER TABLE [radreply] WITH NOCHECK ADD
  231     CONSTRAINT [DF_radreply_UserName] DEFAULT ('') FOR [UserName],
  232     CONSTRAINT [DF_radreply_Attribute] DEFAULT ('') FOR [Attribute],
  233     CONSTRAINT [DF_radreply_Value] DEFAULT ('') FOR [Value],
  234     CONSTRAINT [DF_radreply_op] DEFAULT (null) FOR [op],
  235     CONSTRAINT [PK_radreply] PRIMARY KEY NONCLUSTERED
  236     (
  237         [id]
  238     ) ON [PRIMARY]
  239 GO
  240 
  241 CREATE INDEX [UserName] ON [radreply]([UserName]) ON [PRIMARY]
  242 GO
  243 
  244 
  245 --
  246 -- Table structure for table 'radacct'
  247 --
  248 
  249 CREATE TABLE [radusergroup] (
  250     [id] [int] IDENTITY (1, 1) NOT NULL ,
  251     [UserName] [varchar] (64) NOT NULL ,
  252     [GroupName] [varchar] (64) NULL ,
  253     [Priority] [int] NULL
  254 ) ON [PRIMARY]
  255 GO
  256 
  257 ALTER TABLE [radusergroup] WITH NOCHECK ADD
  258     CONSTRAINT [DF_radusergroup_UserName] DEFAULT ('') FOR [UserName],
  259     CONSTRAINT [DF_radusergroup_GroupName] DEFAULT ('') FOR [GroupName],
  260     CONSTRAINT [PK_radusergroup] PRIMARY KEY NONCLUSTERED
  261     (
  262         [id]
  263     ) ON [PRIMARY]
  264 GO
  265 
  266 CREATE INDEX [UserName] ON [radusergroup]([UserName]) ON [PRIMARY]
  267 GO
  268 
  269 
  270 --
  271 -- Table structure for table 'radacct'
  272 --
  273 
  274 CREATE TABLE [radpostauth] (
  275     [id] [int] IDENTITY (1, 1) NOT NULL ,
  276     [userName] [varchar] (64) NOT NULL ,
  277     [pass] [varchar] (64) NOT NULL ,
  278     [reply] [varchar] (32) NOT NULL ,
  279     [authdate] [datetime] NOT NULL,
  280     [Class] [varchar] (64) NULL
  281 )
  282 GO
  283 
  284 CREATE INDEX [userName] ON [radpostauth]([userName]) ON [PRIMARY]
  285 GO
  286 
  287 CREATE INDEX [Class] ON [radpostauth]([Class]) ON [PRIMARY]
  288 GO
  289 
  290 ALTER TABLE [radpostauth] WITH NOCHECK ADD
  291     CONSTRAINT [DF_radpostauth_userName] DEFAULT ('') FOR [userName],
  292     CONSTRAINT [DF_radpostauth_pass] DEFAULT ('') FOR [pass],
  293     CONSTRAINT [DF_radpostauth_reply] DEFAULT ('') FOR [reply],
  294     CONSTRAINT [DF_radpostauth_authdate] DEFAULT (getdate()) FOR [authdate],
  295     CONSTRAINT [PK_radpostauth] PRIMARY KEY NONCLUSTERED
  296     (
  297         [id]
  298     ) ON [PRIMARY]
  299 GO