-- drop view to remove dependencies
DROP VIEW public."LogView";

-- add type column
ALTER TABLE public."Log"
ADD COLUMN "Type" character varying(64) NOT NULL DEFAULT 'Error';

-- change app column to varying 64
ALTER TABLE public."Log"
ALTER COLUMN "App" TYPE character varying(64);

-- recreate view
CREATE OR REPLACE VIEW public."LogView" AS
 SELECT 'Timestamp'::text AS "Timestamp",
    'App'::character varying AS "App",
    'Type'::character varying AS "Type",
    'Client'::character varying AS "Client",
    'Message'::text AS "Message",
    'Misc'::text AS "Misc",
    'Stack'::text AS "Stack",
    '0'::bigint AS "ID"
UNION ALL
 SELECT COALESCE(to_char("Log"."Timestamp", 'YYYY-MM-DD HH24:MI:SS'::text), ''::text) AS "Timestamp",
    "Log"."App",
    "Log"."Type",
    "Log"."Client",
    "Log"."Message",
    "Log"."Misc",
    "Log"."Stack",
    "Log"."ID"
   FROM "Log"
  ORDER BY 8;