forked from flancer32/mage2_ext_csp
-
Notifications
You must be signed in to change notification settings - Fork 2
/
db_schema.xml
75 lines (70 loc) · 3.9 KB
/
db_schema.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?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="fl32_csp_report" resource="default" engine="innodb"
comment="CSP reports storage.">
<column name="id" xsi:type="int" padding="10" unsigned="true" nullable="false" identity="true"
comment="Item ID."/>
<column name="date" xsi:type="datetime" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
comment="Report registration date."/>
<column name="admin_area" xsi:type="boolean" default="false" nullable="false"
comment="Is report received in admin or storefront area?"/>
<column name="report" xsi:type="text" nullable="false"
comment="Report's raw data."/>
<constraint referenceId="PRIMARY" xsi:type="primary">
<column name="id"/>
</constraint>
</table>
<table name="fl32_csp_rule" resource="default" engine="innodb"
comment="CSP policy rules.">
<column name="id" xsi:type="int" padding="10" unsigned="true" nullable="false" identity="true"
comment="Rule ID."/>
<column name="enabled" xsi:type="boolean" default="false" nullable="false"
comment="Is policy rule enabled?"/>
<column name="admin_area" xsi:type="boolean" default="false" nullable="false"
comment="Is policy rule applied to admin or storefront area?"/>
<column name="type_id" xsi:type="tinyint" unsigned="true" nullable="false"
comment="Policy type ID."/>
<column name="source" xsi:type="varchar" nullable="false"
comment="Source value (schema, URL, hash, ...)."/>
<column name="reason" xsi:type="varchar" nullable="true"
comment="Reason for enabled/disabled rule"/>
<constraint referenceId="PRIMARY" xsi:type="primary">
<column name="id"/>
</constraint>
<constraint referenceId="UQ_RULE" xsi:type="unique">
<column name="admin_area"/>
<column name="type_id"/>
<column name="source"/>
</constraint>
<constraint referenceId="FK_TYPE_KEY" xsi:type="foreign"
table="fl32_csp_rule" referenceTable="fl32_csp_type_policy"
column="type_id" referenceColumn="id" onDelete="CASCADE"/>
</table>
<table name="fl32_csp_type_policy" resource="default" engine="innodb"
comment="Policy type (script-src, style-src, ...).">
<column name="id" xsi:type="tinyint" unsigned="true" nullable="false" identity="true"
comment="Policy type ID."/>
<column name="key" xsi:type="varchar" nullable="false"
comment="Type value."/>
<constraint referenceId="PRIMARY" xsi:type="primary">
<column name="id"/>
</constraint>
<constraint referenceId="UQ_TYPE_KEY" xsi:type="unique">
<column name="key"/>
</constraint>
</table>
<table name="fl32_csp_rule_sent" resource="default" engine="innodb"
comment="Table storing email-reported rules persistently">
<column xsi:type="smallint" name="csp_rule_sent_id" padding="6" unsigned="true" nullable="false"
identity="true" comment="Entity Id"/>
<column name="csp_rule_id" xsi:type="int" padding="10" unsigned="true" nullable="false" identity="false"/>
<column name="csp_rule_sent_to" nullable="true" xsi:type="text"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="csp_rule_sent_id"/>
</constraint>
<constraint xsi:type="foreign" referenceId="FK_FL32_CSP_RULE_ID"
column="csp_rule_id" table="fl32_csp_rule_sent"
referenceTable="fl32_csp_rule" referenceColumn="id" onDelete="CASCADE"/>
</table>
</schema>