f7d722087f06940e2c760f23a76406f533a28fe0
[plcapi.git] / migrations / 104-down-noderole.sql
1 -- reverting....
2 -- DELETE from roles WHERE name='node';
3
4 -- recreate the min_role_id column
5 ALTER TABLE tag_types ADD COLUMN min_role_id integer REFERENCES roles;
6
7 -- compute the highest role available for each tag_type and store it as min_role_id
8 -- xxx todo
9
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;
13
14 DROP TABLE tag_type_role CASCADE;
15 -- done by cascade
16 --DROP VIEW view_tag_types;
17 --DROP VIEW tag_type_roles;
18
19 --------------------
20 UPDATE plc_db_version SET subversion = 103;