| 1 | 
           rodolico | 
           1 | 
           drop table if exists document;
  | 
        
        
            | 
            | 
           2 | 
           drop table if exists document_link;
  | 
        
        
            | 
            | 
           3 | 
           drop table if exists document_mime_type;
  | 
        
        
            | 
            | 
           4 | 
           drop view if exists client_documents;
  | 
        
        
            | 
            | 
           5 | 
           drop view if exists site_documents;
  | 
        
        
            | 
            | 
           6 | 
           drop view if exists device_documents;
  | 
        
        
            | 
            | 
           7 | 
              | 
        
        
            | 
            | 
           8 | 
           delete from _system where group_name = 'Modules' and key_name = 'Documents';
  | 
        
        
            | 
            | 
           9 | 
              | 
        
        
            | 
            | 
           10 | 
              | 
        
        
            | 
            | 
           11 | 
           /* Menu Options */
  | 
        
        
            | 
            | 
           12 | 
           create table temp 
  | 
        
        
            | 
            | 
           13 | 
              select * 
  | 
        
        
            | 
            | 
           14 | 
              from menu 
  | 
        
        
            | 
            | 
           15 | 
              where parent_id is null or parent_id not in  (select menu_id from menu where caption = 'Documents');
  | 
        
        
            | 
            | 
           16 | 
           delete from menu;
  | 
        
        
            | 
            | 
           17 | 
           insert into menu select * from temp;
  | 
        
        
            | 
            | 
           18 | 
           drop table temp;
  | 
        
        
            | 
            | 
           19 | 
           delete from menu where caption = 'Documents' and parent_id is null;
  | 
        
        
            | 
            | 
           20 | 
              |