<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
    http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">

  <changeSet id="0001" author="hairuulin.b" dbms="postgresql">
    <comment>add new table public.workflow_logs</comment>
    <sql>
    CREATE TABLE IF NOT EXISTS public.workflow_logs
	(
		logging_id bigserial,
		loggingdate timestamp with time zone,
		loggingphase text COLLATE pg_catalog."default",
		workflowname text COLLATE pg_catalog."default",
		workflowfilename text COLLATE pg_catalog."default",
		workflowstart timestamp with time zone,
		workflowend timestamp with time zone,
		workflowlogchannelid text COLLATE pg_catalog."default",
		workflowparentlogchannelid text COLLATE pg_catalog."default",
		workflowlogging text COLLATE pg_catalog."default",
		workflowerrorcount integer,
		workflowstatusdescription text COLLATE pg_catalog."default",
		CONSTRAINT workflow_logs_pkey PRIMARY KEY (logging_id)
	)
	TABLESPACE pg_default;
	ALTER TABLE IF EXISTS public.workflow_logs
		OWNER to "ervu-dashboard";
    </sql>
  </changeSet>
  
  <changeSet id="0002" author="hairuulin.b" dbms="postgresql">
    <comment>add new table public.action_logs</comment>
   <sql>
   CREATE TABLE IF NOT EXISTS public.action_logs
	(
		action_log_id bigserial,
		loggingdate timestamp with time zone,
		workflowname text COLLATE pg_catalog."default",
		workflowfilename text COLLATE pg_catalog."default",
		workflowlogchannelid text COLLATE pg_catalog."default",
		workflowparentlogchannelid text COLLATE pg_catalog."default",
		actionname text COLLATE pg_catalog."default",
		actionnr integer,
		actionresult boolean,
		actionlogchannelid text COLLATE pg_catalog."default",
		actionloggingtext text COLLATE pg_catalog."default",
		actionerrors integer,
		actionlogdate timestamp with time zone,
		actionduration integer,
		actionexitstatus integer,
		actionnrfilesretrieved integer,
		actionfilename text COLLATE pg_catalog."default",
		actioncomment text COLLATE pg_catalog."default",
		actionreason text COLLATE pg_catalog."default",
		CONSTRAINT action_logs_pkey PRIMARY KEY (action_log_id)
	)
	TABLESPACE pg_default;
	ALTER TABLE IF EXISTS public.action_logs
		OWNER to "ervu-dashboard";
   </sql>   
  </changeSet>
</databaseChangeLog>
