Skip to content
Permalink
Browse files

CREATE TABLE IF NOT EXISTS. Fixes #2313

  • Loading branch information
alandekok committed Aug 3, 2019
1 parent aaae660 commit 8207754b7c6e8f694ad5157271dcf13bb7b358dc
@@ -14,7 +14,7 @@
# Table structure for table 'radacct'
#

CREATE TABLE radacct (
CREATE TABLE IF NOT EXISTS radacct (
radacctid bigint(21) NOT NULL auto_increment,
acctsessionid varchar(64) NOT NULL default '',
acctuniqueid varchar(32) NOT NULL default '',
@@ -63,7 +63,7 @@ CREATE TABLE radacct (
# Table structure for table 'radcheck'
#

CREATE TABLE radcheck (
CREATE TABLE IF NOT EXISTS radcheck (
id int(11) unsigned NOT NULL auto_increment,
username varchar(64) NOT NULL default '',
attribute varchar(64) NOT NULL default '',
@@ -77,7 +77,7 @@ CREATE TABLE radcheck (
# Table structure for table 'radgroupcheck'
#

CREATE TABLE radgroupcheck (
CREATE TABLE IF NOT EXISTS radgroupcheck (
id int(11) unsigned NOT NULL auto_increment,
groupname varchar(64) NOT NULL default '',
attribute varchar(64) NOT NULL default '',
@@ -91,7 +91,7 @@ CREATE TABLE radgroupcheck (
# Table structure for table 'radgroupreply'
#

CREATE TABLE radgroupreply (
CREATE TABLE IF NOT EXISTS radgroupreply (
id int(11) unsigned NOT NULL auto_increment,
groupname varchar(64) NOT NULL default '',
attribute varchar(64) NOT NULL default '',
@@ -105,7 +105,7 @@ CREATE TABLE radgroupreply (
# Table structure for table 'radreply'
#

CREATE TABLE radreply (
CREATE TABLE IF NOT EXISTS radreply (
id int(11) unsigned NOT NULL auto_increment,
username varchar(64) NOT NULL default '',
attribute varchar(64) NOT NULL default '',
@@ -120,7 +120,7 @@ CREATE TABLE radreply (
# Table structure for table 'radusergroup'
#

CREATE TABLE radusergroup (
CREATE TABLE IF NOT EXISTS radusergroup (
id int(11) unsigned NOT NULL auto_increment,
username varchar(64) NOT NULL default '',
groupname varchar(64) NOT NULL default '',
@@ -132,7 +132,7 @@ CREATE TABLE radusergroup (
#
# Table structure for table 'radpostauth'
#
CREATE TABLE radpostauth (
CREATE TABLE IF NOT EXISTS radpostauth (
id int(11) NOT NULL auto_increment,
username varchar(64) NOT NULL default '',
pass varchar(64) NOT NULL default '',
@@ -145,7 +145,7 @@ CREATE TABLE radpostauth (
#
# Table structure for table 'nas'
#
CREATE TABLE nas (
CREATE TABLE IF NOT EXISTS nas (
id int(10) NOT NULL auto_increment,
nasname varchar(128) NOT NULL,
shortname varchar(32),
@@ -13,7 +13,7 @@
* Note: Column type bigserial does not exist prior to Postgres 7.2
* If you run an older version you need to change this to serial
*/
CREATE TABLE radacct (
CREATE TABLE IF NOT EXISTS radacct (
RadAcctId bigserial PRIMARY KEY,
AcctSessionId text NOT NULL,
AcctUniqueId text NOT NULL UNIQUE,
@@ -88,7 +88,7 @@ CREATE INDEX radacct_start_user_idx ON radacct (AcctStartTime, UserName);
/*
* Table structure for table 'radcheck'
*/
CREATE TABLE radcheck (
CREATE TABLE IF NOT EXISTSradcheck (
id serial PRIMARY KEY,
UserName text NOT NULL DEFAULT '',
Attribute text NOT NULL DEFAULT '',
@@ -104,7 +104,7 @@ create index radcheck_UserName on radcheck (UserName,Attribute);
/*
* Table structure for table 'radgroupcheck'
*/
CREATE TABLE radgroupcheck (
CREATE TABLE IF NOT EXISTSradgroupcheck (
id serial PRIMARY KEY,
GroupName text NOT NULL DEFAULT '',
Attribute text NOT NULL DEFAULT '',
@@ -116,7 +116,7 @@ create index radgroupcheck_GroupName on radgroupcheck (GroupName,Attribute);
/*
* Table structure for table 'radgroupreply'
*/
CREATE TABLE radgroupreply (
CREATE TABLE IF NOT EXISTSradgroupreply (
id serial PRIMARY KEY,
GroupName text NOT NULL DEFAULT '',
Attribute text NOT NULL DEFAULT '',
@@ -128,7 +128,7 @@ create index radgroupreply_GroupName on radgroupreply (GroupName,Attribute);
/*
* Table structure for table 'radreply'
*/
CREATE TABLE radreply (
CREATE TABLE IF NOT EXISTSradreply (
id serial PRIMARY KEY,
UserName text NOT NULL DEFAULT '',
Attribute text NOT NULL DEFAULT '',
@@ -144,7 +144,7 @@ create index radreply_UserName on radreply (UserName,Attribute);
/*
* Table structure for table 'radusergroup'
*/
CREATE TABLE radusergroup (
CREATE TABLE IF NOT EXISTSradusergroup (
id serial PRIMARY KEY,
UserName text NOT NULL DEFAULT '',
GroupName text NOT NULL DEFAULT '',
@@ -160,7 +160,7 @@ create index radusergroup_UserName on radusergroup (UserName);
-- Table structure for table 'radpostauth'
--

CREATE TABLE radpostauth (
CREATE TABLE IF NOT EXISTSradpostauth (
id bigserial PRIMARY KEY,
username text NOT NULL,
pass text,
@@ -173,7 +173,7 @@ CREATE TABLE radpostauth (
/*
* Table structure for table 'nas'
*/
CREATE TABLE nas (
CREATE TABLE IF NOT EXISTSnas (
id serial PRIMARY KEY,
nasname text NOT NULL,
shortname text NOT NULL,
@@ -10,7 +10,7 @@
--
-- Table structure for table 'radacct'
--
CREATE TABLE radacct (
CREATE TABLE IF NOT EXISTS radacct (
radacctid INTEGER PRIMARY KEY AUTOINCREMENT,
acctsessionid varchar(64) NOT NULL default '',
acctuniqueid varchar(32) NOT NULL default '',
@@ -58,7 +58,7 @@ CREATE INDEX nasipaddress ON radacct(nasipaddress);
--
-- Table structure for table 'radcheck'
--
CREATE TABLE radcheck (
CREATE TABLE IF NOT EXISTS radcheck (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username varchar(64) NOT NULL default '',
attribute varchar(64) NOT NULL default '',
@@ -70,7 +70,7 @@ CREATE INDEX check_username ON radcheck(username);
--
-- Table structure for table 'radgroupcheck'
--
CREATE TABLE radgroupcheck (
CREATE TABLE IF NOT EXISTS radgroupcheck (
id INTEGER PRIMARY KEY AUTOINCREMENT,
groupname varchar(64) NOT NULL default '',
attribute varchar(64) NOT NULL default '',
@@ -82,7 +82,7 @@ CREATE INDEX check_groupname ON radgroupcheck(groupname);
--
-- Table structure for table 'radgroupreply'
--
CREATE TABLE radgroupreply (
CREATE TABLE IF NOT EXISTS radgroupreply (
id INTEGER PRIMARY KEY AUTOINCREMENT,
groupname varchar(64) NOT NULL default '',
attribute varchar(64) NOT NULL default '',
@@ -94,7 +94,7 @@ CREATE INDEX reply_groupname ON radgroupreply(groupname);
--
-- Table structure for table 'radreply'
--
CREATE TABLE radreply (
CREATE TABLE IF NOT EXISTS radreply (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username varchar(64) NOT NULL default '',
attribute varchar(64) NOT NULL default '',
@@ -106,7 +106,7 @@ CREATE INDEX reply_username ON radreply(username);
--
-- Table structure for table 'radusergroup'
--
CREATE TABLE radusergroup (
CREATE TABLE IF NOT EXISTS radusergroup (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username varchar(64) NOT NULL default '',
groupname varchar(64) NOT NULL default '',
@@ -117,7 +117,7 @@ CREATE INDEX usergroup_username ON radusergroup(username);
--
-- Table structure for table 'radpostauth'
--
CREATE TABLE radpostauth (
CREATE TABLE IF NOT EXISTS radpostauth (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username varchar(64) NOT NULL default '',
pass varchar(64) NOT NULL default '',
@@ -128,7 +128,7 @@ CREATE TABLE radpostauth (
--
-- Table structure for table 'nas'
--
CREATE TABLE nas (
CREATE TABLE IF NOT EXISTS nas (
id INTEGER PRIMARY KEY AUTOINCREMENT,
nasname varchar(128) NOT NULL,
shortname varchar(32),

0 comments on commit 8207754

Please sign in to comment.
You can’t perform that action at this time.