2 -- DELETE from roles WHERE name='node';
4 -- recreate the min_role_id column
5 ALTER TABLE tag_types ADD COLUMN min_role_id integer REFERENCES roles;
7 -- compute the highest role available for each tag_type and store it as min_role_id
10 --- tmp - set to something so we can run down&up again
11 UPDATE tag_types SET min_role_id=10;
12 UPDATE tag_types SET min_role_id=20 WHERE tag_type_id%2=0;
14 DROP TABLE tag_type_role CASCADE;
16 --DROP VIEW view_tag_types;
17 --DROP VIEW tag_type_roles;
20 UPDATE plc_db_version SET subversion = 103;