ALTER TABLE FILE_STORAGE ADD COLUMN STATE VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE FILE_STORAGE DROP COLUMN DO_PURGE;

DROP VIEW FILE_STORAGE_VIEW;

CREATE VIEW FILE_STORAGE_VIEW
AS SELECT
    CONCAT(BASE.PATH, '/', STORAGE.PATH) AS PATH,
    STORAGE.TYPE AS TYPE,
    STATE AS STATE,
    NODE AS NODE,
    DESCRIPTION AS DESCRIPTION,
    CREATE_DATE AS CREATE_DATE,
    STORAGE.ID AS ID,
    BASE.ID AS BASE_ID
FROM FILE_STORAGE STORAGE
INNER JOIN FILE_STORAGE_BASE BASE ON STORAGE.BASE_ID=BASE.ID;
