Subversion Repositories ALCASAR

Rev

Rev 3202 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3202 Rev 3209
Line 6... Line 6...
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
#
7
#
8
# Migrate database structure to ALCASAR 3.7.0
8
# Migrate database structure to ALCASAR 3.7.0
9
# Changes:
9
# Changes:
10
# - Update radacct table
10
# - Update radacct table
11
#     - remove 'groupname', 'acctstartdelay', 'acctstopdelay' & 'xascendsessionsvrkey'
11
#     - remove 'groupname'
12
#     - add 'acctupdatetime', 'acctinterval', 'framedipv6address', 'framedipv6prefix', 'framedinterfaceid', 'delegatedipv6prefix' & 'class'
12
#     - add 'acctupdatetime', 'acctinterval', 'framedipv6address', 'framedipv6prefix', 'framedinterfaceid', 'delegatedipv6prefix' & 'class'
13
#     - change 'acctsessionid', 'acctuniqueid', 'nasportid', 'connectinfo start' & 'connectinfo stop'
13
#     - change 'acctsessionid', 'acctuniqueid', 'nasportid', 'connectinfo start' & 'connectinfo stop'
14
#     - KEY add: 'framedipv6address', 'framedipv6prefix', 'framedinterfaceid', 'delegatedipv6prefix', acctinterval & class
14
#     - KEY add: 'framedipv6address', 'framedipv6prefix', 'framedinterfaceid', 'delegatedipv6prefix', acctinterval & class
15
# - Update radpostauth table
15
# - Update radpostauth table
16
#     - add 'class'
16
#     - add 'class'
Line 34... Line 34...
34
		[ $? -ne 0 ] && echo "[SQL] ERROR (\"$1\")"
34
		[ $? -ne 0 ] && echo "[SQL] ERROR (\"$1\")"
35
	fi
35
	fi
36
}
36
}
37
 
37
 
38
# Update radacct table attributes
38
# Update radacct table attributes
39
db_query "ALTER TABLE radacct DROP COLUMN IF EXISTS groupname, DROP COLUMN IF EXISTS acctstartdelay, DROP COLUMN IF EXISTS acctstopdelay, DROP COLUMN IF EXISTS xascendsessionsvrkey;"
39
db_query "ALTER TABLE radacct DROP COLUMN IF EXISTS groupname"
40
 
40
 
41
db_query "ALTER TABLE radacct ADD COLUMN IF NOT EXISTS acctupdatetime datetime DEFAULT NULL;"
41
db_query "ALTER TABLE radacct ADD COLUMN IF NOT EXISTS acctupdatetime datetime DEFAULT NULL;"
42
db_query "ALTER TABLE radacct ADD COLUMN IF NOT EXISTS acctinterval int(12) DEFAULT NULL;"
42
db_query "ALTER TABLE radacct ADD COLUMN IF NOT EXISTS acctinterval int(12) DEFAULT NULL;"
43
db_query "ALTER TABLE radacct ADD COLUMN IF NOT EXISTS framedipv6address varchar(45) COLLATE utf8_bin NOT NULL DEFAULT '';"
43
db_query "ALTER TABLE radacct ADD COLUMN IF NOT EXISTS framedipv6address varchar(45) COLLATE utf8_bin NOT NULL DEFAULT '';"
44
db_query "ALTER TABLE radacct ADD COLUMN IF NOT EXISTS framedipv6prefix varchar(45) COLLATE utf8_bin NOT NULL DEFAULT '';"
44
db_query "ALTER TABLE radacct ADD COLUMN IF NOT EXISTS framedipv6prefix varchar(45) COLLATE utf8_bin NOT NULL DEFAULT '';"