diff --git a/server/debian/atomiadns-database.postinst b/server/debian/atomiadns-database.postinst index 1499656f..150f017d 100644 --- a/server/debian/atomiadns-database.postinst +++ b/server/debian/atomiadns-database.postinst @@ -269,7 +269,7 @@ if [ $retval != 0 ]; then echo "database zonedata already exist, but doesn't contain the atomiadns schema. You will have to make sure that the schema matches $basedir/schema manually" exit 1 else - latest_version="88" + latest_version="89" if [ "$schema_version" = "$latest_version" ]; then echo "The installed schema is the latest version, keeping the database as it is." @@ -597,6 +597,10 @@ if [ $retval != 0 ]; then execute_query "DROP TYPE _algorithmtype" fi + if [ "$schema_version" -lt 89 ]; then + execute_query "INSERT INTO allowed_type (type, synopsis, regexp) VALUES ('ALIAS', 'hostname', '^[a-z0-9_][a-z0-9._-]*$')" + fi + set_schema_version "$latest_version" else echo "database zonedata already exist, but contains a bad schema version ($schema_version), this should never happen and indicates a bug." diff --git a/server/schema/ddl.sql b/server/schema/ddl.sql index 0abf4e83..69fd1885 100644 --- a/server/schema/ddl.sql +++ b/server/schema/ddl.sql @@ -39,7 +39,7 @@ CREATE TABLE atomiadns_schemaversion ( version INT ); -INSERT INTO atomiadns_schemaversion (version) VALUES (87); +INSERT INTO atomiadns_schemaversion (version) VALUES (89); CREATE TABLE allow_zonetransfer ( id SERIAL PRIMARY KEY NOT NULL, @@ -91,7 +91,8 @@ INSERT INTO allowed_type (type, synopsis, regexp) VALUES ('SSHFP', 'algorithm fingerprinttype fingerprint', '^[0-9]+ [0-9]+ [0-9A-F]+$'), ('TLSA', 'usage selector type certificate', '^[0-9]+ [0-9]+ [0-9]+ [0-9A-F]+$'), ('TXT', 'quotedstring', '^"[^"]{0,255}"( "[^"]{0,255}")*$'), -('CAA', 'certificate authority authorization', '^([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5]) (issue|issuewild|iodef) ("[^"]{0,255}")*$'); +('CAA', 'certificate authority authorization', '^([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5]) (issue|issuewild|iodef) ("[^"]{0,255}")*$'), +('ALIAS', 'hostname', '^[a-z0-9_][a-z0-9._-]*$'); CREATE TABLE nameserver_group ( id SERIAL PRIMARY KEY NOT NULL,