[AB-263] adding stricter not null checks to database, disabling updates/inserts for created and updated columns to only rely on triggers

This commit is contained in:
Sheldan
2021-05-23 14:17:03 +02:00
parent 04a7cfafd7
commit 13a6e1fdca
145 changed files with 1204 additions and 350 deletions

View File

@@ -10,18 +10,18 @@
<createTable tableName="mute">
<column name="id" type="BIGINT" />
<column name="created" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
<constraints nullable="false"/>
</column>
<column name="reason" type="VARCHAR(255)">
<constraints nullable="true"/>
<constraints nullable="false"/>
</column>
<column name="trigger_key" type="VARCHAR(255)" />
<column name="updated" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="mute_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
<constraints nullable="false"/>
</column>
<column name="target_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
<constraints nullable="false"/>
</column>
<column name="muted_user_in_server_id" type="BIGINT">
<constraints nullable="false"/>
@@ -32,7 +32,9 @@
<column name="server_id" type="BIGINT">
<constraints nullable="false"/>
</column>
<column name="mute_ended" type="BOOLEAN"/>
<column name="mute_ended" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="message_id" type="BIGINT"/>
<column name="muting_user_in_server_id" type="BIGINT">
<constraints nullable="false"/>

View File

@@ -13,7 +13,7 @@
<constraints nullable="false" primaryKey="true" primaryKeyName="mute_role_pkey"/>
</column>
<column name="created" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
<constraints nullable="false"/>
</column>
<column name="updated" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="role_id" type="BIGINT">

View File

@@ -9,10 +9,10 @@
<changeSet author="Sheldan" id="user_note-table">
<createTable tableName="user_note">
<column autoIncrement="true" name="id" type="BIGINT" >
<constraints nullable="true"/>
<constraints nullable="false"/>
</column>
<column name="created" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
<constraints nullable="false"/>
</column>
<column name="updated" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="note" type="VARCHAR(2000)"/>

View File

@@ -9,19 +9,21 @@
<changeSet author="Sheldan" id="warning-table">
<createTable tableName="warning">
<column name="id" type="BIGINT">
<constraints nullable="true"/>
<constraints nullable="false"/>
</column>
<column name="created" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
<constraints nullable="false"/>
</column>
<column name="updated" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="decay_date" type="TIMESTAMP WITHOUT TIME ZONE"/>
<column name="decayed" type="BOOLEAN"/>
<column name="decayed" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="reason" type="VARCHAR(255)">
<constraints nullable="true"/>
<constraints nullable="false"/>
</column>
<column name="warn_date" type="TIMESTAMP WITHOUT TIME ZONE">
<constraints nullable="true"/>
<constraints nullable="false"/>
</column>
<column name="warned_user_in_server_id" type="BIGINT">
<constraints nullable="false"/>