<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
  <table name="mst_core_message" resource="default" engine="innodb" comment="Mirasvit Core Message">
    <column xsi:type="int" name="message_id" padding="10" unsigned="true" nullable="false" identity="true" comment="Message Id"/>
    <column xsi:type="varchar" name="reference_id" nullable="false" length="64" comment="The message's id in lc"/>
    <column xsi:type="varchar" name="severity" nullable="false" length="16" default="notice" comment="Severity"/>
    <column xsi:type="varchar" name="title" nullable="false" length="255" default="" comment="Title"/>
    <column xsi:type="text" name="text" nullable="true" comment="Text"/>
    <column xsi:type="varchar" name="url" nullable="false" length="1024" default="" comment="Url"/>
    <column xsi:type="varchar" name="cta" nullable="false" length="255" default="" comment="Call To Action Label"/>
    <column xsi:type="smallint" name="dismissible" padding="5" unsigned="true" nullable="false" default="1" comment="Whether an admin user may hide it"/>
    <column xsi:type="smallint" name="is_active" padding="5" unsigned="true" nullable="false" default="1" comment="Whether it is in the feed now"/>
    <column xsi:type="text" name="dismissed_by" nullable="true" comment="JSON array of admin user ids"/>
    <constraint xsi:type="primary" referenceId="PRIMARY">
      <column name="message_id"/>
    </constraint>
    <constraint xsi:type="unique" referenceId="MST_CORE_MESSAGE_REFERENCE_ID">
      <column name="reference_id"/>
    </constraint>
  </table>
</schema>
